YouTube | Facebook | X(Twitter) | RSS

レイヤー プロパティの説明・著作権

2016/9/1 (木)

//レイヤ プロパティの説明
ILayerGeneralProperties::LayerDescription
 
//////////////////////////////////////////////////////////////////////
c pLExt = (ILayerExtensions)axMapControl1.get_Layer(0);
IServerLayerExtension pSLE;
IPropertySet pProps;
object names;
object values;
String CopyrightTextstr = null;
 
for (int l = 0; l <= pLExt.ExtensionCount - 1; l++) {
    pSLE = pLExt.get_Extension(l) as IServerLayerExtension;
    pProps = pSLE.ServerProperties;
    pProps.GetAllProperties(out names, out  values);
    string[] namearray = (string[])names;
    object[] valuesarray = (object[])values;
 
    for (int k = 0; k < namearray.Length; k++)
    {
        System.Diagnostics.Debug.Print(namearray[k] + "," + valuesarray[k]);
        if (namearray[k].Equals("CopyrightText"))
        {
            CopyrightTextstr = (String)valuesarray[k];
 
        }
    }
}
System.Diagnostics.Debug.Print("Value = " + CopyrightTextstr);
//////////////////////////////////////////////////////////////////////
ILayerGeneralProperties::LayerDescription
 
'レイヤ プロパティの著作権
'http://forums.esri.com/thread.asp?c=93&f=993&t=220817
Option Explicit
Sub Test()
    Dim pMxDoc As IMxDocument
    Set pMxDoc = ThisDocument
     
    Dim pLExt As ILayerExtensions
    Set pLExt = pMxDoc.FocusMap.Layer(0)
    Dim l As Long
    For l = 0 To pLExt.ExtensionCount - 1
        If TypeOf pLExt.Extension(l) Is IServerLayerExtension Then
            Dim pSLE As IServerLayerExtension
            Set pSLE = pLExt.Extension(l)
             
            Dim pProps As IPropertySet
            Set pProps = pSLE.ServerProperties
             
            Dim vNames As Variant, vVals As Variant
            pProps.GetAllProperties vNames, vVals
            Dim k As Long
            For k = 0 To UBound(vNames)
                If UCase(vNames(k)) = UCase("CopyrightText") Then
                    Debug.Print vVals(k)
                    pProps.SetProperty "CopyrightText", "updated " & Now
                End If
            Next k
            pSLE.ServerProperties = pProps
        End If
    Next l
End Sub
  • この記事を書いた人

羽田 康祐

伊達と酔狂のGISエンジニア。GIS上級技術者、Esri認定インストラクター、CompTIA CTT+ Classroom Trainer、潜水士、PADIダイブマスター、四アマ。WordPress は 2.1 からのユーザーで歴だけは長い。 代表著書『"地図リテラシー入門―地図の正しい読み方・描き方がわかる』 GIS を使った自己紹介はこちら。ESRIジャパン(株)所属、元青山学院大学非常勤講師を兼務。日本地図学会第31期常任委員。発言は個人の見解です。

-プログラミング, ArcGIS
-, ,