Esempio n. 1
0
 private void method_0()
 {
     this.bool_0 = true;
     this.igxObjectArray_0.Empty();
     if (this.idatasetName_0.Type == esriDatasetType.esriDTRasterDataset)
     {
         try
         {
             IEnumDatasetName subsetNames = this.idatasetName_0.SubsetNames;
             subsetNames.Reset();
             for (IDatasetName name2 = subsetNames.Next(); name2 != null; name2 = subsetNames.Next())
             {
                 IGxObject obj2 = new GxRasterDataset();
                 (obj2 as IGxDataset).DatasetName = name2;
                 obj2.Attach(this, this.igxCatalog_0);
             }
         }
         catch
         {
         }
     }
     else if (this.idatasetName_0.Type != esriDatasetType.esriDTRasterCatalog)
     {
     }
 }
Esempio n. 2
0
 private void method_0(IWorkspace iworkspace_1)
 {
     try
     {
         IEnumDatasetName name = iworkspace_1.get_DatasetNames(esriDatasetType.esriDTAny);
         name.Reset();
         IDatasetName name2 = name.Next();
         IGxObject    obj2  = null;
         while (name2 != null)
         {
             obj2 = null;
             if ((name2.Type == esriDatasetType.esriDTRasterDataset) ||
                 (name2.Type == esriDatasetType.esriDTRasterCatalog))
             {
                 obj2 = new GxRasterDataset();
             }
             else if ((name2.Type == esriDatasetType.esriDTFeatureClass) ||
                      (name2.Type == esriDatasetType.esriDTTable))
             {
                 obj2 = new GxDataset();
             }
             else
             {
                 obj2 = new GxDataset();
             }
             if (obj2 != null)
             {
                 (obj2 as IGxDataset).DatasetName = name2;
                 obj2.Attach(this, this.igxCatalog_0);
             }
             name2 = name.Next();
         }
     }
     catch (Exception exception)
     {
         Logger.Current.Error("", exception, "");
     }
 }
Esempio n. 3
0
        public void OpenFolder()
        {
            try
            {
                try
                {
                    this.string_0 = (this.igxObject_0 as IGxFile).Path;
                    if (this.string_0 == null)
                    {
                        if (this.OnReadCompleted != null)
                        {
                            this.OnReadCompleted();
                        }
                        return;
                    }
                    string[] directories = Directory.GetDirectories(this.string_0);
                    IArray   array       = new ArrayClass();
                    foreach (string str in directories)
                    {
                        IGxObject      obj2;
                        IDatasetName   name;
                        IWorkspaceName name2;
                        string         str2 = this.method_1(str);
                        switch (str2)
                        {
                        case null:
                            break;

                        case "FOLDER":
                            obj2 = new GxFolder();
                            (obj2 as IGxFile).Path = str;
                            obj2.Attach(this.igxObject_0, this.igxCatalog_0);
                            break;

                        case "TIN":
                            obj2  = new GxDataset();
                            name  = new TinNameClass();
                            name2 = new WorkspaceNameClass
                            {
                                WorkspaceFactoryProgID = "esriDataSourcesFile.TinWorkspaceFactory",
                                PathName = Path.GetDirectoryName(str)
                            };
                            name.Name          = Path.GetFileName(str);
                            name.WorkspaceName = name2;
                            (obj2 as IGxDataset).DatasetName = name;
                            array.Add(obj2);
                            break;

                        case "GRID":
                            obj2  = new GxRasterDataset();
                            name  = new RasterDatasetNameClass();
                            name2 = new WorkspaceNameClass
                            {
                                WorkspaceFactoryProgID = "esriDataSourcesFile.RasterWorkspaceFactory",
                                PathName = Path.GetDirectoryName(str)
                            };
                            name.Name          = Path.GetFileName(str);
                            name.WorkspaceName = name2;
                            (obj2 as IGxDataset).DatasetName = name;
                            array.Add(obj2);
                            break;

                        default:
                            if (!(str2 == "COVERAGE"))
                            {
                                if (str2 == "FILEGDB")
                                {
                                    obj2  = new GxDatabase();
                                    name2 = new WorkspaceNameClass
                                    {
                                        WorkspaceFactoryProgID = "esriDataSourcesGDB.FileGDBWorkspaceFactory.1",
                                        PathName = str
                                    };
                                    (obj2 as IGxDatabase).WorkspaceName = name2;
                                    array.Add(obj2);
                                }
                            }
                            else
                            {
                                obj2  = new GxCoverageDataset();
                                name  = new CoverageNameClass();
                                name2 = new WorkspaceNameClass
                                {
                                    WorkspaceFactoryProgID = "esriDataSourcesFile.ArcInfoWorkspaceFactory.1",
                                    PathName = Path.GetDirectoryName(str)
                                };
                                name.Name          = Path.GetFileName(str);
                                name.WorkspaceName = name2;
                                (obj2 as IGxDataset).DatasetName = name;
                                array.Add(obj2);
                            }
                            break;
                        }
                    }
                    for (int i = 0; i < array.Count; i++)
                    {
                        (array.get_Element(i) as IGxObject).Attach(this.igxObject_0, this.igxCatalog_0);
                    }
                    foreach (string str3 in Directory.GetFiles(this.string_0))
                    {
                        string str4 = Path.GetExtension(str3).ToLower();
                        if (str4 != null)
                        {
                            this.method_0(str3, str4, false);
                        }
                    }
                }
                catch
                {
                }
            }
            finally
            {
            }
            if (this.OnReadCompleted != null)
            {
                this.OnReadCompleted();
            }
        }
