private void method_0() { this.igxObjectArray_0.Empty(); IGxObject obj2 = new GxNewDatabase(); IWorkspaceFactory factory = new OLEDBWorkspaceFactoryClass(); (obj2 as IGxNewDatabase).WorkspaceFactory = factory; obj2.Attach(this, this.igxCatalog_0); obj2 = new GxNewDatabase(); factory = new SdeWorkspaceFactoryClass(); (obj2 as IGxNewDatabase).WorkspaceFactory = factory; obj2.Attach(this, this.igxCatalog_0); if (Directory.Exists(this.string_0)) { IWorkspaceName name; foreach (string str in Directory.GetFiles(this.string_0, "*.sde")) { obj2 = new GxDatabase(); name = new WorkspaceNameClass { WorkspaceFactoryProgID = "esriDataSourcesGDB.SdeWorkspaceFactory", PathName = str }; (obj2 as IGxDatabase).WorkspaceName = name; obj2.Attach(this, this.igxCatalog_0); } foreach (string str in Directory.GetFiles(this.string_0, "*.odc")) { obj2 = new GxDatabase(); name = new WorkspaceNameClass { WorkspaceFactoryProgID = "esriDataSourcesOleDB.OLEDBWorkspaceFactory", PathName = str }; (obj2 as IGxDatabase).WorkspaceName = name; obj2.Attach(this, this.igxCatalog_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); }
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 { } }