Exemplo n.º 1
0
 public bool HasChildren(string parentDir, ESRI.ArcGIS.esriSystem.IFileNames fileNames)
 {
     if (fileNames != null)
     {
         fileNames.Reset();
         string fileName = fileNames.Next();
         while ((fileName != null) & (fileName.Length > 0))
         {
             if (fileName.ToUpper().EndsWith(".PY"))
             {
                 return(true);
             }
             fileName = fileNames.Next();
         }
     }
     return(false);
 }
Exemplo n.º 2
0
        public ESRI.ArcGIS.Catalog.IEnumGxObject GetChildren(string parentDir, ESRI.ArcGIS.esriSystem.IFileNames fileNames)
        {
            IGxObjectArray gxChildren = new GxObjectArray();

            if (fileNames != null)
            {
                fileNames.Reset();

                string fileName = fileNames.Next();
                while (fileName != null)
                {
                    if (fileName.Length > 0)
                    {
                        if (!(fileNames.IsDirectory()))
                        {
                            if (fileName.ToUpper().EndsWith(".PY"))
                            {
                                GxPyObject gxChild = new GxPyObject(fileName);
                                gxChildren.Insert(-1, gxChild);
                                gxChild = null;
                                // Remove file name from the list for other GxObjectFactories to search.
                                fileNames.Remove();
                            }
                        }
                    }
                    fileName = fileNames.Next();
                }
            }

            if (gxChildren.Count > 0)
            {
                IEnumGxObject enumChildren = (IEnumGxObject)gxChildren;
                enumChildren.Reset();
                return(enumChildren);
            }
            else
            {
                return(null);
            }
        }