Esempio n. 4
0
        private void method_3(string[] string_1)
        {
            foreach (string str in string_1)
            {
                IDatasetName   name;
                IWorkspaceName name2;
                IGxObject      unk  = null;
                string         str2 = this.method_1(str);
                switch (str2)
                {
                case null:
                    break;

                case "FOLDER":
                    unk = new GxFolder();
                    (unk as IGxFile).Path = str;
                    unk.Attach(this.igxObject_0, this.igxCatalog_0);
                    break;

                case "TIN":
                    unk   = new GxDataset();
                    name  = new TinNameClass();
                    name2 = new WorkspaceNameClass
                    {
                        WorkspaceFactoryProgID = "esriDataSourcesFile.TinWorkspaceFactory",
                        PathName = Path.GetDirectoryName(str)
                    };
                    name.Name          = Path.GetFileName(str);
                    name.WorkspaceName = name2;
                    (unk as IGxDataset).DatasetName = name;
                    this.iarray_0.Add(unk);
                    break;

                case "GRID":
                    unk   = new GxRasterDataset();
                    name  = new RasterDatasetNameClass();
                    name2 = new WorkspaceNameClass
                    {
                        WorkspaceFactoryProgID = "esriDataSourcesFile.RasterWorkspaceFactory",
                        PathName = Path.GetDirectoryName(str)
                    };
                    name.Name          = Path.GetFileName(str);
                    name.WorkspaceName = name2;
                    (unk as IGxDataset).DatasetName = name;
                    this.iarray_0.Add(unk);
                    break;

                default:
                    if (!(str2 == "COVERAGE"))
                    {
                        if (str2 == "FILEGDB")
                        {
                            unk   = new GxDatabase();
                            name2 = new WorkspaceNameClass
                            {
                                WorkspaceFactoryProgID = "esriDataSourcesGDB.FileGDBWorkspaceFactory.1",
                                PathName = str
                            };
                            (unk as IGxDatabase).WorkspaceName = name2;
                            this.iarray_0.Add(unk);
                        }
                    }
                    else
                    {
                        unk   = new GxCoverageDataset();
                        name  = new CoverageNameClass();
                        name2 = new WorkspaceNameClass
                        {
                            WorkspaceFactoryProgID = "esriDataSourcesFile.ArcInfoWorkspaceFactory.1",
                            PathName = Path.GetDirectoryName(str)
                        };
                        name.Name          = Path.GetFileName(str);
                        name.WorkspaceName = name2;
                        (unk as IGxDataset).DatasetName = name;
                        this.iarray_0.Add(unk);
                    }
                    break;
                }
            }
        }
