Inheritance: ESRI.ArcGIS.Catalog.IGxObject, ESRI.ArcGIS.Catalog.IGxObjectUI, ESRI.ArcGIS.Catalog.IGxObjectEdit, ESRI.ArcGIS.Catalog.IGxObjectProperties
Ejemplo n.º 1
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);
            }
        }
        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;
        }