/// <summary> /// Closes the passed Document (which represents the passed Resource) /// </summary> /// <param name="fii">the Reource represented by the Document</param> /// <returns>true, if the Document was closed</returns> bool CloseDocument(SimPe.Interfaces.Scenegraph.IScenegraphFileIndexItem fii) { bool remain = false; TD.SandDock.DockControl doc = (TD.SandDock.DockControl)loaded[fii]; if (doc != null) { doc.Close(); } else { RemoveResource(fii, null); } if (doc != null) { if (doc.IsOpen) { remain = true; } else { RemoveResource(fii, null); } } return(!remain); }
/// <summary> /// Close the given Document /// </summary> /// <param name="doc"></param> /// <returns>true, if the Document was closed</returns> public bool CloseDocument(TD.SandDock.DockControl doc) { SimPe.Interfaces.Scenegraph.IScenegraphFileIndexItem fii = GetResourceFromDocument(doc); if (fii != null) { return(CloseDocument(fii)); } else { doc.Close(); return(!doc.IsOpen); } }
private static void _ChangeVisibilityDocument(TD.SandDock.DockControl frmControl) { if (frmControl.IsOpen) { frmControl.Close(); } else { if (!frmControl.IsAccessible) { frmControl.Open( ); } frmControl.Activate(); } }