Esempio n. 5
0
        private bool method_0(string string_1, string string_2, bool bool_0)
        {
            IGxObject      obj2 = null;
            IDatasetName   name;
            IWorkspaceName name2;

            switch (string_2.ToLower())
            {
            case ".bmp":
            case ".png":
            case ".jpg":
            case ".tif":
            case ".img":
            case ".sid":
                obj2  = new GxRasterDataset();
                name  = new RasterDatasetNameClass();
                name2 = new WorkspaceNameClass
                {
                    WorkspaceFactoryProgID = "esriDataSourcesFile.RasterWorkspaceFactory",
                    PathName = Path.GetDirectoryName(string_1)
                };
                name.Name          = Path.GetFileName(string_1);
                name.WorkspaceName = name2;
                (obj2 as IGxDataset).DatasetName = name;
                obj2.Attach(this.igxObject_0, this.igxCatalog_0);
                if (bool_0)
                {
                    this.igxCatalog_0.ObjectAdded(obj2);
                }
                return(true);

            case ".mdb":
                obj2  = new GxDatabase();
                name2 = new WorkspaceNameClass
                {
                    WorkspaceFactoryProgID = "esriDataSourcesGDB.AccessWorkspaceFactory",
                    PathName = string_1
                };
                (obj2 as IGxDatabase).WorkspaceName = name2;
                obj2.Attach(this.igxObject_0, this.igxCatalog_0);
                if (bool_0)
                {
                    this.igxCatalog_0.ObjectAdded(obj2);
                }
                return(true);

            case ".shp":
                obj2  = new GxShapefileDataset();
                name  = new FeatureClassNameClass();
                name2 = new WorkspaceNameClass
                {
                    WorkspaceFactoryProgID = "esriDataSourcesFile.ShapefileWorkspaceFactory",
                    PathName = Path.GetDirectoryName(string_1)
                };
                name.Name          = Path.GetFileName(string_1);
                name.WorkspaceName = name2;
                (obj2 as IGxDataset).DatasetName = name;
                obj2.Attach(this.igxObject_0, this.igxCatalog_0);
                if (bool_0)
                {
                    this.igxCatalog_0.ObjectAdded(obj2);
                }
                return(true);

            case ".dbf":
                if (
                    !File.Exists(Path.Combine(Path.GetDirectoryName(string_1),
                                              Path.GetFileNameWithoutExtension(string_1) + ".shp")))
                {
                    obj2  = new GxDataset();
                    name  = new TableNameClass();
                    name2 = new WorkspaceNameClass
                    {
                        WorkspaceFactoryProgID = "esriDataSourcesFile.ShapefileWorkspaceFactory",
                        PathName = Path.GetDirectoryName(string_1)
                    };
                    name.Name          = Path.GetFileName(string_1);
                    name.WorkspaceName = name2;
                    (obj2 as IGxDataset).DatasetName = name;
                    obj2.Attach(this.igxObject_0, this.igxCatalog_0);
                    if (bool_0)
                    {
                        this.igxCatalog_0.ObjectAdded(obj2);
                    }
                    return(true);
                }
                return(false);

            case ".sde":
                obj2  = new GxDatabase();
                name2 = new WorkspaceNameClass
                {
                    WorkspaceFactoryProgID = "esriDataSourcesGDB.SdeWorkspaceFactory",
                    PathName = string_1
                };
                (obj2 as IGxDatabase).WorkspaceName = name2;
                obj2.Attach(this.igxObject_0, this.igxCatalog_0);
                if (bool_0)
                {
                    this.igxCatalog_0.ObjectAdded(obj2);
                }
                return(true);

            case ".lyr":
                obj2 = new GxLayer();
                (obj2 as IGxFile).Path = string_1;
                obj2.Attach(this.igxObject_0, this.igxCatalog_0);
                if (bool_0)
                {
                    this.igxCatalog_0.ObjectAdded(obj2);
                }
                return(true);

            case ".dwg":
            case ".dxf":
                obj2  = new GxCadDataset();
                name  = new CadDrawingNameClass();
                name2 = new WorkspaceNameClass
                {
                    WorkspaceFactoryProgID = "esriDataSourcesFile.CadWorkspaceFactory",
                    PathName = Path.GetDirectoryName(string_1)
                };
                name.Name          = Path.GetFileName(string_1);
                name.WorkspaceName = name2;
                (obj2 as IGxDataset).DatasetName = name;
                obj2.Attach(this.igxObject_0, this.igxCatalog_0);
                if (bool_0)
                {
                    this.igxCatalog_0.ObjectAdded(obj2);
                }
                return(true);

            case ".doc":
            case ".xls":
                obj2 = new GxOfficeFile();
                (obj2 as IGxFile).Path = string_1;
                obj2.Attach(this.igxObject_0, this.igxCatalog_0);
                if (bool_0)
                {
                    this.igxCatalog_0.ObjectAdded(obj2);
                }
                return(true);
            }
            return(false);
        }
