/// <summary> /// Runs a raster file dialog box with the specified owner. /// </summary> /// <returns></returns> public DialogResult ShowDialog() { fileName = ""; fileNames = null; switch (this.type) { case FileDialogType.Open: IEnumGxObject enumGxObject = new GxObjectArrayClass(); if (dialog.DoModalOpen(0, out enumGxObject)) { IGxObjectArray gxObjectArray = (IGxObjectArray)enumGxObject; fileName = gxObjectArray.Item(0).FullName; fileNames = new string[gxObjectArray.Count]; for (int i = 0; i < gxObjectArray.Count; i++) { fileNames[i] = gxObjectArray.Item(i).FullName; } return(DialogResult.OK); } break; case FileDialogType.Save: if (dialog.DoModalSave(0)) { fileName = dialog.Name; string extension = GetExtension(dialog.ObjectFilter.Name); if ((Path.GetExtension(fileName) != "") && (Path.GetExtension(fileName).ToLower() == extension.Substring(1))) { fileName = Path.GetFileNameWithoutExtension(fileName); } fileName = dialog.FinalLocation.FullName + "\\" + fileName + extension; return(DialogResult.OK); } break; } return(DialogResult.Cancel); }
public void Detach() { //It is our responsibility to detach all our children before deleting them. //This is to avoid circular referencing problems. int i = 0; int tempFor1 = m_pChildren.Count; for (i = 0; i <= tempFor1; i++) { m_pChildren.Item(i).Detach(); } m_pParent = null; m_pCatalog = null; }