Work space and datasets dialog

المشرف العام

Administrator
طاقم الإدارة
i want to select the work space and the data set from the same dialog and this is my code for the work space private IWorkspace BrowseForWorkspace(int hwnd) {

IGxDialog gxDlg = new GxDialogClass(); gxDlg.ObjectFilter = new GxFilterWorkspacesClass(); gxDlg.AllowMultiSelect = false; IEnumGxObject workspaces; IWorkspace ws = null; if (gxDlg.DoModalOpen(hwnd, out workspaces) && workspaces != null) { IGxObject gxObj = workspaces.Next(); if (gxObj is IGxDatabase) { var gxDb = gxObj as IGxDatabase; ws = gxDb.Workspace; } else if (gxObj is IGxFolder) { IWorkspaceFactory wsf = new ShapefileWorkspaceFactoryClass(); ws = wsf.OpenFromFile(((IGxFile)gxObj).Path, hwnd); } Marshal.FinalReleaseComObject(workspaces); } gxDlg.InternalCatalog.Close(); Marshal.FinalReleaseComObject(gxDlg); return ws; }and this is my code for the data set

private IDatasetName Browse(int hwnd) { IGxDialog gxDlg = new GxDialogClass(); gxDlg.ObjectFilter = new GxFilterDatasetsAndLayersClass(); gxDlg.AllowMultiSelect = false; IEnumGxObject workspaces; IDatasetName datasetName = null; if (gxDlg.DoModalOpen(hwnd, out workspaces) && workspaces != null) { var gxObj = (IGxDataset)workspaces.Next(); if (gxObj != null) { var dataset = gxObj; datasetName = dataset.DatasetName; } Marshal.FinalReleaseComObject(workspaces); } gxDlg.InternalCatalog.Close(); Marshal.FinalReleaseComObject(gxDlg); return datasetName; }soo i want to link them together :)



أكثر...
 
أعلى