Esempio n. 6
0
 private void method_0(IWorkspace iworkspace_1)
 {
     try
     {
         IEnumDatasetName name = iworkspace_1.get_DatasetNames(esriDatasetType.esriDTAny);
         name.Reset();
         IDatasetName name2 = name.Next();
         IGxObject    obj2  = null;
         while (name2 != null)
         {
             obj2 = null;
             if (this.IsEnterpriseGeodatabase)
             {
                 if ((name2.Type == esriDatasetType.esriDTRasterDataset) ||
                     (name2.Type == esriDatasetType.esriDTRasterCatalog))
                 {
                     obj2 = new GxRasterDataset();
                 }
                 else if ((name2.Type == esriDatasetType.esriDTFeatureClass) ||
                          (name2.Type == esriDatasetType.esriDTTable))
                 {
                     if (AppConfigInfo.UserID.Length > 0)
                     {
                         if (AppConfigInfo.UserID.ToLower() == "admin")
                         {
                             obj2 = new GxDataset();
                         }
                         else if (this.sysGrants_0 != null)
                         {
                             if (this.sysGrants_0.GetStaffAndRolesLayerPri(AppConfigInfo.UserID, 1, name2.Name))
                             {
                                 obj2 = new GxDataset();
                             }
                         }
                         else
                         {
                             obj2 = new GxDataset();
                         }
                     }
                     else
                     {
                         obj2 = new GxDataset();
                     }
                 }
                 else
                 {
                     obj2 = new GxDataset();
                 }
                 if (obj2 != null)
                 {
                     (obj2 as IGxDataset).DatasetName = name2;
                     obj2.Attach(this, this.igxCatalog_0);
                 }
             }
             else
             {
                 if ((name2.Type == esriDatasetType.esriDTRasterDataset) ||
                     (name2.Type == esriDatasetType.esriDTRasterCatalog))
                 {
                     obj2 = new GxRasterDataset();
                 }
                 else if ((name2.Type == esriDatasetType.esriDTFeatureClass) ||
                          (name2.Type == esriDatasetType.esriDTTable))
                 {
                     obj2 = new GxDataset();
                 }
                 else
                 {
                     obj2 = new GxDataset();
                 }
                 if (obj2 != null)
                 {
                     (obj2 as IGxDataset).DatasetName = name2;
                     obj2.Attach(this, this.igxCatalog_0);
                 }
             }
             name2 = name.Next();
         }
     }
     catch (Exception exception)
     {
         Logger.Current.Error("", exception, "");
     }
 }
Esempio n. 7
0
        private void method_5()
        {
            try
            {
                int       num;
                IGxObject obj2;
                for (num = 0; num < this.openFolderDataHelper_0.m_DirectoryList.Count; num++)
                {
                    obj2 = new GxFolder();
                    (obj2 as IGxFile).Path = this.openFolderDataHelper_0.m_DirectoryList[num].Path;
                    obj2.Attach(this, this.igxCatalog_0);
                }
                for (num = 0; num < this.openFolderDataHelper_0.m_FileList.Count; num++)
                {
                    IDatasetName   name;
                    IWorkspaceName name2;
                    string         type = this.openFolderDataHelper_0.m_FileList[num].Type;
                    string         str2 = type;
                    switch (str2)
                    {
                    case null:
                        break;

                    case "TIN":
                    {
                        obj2  = new GxDataset();
                        name  = new TinNameClass();
                        name2 = new WorkspaceNameClass
                        {
                            WorkspaceFactoryProgID = "esriDataSourcesFile.TinWorkspaceFactory",
                            PathName =
                                System.IO.Path.GetDirectoryName(this.openFolderDataHelper_0.m_FileList[num].Path)
                        };
                        name.Name          = System.IO.Path.GetFileName(this.openFolderDataHelper_0.m_FileList[num].Path);
                        name.WorkspaceName = name2;
                        (obj2 as IGxDataset).DatasetName = name;
                        obj2.Attach(this, this.igxCatalog_0);
                        continue;
                    }

                    case "GRID":
                    {
                        obj2  = new GxRasterDataset();
                        name  = new RasterDatasetNameClass();
                        name2 = new WorkspaceNameClass
                        {
                            WorkspaceFactoryProgID = "esriDataSourcesFile.RasterWorkspaceFactory",
                            PathName =
                                System.IO.Path.GetDirectoryName(this.openFolderDataHelper_0.m_FileList[num].Path)
                        };
                        name.Name          = System.IO.Path.GetFileName(this.openFolderDataHelper_0.m_FileList[num].Path);
                        name.WorkspaceName = name2;
                        (obj2 as IGxDataset).DatasetName = name;
                        obj2.Attach(this, this.igxCatalog_0);
                        continue;
                    }

                    default:
                    {
                        if (!(str2 == "COVERAGE"))
                        {
                            if (!(str2 == "FILEGDB"))
                            {
                                break;
                            }
                            obj2  = new GxDatabase();
                            name2 = new WorkspaceNameClass
                            {
                                WorkspaceFactoryProgID = "esriDataSourcesGDB.FileGDBWorkspaceFactory.1",
                                PathName = this.openFolderDataHelper_0.m_FileList[num].Path
                            };
                            (obj2 as IGxDatabase).WorkspaceName = name2;
                            obj2.Attach(this, this.igxCatalog_0);
                        }
                        else
                        {
                            obj2  = new GxCoverageDataset();
                            name  = new CoverageNameClass();
                            name2 = new WorkspaceNameClass
                            {
                                WorkspaceFactoryProgID = "esriDataSourcesFile.ArcInfoWorkspaceFactory.1",
                                PathName =
                                    System.IO.Path.GetDirectoryName(this.openFolderDataHelper_0.m_FileList[num].Path)
                            };
                            name.Name          = System.IO.Path.GetFileName(this.openFolderDataHelper_0.m_FileList[num].Path);
                            name.WorkspaceName = name2;
                            (obj2 as IGxDataset).DatasetName = name;
                            obj2.Attach(this, this.igxCatalog_0);
                        }
                        continue;
                    }
                    }
                    this.method_0(this.openFolderDataHelper_0.m_FileList[num].Path, type, false);
                }
            }
            catch
            {
            }
        }
