リフレクション


COMクラスのラッピング定義
ESRI.ArcGIS.Carto.FeatureLayerClassは、FeatureLayerClassの持つすべてのインタフェースを継承したクラス定義
なので例えば下記のようなコードで全てのgetter/setterを持つプロパティが取れる。

上手い事使えば値格納型やらなんやらが作れるかも

続き
リフレクションとJson

using ESRI.ArcGIS.Carto;
using System;
using System.Diagnostics;
Type t = typeof(FeatureLayerClass);

var props = t.GetProperties();

foreach (var p in props)
{
  if (!p.CanRead || !p.CanWrite)
    continue;

  Debug.Print("{0} : {1}", p.Name, p.PropertyType.FullName);
}

結果は下記のようになる。
COMは同一名称でも違うインタフェース経由という実装が出来るので罪深い。

Name : System.String
MinimumScale : System.Double
MaximumScale : System.Double
Visible : System.Boolean
ShowTips : System.Boolean
Cached : System.Boolean
FeatureClass : ESRI.ArcGIS.Geodatabase.IFeatureClass
DataSourceType : System.String
DisplayField : System.String
Selectable : System.Boolean
ScaleSymbols : System.Boolean
IFeatureLayer2_FeatureClass : ESRI.ArcGIS.Geodatabase.IFeatureClass
IFeatureLayer2_DataSourceType : System.String
IFeatureLayer2_DisplayField : System.String
IFeatureLayer2_Selectable : System.Boolean
IFeatureLayer2_ScaleSymbols : System.Boolean
IGeoFeatureLayer_Name : System.String
IGeoFeatureLayer_MinimumScale : System.Double
IGeoFeatureLayer_MaximumScale : System.Double
IGeoFeatureLayer_Visible : System.Boolean
IGeoFeatureLayer_ShowTips : System.Boolean
IGeoFeatureLayer_Cached : System.Boolean
IGeoFeatureLayer_FeatureClass : ESRI.ArcGIS.Geodatabase.IFeatureClass
IGeoFeatureLayer_DataSourceType : System.String
IGeoFeatureLayer_DisplayField : System.String
IGeoFeatureLayer_Selectable : System.Boolean
IGeoFeatureLayer_ScaleSymbols : System.Boolean
Renderer : ESRI.ArcGIS.Carto.IFeatureRenderer
RendererPropertyPageClassID : ESRI.ArcGIS.esriSystem.UID
DisplayAnnotation : System.Boolean
AnnotationPropertiesID : ESRI.ArcGIS.esriSystem.UID
AnnotationProperties : ESRI.ArcGIS.Carto.IAnnotateLayerPropertiesCollection
ExclusionSet : ESRI.ArcGIS.Carto.IFeatureIDSet
ILayer_Name : System.String
ILayer_MinimumScale : System.Double
ILayer_MaximumScale : System.Double
ILayer_Visible : System.Boolean
ILayer_ShowTips : System.Boolean
ILayer_Cached : System.Boolean
ILayer2_Name : System.String
ILayer2_AreaOfInterest : ESRI.ArcGIS.Geometry.IEnvelope
ILayer2_MinimumScale : System.Double
ILayer2_MaximumScale : System.Double
ILayer2_Visible : System.Boolean
ILayer2_ShowTips : System.Boolean
ILayer2_Cached : System.Boolean
SelectionSet : ESRI.ArcGIS.Geodatabase.ISelectionSet
CombinationMethod : ESRI.ArcGIS.Carto.esriSelectionResultEnum
BufferDistance : System.Double
SetSelectionSymbol : System.Boolean
SelectionColor : ESRI.ArcGIS.Display.IColor
SelectionSymbol : ESRI.ArcGIS.Display.ISymbol
DefinitionExpression : System.String
RelationshipClass : ESRI.ArcGIS.Geodatabase.IRelationshipClass
IFeatureLayerDefinition2_DefinitionExpression : System.String
IFeatureLayerDefinition2_RelationshipClass : ESRI.ArcGIS.Geodatabase.IRelationshipClass
SearchOrder : ESRI.ArcGIS.Geodatabase.esriSearchOrder
ITableDefinition_DefinitionExpression : System.String
SymbolsAreGraduated : System.Boolean
ExpressionProperties : ESRI.ArcGIS.Carto.IDisplayExpressionProperties
DataSourceName : ESRI.ArcGIS.esriSystem.IName
RelativeBase : System.String
IDataLayer2_DataSourceName : ESRI.ArcGIS.esriSystem.IName
IDataLayer2_RelativeBase : System.String
DrawingPropsDirty : System.Boolean
DisplayFilter : ESRI.ArcGIS.Display.IDisplayFilter
Hyperlink : ESRI.ArcGIS.Carto.IHyperlink
HotlinkField : System.String
HotlinkType : ESRI.ArcGIS.Carto.esriHyperlinkType
MacroName : System.String
IHotlinkExpression_ExpressionProperties : ESRI.ArcGIS.Carto.IHotLinkExpressionProperties
SupportsInteractive : System.Boolean
Transparency : System.Int16
Contrast : System.Int16
Brightness : System.Int16
BrowseName : System.String
MapLevel : System.Int32
UseSymbolLevels : System.Boolean
LayerWeight : System.Double
ITableSelection_SelectionSet : ESRI.ArcGIS.Geodatabase.ISelectionSet
Temporary : System.Boolean
LayerDescription : System.String
HTMLPopupEnabled : System.Boolean
HTMLPresentationStyle : ESRI.ArcGIS.Carto.esriHTMLPopupStyle
HTMLHideFieldNameColumn : System.Boolean
HTMLRedirectField : System.String
HTMLRedirectFieldPrefix : System.String
HTMLRedirectFieldSuffix : System.String
HTMLXSLStylesheet : System.String
HTMLUseCodedDomainValues : System.Boolean
HTMLDownloadAttachmentData : System.Boolean
UseTime : System.Boolean
ITimeData2_UseTime : System.Boolean
HasLiveData : System.Boolean
StartTimeFieldName : System.String
EndTimeFieldName : System.String
TimeValueFormat : System.String
TrackIDFieldName : System.String
ITimeTableDefinition_TimeReference : ESRI.ArcGIS.esriSystem.ITimeReference
CustomTimeExtent : ESRI.ArcGIS.esriSystem.ITimeExtent
TimeDataCumulative : System.Boolean
TimeInterval : System.Double
TimeIntervalUnits : ESRI.ArcGIS.esriSystem.esriTimeUnits
TimeOffset : System.Double
TimeOffsetUnits : ESRI.ArcGIS.esriSystem.esriTimeUnits
TimeDimensionName : System.String
TimeDimensionFormat : System.String
ITimeDimensionDefinition_TimeReference : ESRI.ArcGIS.esriSystem.ITimeReference
カテゴリー: 開発 タグ: パーマリンク