예제 #1
0
        private static void _configureDockWindow(object sender, CadKit.Plugins.Windows.OutputWindow.Form form)
        {
            CadKit.Interfaces.IDockPanel dockPanel = sender as CadKit.Interfaces.IDockPanel;
            if (null != dockPanel)
            {
                WeifenLuo.WinFormsUI.DockPanel panel = dockPanel.DockPanel as WeifenLuo.WinFormsUI.DockPanel;
                if (null != panel)
                {
                    CadKit.Interfaces.IPersistantFormData register = sender as CadKit.Interfaces.IPersistantFormData;

                    if (null != register)
                    {
                        register.registerPersistanceForm(typeof(CadKit.Plugins.Windows.OutputWindow.Form).ToString(), form);
                    }

                    // Show the form if we don't have persistant data.  If there is persistant data, it will be shown elsewhere.
                    if (false == register.hasPersistantFormData())
                    {
                        form.Show(panel);
                    }
                }
                else
                {
                    form.Show();
                }
            }
            else
            {
                form.Show();
            }
        }
예제 #2
0
        /// <summary>
        /// Called when parent form is shown.
        /// </summary>
        private void _parentShown(object sender, System.EventArgs args)
        {
            try
            {
                CadKit.Plugins.Windows.OutputWindow.Form form = new CadKit.Plugins.Windows.OutputWindow.Form();
                System.Windows.Forms.Form parent = sender as System.Windows.Forms.Form;
                CadKit.Tools.ToolWindow.configure(form, parent, "Output Window", false);

                _configureDockWindow(sender, form);

                CadKit.Interfaces.IWindowMenu windowMenu = sender as CadKit.Interfaces.IWindowMenu;
                if (null != windowMenu)
                {
                    windowMenu.addFormWindowMenu(form.Text, form);
                }

                parent.Activate();
            }
            catch (System.Exception e)
            {
                System.Console.WriteLine("Error 2740234786: {0}", e.Message);
            }
        }