Esempio n. 1
0
        public static IFeatureLayer GetFirstZDLayer(IMap imap_0)
        {
            IFeatureLayer featureLayer;
            IEnumLayer    layers = imap_0.Layers[null, true];

            layers.Reset();
            ILayer layer = layers.Next();

            while (true)
            {
                if (layer == null)
                {
                    featureLayer = null;
                    break;
                }
                else if (!(layer is IFeatureLayer) || !ZDRegister.IsZDFeatureClass((layer as IFeatureLayer).FeatureClass))
                {
                    layer = layers.Next();
                }
                else
                {
                    featureLayer = layer as IFeatureLayer;
                    break;
                }
            }
            return(featureLayer);
        }
Esempio n. 2
0
        private static bool CheckLayerIsCanEditZD(IFeatureLayer ifeatureLayer_0)
        {
            bool flag  = ZDEditTools.LayerCanEdit(ifeatureLayer_0);
            bool flag1 = flag;

            if (flag)
            {
                flag1 = ZDRegister.IsZDFeatureClass(ifeatureLayer_0.FeatureClass);
            }
            return(flag1);
        }
Esempio n. 3
0
 private static void CheckGroupLayer(List <IFeatureLayer> list_0, ICompositeLayer icompositeLayer_0)
 {
     for (int i = 0; i < icompositeLayer_0.Count; i++)
     {
         ILayer layer = icompositeLayer_0.Layer[i];
         if (layer is IGroupLayer)
         {
             ZDEditTools.CheckGroupLayer(list_0, layer as ICompositeLayer);
         }
         else if (layer is IFeatureLayer)
         {
             IFeatureLayer featureLayer = layer as IFeatureLayer;
             if (ZDRegister.IsZDFeatureClass((layer as IFeatureLayer).FeatureClass))
             {
                 list_0.Add(featureLayer);
             }
         }
     }
 }
Esempio n. 4
0
        public static bool HasZDLayer(IMap imap_0)
        {
            bool       flag   = false;
            IEnumLayer layers = imap_0.Layers[null, true];

            layers.Reset();
            for (ILayer i = layers.Next(); i != null; i = layers.Next())
            {
                if (i is IFeatureLayer)
                {
                    bool flag1 = ZDRegister.IsZDFeatureClass((i as IFeatureLayer).FeatureClass);
                    flag = flag1;
                    if (flag1)
                    {
                        break;
                    }
                }
            }
            return(flag);
        }
Esempio n. 5
0
        public static List <IFeatureLayer> GetZDLayers(IMap imap_0)
        {
            List <IFeatureLayer> featureLayers = new List <IFeatureLayer>();

            for (int i = 0; i < imap_0.LayerCount; i++)
            {
                ILayer layer = imap_0.Layer[i];
                if (layer is IGroupLayer)
                {
                    ZDEditTools.CheckGroupLayer(featureLayers, layer as ICompositeLayer);
                }
                else if (layer is IFeatureLayer)
                {
                    IFeatureLayer featureLayer = layer as IFeatureLayer;
                    if (ZDRegister.IsZDFeatureClass((layer as IFeatureLayer).FeatureClass))
                    {
                        featureLayers.Add(featureLayer);
                    }
                }
            }
            return(featureLayers);
        }