Esempio n. 8
0
        private void method_3()
        {
            string[] directories;
            this.bool_0 = false;
            try
            {
                directories = Directory.GetDirectories(this.string_0);
            }
            catch
            {
                return;
            }
            IArray array = new ArrayClass();

            foreach (string str in directories)
            {
                IGxObject      obj2;
                IDatasetName   name;
                IWorkspaceName name2;
                string         str2 = this.method_2(str);
                switch (str2)
                {
                case null:
                    break;

                case "FOLDER":
                    obj2 = new GxFolder();
                    (obj2 as IGxFile).Path = str;
                    obj2.Attach(this, this.igxCatalog_0);
                    break;

                case "TIN":
                    obj2  = new GxDataset();
                    name  = new TinNameClass();
                    name2 = new WorkspaceNameClass
                    {
                        WorkspaceFactoryProgID = "esriDataSourcesFile.TinWorkspaceFactory",
                        PathName = System.IO.Path.GetDirectoryName(str)
                    };
                    name.Name          = System.IO.Path.GetFileName(str);
                    name.WorkspaceName = name2;
                    (obj2 as IGxDataset).DatasetName = name;
                    array.Add(obj2);
                    break;

                case "GRID":
                    obj2  = new GxRasterDataset();
                    name  = new RasterDatasetNameClass();
                    name2 = new WorkspaceNameClass
                    {
                        WorkspaceFactoryProgID = "esriDataSourcesFile.RasterWorkspaceFactory",
                        PathName = System.IO.Path.GetDirectoryName(str)
                    };
                    name.Name          = System.IO.Path.GetFileName(str);
                    name.WorkspaceName = name2;
                    (obj2 as IGxDataset).DatasetName = name;
                    array.Add(obj2);
                    break;

                default:
                    if (!(str2 == "COVERAGE"))
                    {
                        if (str2 == "FILEGDB")
                        {
                            obj2  = new GxDatabase();
                            name2 = new WorkspaceNameClass
                            {
                                WorkspaceFactoryProgID = "esriDataSourcesGDB.FileGDBWorkspaceFactory.1",
                                PathName = str
                            };
                            (obj2 as IGxDatabase).WorkspaceName = name2;
                            array.Add(obj2);
                        }
                    }
                    else
                    {
                        obj2  = new GxCoverageDataset();
                        name  = new CoverageNameClass();
                        name2 = new WorkspaceNameClass
                        {
                            WorkspaceFactoryProgID = "esriDataSourcesFile.ArcInfoWorkspaceFactory.1",
                            PathName = System.IO.Path.GetDirectoryName(str)
                        };
                        name.Name          = System.IO.Path.GetFileName(str);
                        name.WorkspaceName = name2;
                        (obj2 as IGxDataset).DatasetName = name;
                        array.Add(obj2);
                    }
                    break;
                }
            }
            for (int i = 0; i < array.Count; i++)
            {
                (array.get_Element(i) as IGxObject).Attach(this, this.igxCatalog_0);
            }
            foreach (string str3 in Directory.GetFiles(this.string_0))
            {
                this.method_0(str3, false);
            }
            this.bool_1 = true;
        }