internal static ESRI.ArcGIS.Geodatabase.IWorkspace GetWorkspace(String title)
{
IGxDialog theGDlg = new GxDialogClass();
IGxObject theObject;
IEnumGxObject theResults;
IGxObject theGeoDb = (IGxObject)new GxDatabase();
IGxDatabase theWorkspace;
ESRI.ArcGIS.Catalog.esriDoubleClickResult theClick = esriDoubleClickResult.esriDCRChooseAndDismiss;
theGDlg.Title = title;
theGDlg.ButtonCaption = "Open";
theGDlg.RememberLocation = true;
IGxObjectFilter theFilter = new GxFilterWorkspacesClass();
theFilter.CanChooseObject(theGeoDb, ref theClick);
theGDlg.ObjectFilter = theFilter;
if (theGDlg.DoModalOpen(0, out theResults))
{
Application.DoEvents();
theObject = theResults.Next();
if (theObject == null) return null;
theWorkspace = (IGxDatabase)theObject;
return theWorkspace.Workspace;
}
return null;
}