/// <summary>
        /// Unregisters control</summary>
        /// <param name="control">Control to unregister</param>
        public void UnregisterControl(Control control)
        {
            ControlInfo info = FindControlInfo(control);

            if (info != null)
            {
                // Undoes the effects of RegisterControl(), in the reverse order.
                DockContent dockContent = FindContent(info);

                UnregisterMenuCommand(control);

                dockContent.FormClosing -= new FormClosingEventHandler(dockContent_FormClosing);

                dockContent.Controls.Remove(control);

                // Restore any properties we set on Control.
                control.Dock = info.OriginalDock;

                m_dockContent.Remove(info);
                m_controls.Remove(info);

                info.Changed -= new EventHandler(info_Changed);

                m_uniqueNamer.Retire(dockContent.Text);

                dockContent.Hide();
                dockContent.Dispose();

                info.HostControl = null;
            }
        }
Exemplo n.º 2
0
        private void InitializeTree()
        {
            foreach (KeyValuePair <IDocumentObject, DockContent> entry in _entries)
            {
                DockContent win = entry.Value;

                if ((win != null) && (!win.IsDisposed))
                {
                    win.Dispose();
                }
            }
            _entries.Clear();

            _projectExplorer.ClearEntries();
        }
Exemplo n.º 3
0
        public void Remove(string key)
        {
            if (dockContents.ContainsKey(key))
            {
                DockContent content = dockContents[key];
                content.Close();

                //remove event handlers
                content.FormClosing -= content_FormClosing;
                content.FormClosed  -= content_FormClosed;

                content.Dispose();
                dockContents.Remove(key);
                OnPanelRemoved(key);
            }
        }
        /// <summary>
        /// ドキュメントが閉じられた
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void DocumentClosed(object sender, EventArgs e)
        {
            string      key = "";
            DockContent dc  = (DockContent)sender;

            if (dc.GetType() == typeof(AngleScriptEditor))
            {
                AngleScriptEditor fmSE = (AngleScriptEditor)dc;
                key = fmSE.FilePath;
            }
            else if (dc.GetType() == typeof(FontDoc))
            {
                FontDoc fmSE = (FontDoc)dc;
                key = fmSE.FilePath;
            }
            else if (dc.GetType() == typeof(ImageViewerDoc))
            {
                ImageViewerDoc fmSE = (ImageViewerDoc)dc;
                key = fmSE.FilePath;
            }
            else if (dc.GetType() == typeof(AudioDoc))
            {
                AudioDoc fmSE = (AudioDoc)dc;
                key = fmSE.FilePath;
            }


            lock (ms_lockObj)
            {
                if (m_dockContents.ContainsKey(key))
                {
                    m_dockContents.Remove(key);
                }
                if (sender == m_fmDocCurrent)
                {
                    m_fmDocCurrent = null;
                }
                dc.Dispose();
            }


            if (m_dockContents.Count == 0)
            {
                //m_fmMain.BookMarkBreakPointToolbarEnable(false);
            }
        }
Exemplo n.º 5
0
 public void Dispose()
 {
     _content.Dispose();
 }