示例#1
0
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            // Release all the plugins.
            CadKit.Plugins.Manager.Instance.release(this);

            lock (_mutex)
            {
                if (disposing && (components != null))
                {
                    components.Dispose();
                    components = null;
                }
                base.Dispose(disposing);

                _deserializeDockContent = null;
                _persistantForms        = null;
                _windowForms            = null;
                _windowMenu             = null;
                _menuStrip   = null;
                _statusStrip = null;
                _toolStrip   = null;
                _dockPanel   = null;
                if (null != _recentFiles)
                {
                    _recentFiles.dereference();
                    _recentFiles = null;
                }
            }
        }
示例#2
0
        /// <summary>
        /// Show the dock window in the proper way.
        /// </summary>
        private static void _configureDockWindow(object sender, CadKit.Plugins.Windows.Properties.Editor 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.Properties.Editor).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();
            }
        }
示例#3
0
 public ScopedDocumentStyle(WeifenLuo.WinFormsUI.DockPanel panel)
     : base()
 {
     _panel = panel;
     if (null != _panel)
     {
         _style = _panel.DocumentStyle;
     }
 }
示例#4
0
        /// <summary>
        /// Create the default gui.
        /// </summary>
        void CadKit.Interfaces.IGuiDelegate.create(object caller)
        {
            lock (this.Mutex)
            {
                if (null == this.Document)
                {
                    return;
                }

                _view          = new CadKit.Viewer.Viewer();
                _view.Icon     = System.Windows.Forms.Application.OpenForms[0].Icon;
                _view.Text     = this.Document.Name;
                _view.KeyDown += new System.Windows.Forms.KeyEventHandler(_view_KeyDown);

                // Attach viewer and document to each other.
                _view.Document = this.Document;
                _view.Document.add(_view);

                CadKit.Interfaces.IUpdateScene update = this.Document as CadKit.Interfaces.IUpdateScene;

                if (null != update)
                {
                    _view.Panel.BeginPaintEvent += update.updateScene;
                }
                //view.FormClosed += this._viewClosed;

                CadKit.Interfaces.IBuildScene buildScene = this.Document as CadKit.Interfaces.IBuildScene;
                if (null != buildScene)
                {
                    _view.Scene = buildScene.Scene;
                }

                CadKit.Interfaces.IDockPanel   getPanel = caller as CadKit.Interfaces.IDockPanel;
                WeifenLuo.WinFormsUI.DockPanel panel    = (null != getPanel) ? (getPanel.DockPanel as WeifenLuo.WinFormsUI.DockPanel) : null;

                if (null != panel)
                {
                    if (panel.DocumentStyle == WeifenLuo.WinFormsUI.DocumentStyles.SystemMdi)
                    {
                        _view.MdiParent = caller as System.Windows.Forms.Form;
                        CadKit.Tools.Size.mdiChild(panel.DocumentRectangle.Size, _view);
                        _view.Show();
                    }
                    else
                    {
                        _view.Show(panel);
                    }
                }
            }
        }
示例#5
0
        /// <summary>
        /// Create the default gui.
        /// </summary>
        void CadKit.Interfaces.IGuiDelegate.create(object caller)
        {
            lock (this.Mutex)
            {
                if (null == this.Document)
                {
                    return;
                }

                // Make new viewer.
                CadKit.Viewer.Viewer view = new CadKit.Viewer.Viewer();
                view.Icon = System.Windows.Forms.Application.OpenForms[0].Icon;
                view.Text = this.Document.Name;

                // Attach viewer and document to each other.
                view.Document = this.Document;
                view.Document.add(view);

                // Build the scene.
                CadKit.Interfaces.IBuildScene buildScene = this.Document as CadKit.Interfaces.IBuildScene;
                if (null != buildScene)
                {
                    view.Scene = buildScene.Scene;
                }

                // Get dock-panel and show.
                CadKit.Interfaces.IDockPanel   getPanel = caller as CadKit.Interfaces.IDockPanel;
                WeifenLuo.WinFormsUI.DockPanel panel    = (null != getPanel) ? (getPanel.DockPanel as WeifenLuo.WinFormsUI.DockPanel) : null;
                if (null != panel)
                {
                    if (panel.DocumentStyle == WeifenLuo.WinFormsUI.DocumentStyles.SystemMdi)
                    {
                        view.MdiParent = caller as System.Windows.Forms.Form;
                        CadKit.Tools.Size.mdiChild(panel.DocumentRectangle.Size, view);
                        view.Show();
                    }
                    else
                    {
                        view.Show(panel);
                    }
                }
            }
        }
示例#6
0
 public WebBrowser(WeifenLuo.WinFormsUI.DockPanel dp, string URL)
 {
     InitializeComponent();
     this.m_dp = dp;
     AxWebBrowser1.Navigate(URL);
 }
示例#7
0
 public WebBrowser(WeifenLuo.WinFormsUI.DockPanel dp)
 {
     InitializeComponent();
     this.m_dp = dp;
 }
示例#8
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
     this._menuStrip   = new System.Windows.Forms.MenuStrip();
     this._statusStrip = new System.Windows.Forms.StatusStrip();
     this._toolStrip   = new System.Windows.Forms.ToolStrip();
     this._dockPanel   = new WeifenLuo.WinFormsUI.DockPanel();
     this.SuspendLayout();
     //
     // _menuStrip
     //
     this._menuStrip.Location = new System.Drawing.Point(0, 0);
     this._menuStrip.Name     = "_menuStrip";
     this._menuStrip.Size     = new System.Drawing.Size(568, 24);
     this._menuStrip.TabIndex = 0;
     this._menuStrip.Text     = "_menuStrip";
     //
     // _statusStrip
     //
     this._statusStrip.Location = new System.Drawing.Point(0, 276);
     this._statusStrip.Name     = "_statusStrip";
     this._statusStrip.Size     = new System.Drawing.Size(568, 22);
     this._statusStrip.TabIndex = 3;
     this._statusStrip.Text     = "_statusStrip";
     //
     // _toolStrip
     //
     this._toolStrip.Location = new System.Drawing.Point(0, 24);
     this._toolStrip.Name     = "_toolStrip";
     this._toolStrip.Size     = new System.Drawing.Size(568, 25);
     this._toolStrip.TabIndex = 4;
     this._toolStrip.Text     = "_toolStrip";
     //
     // _dockPanel
     //
     this._dockPanel.ActiveAutoHideContent = null;
     this._dockPanel.Dock     = System.Windows.Forms.DockStyle.Fill;
     this._dockPanel.Font     = new System.Drawing.Font("Tahoma", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World);
     this._dockPanel.Location = new System.Drawing.Point(0, 49);
     this._dockPanel.Name     = "_dockPanel";
     this._dockPanel.Size     = new System.Drawing.Size(568, 227);
     this._dockPanel.TabIndex = 5;
     //
     // MainForm
     //
     this.AllowDrop           = true;
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize          = new System.Drawing.Size(568, 298);
     this.Controls.Add(this._dockPanel);
     this.Controls.Add(this._toolStrip);
     this.Controls.Add(this._menuStrip);
     this.Controls.Add(this._statusStrip);
     this.Icon          = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.MainMenuStrip = this._menuStrip;
     this.Margin        = new System.Windows.Forms.Padding(2);
     this.Name          = "MainForm";
     this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
     this.Text          = "MainForm";
     this.ResumeLayout(false);
     this.PerformLayout();
 }
示例#9
0
文件: FormMain.cs 项目: drme/disks-db
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMain));
     this.mainMenu = new System.Windows.Forms.MainMenu(this.components);
     this.menuItemFile = new System.Windows.Forms.MenuItem();
     this.menuItemPageSetup = new System.Windows.Forms.MenuItem();
     this.menuItemPrintPreview = new System.Windows.Forms.MenuItem();
     this.menuItemPrint = new System.Windows.Forms.MenuItem();
     this.menuItemExit = new System.Windows.Forms.MenuItem();
     this.menuItemEdit = new System.Windows.Forms.MenuItem();
     this.menuItemTools = new System.Windows.Forms.MenuItem();
     this.menuItemOptions = new System.Windows.Forms.MenuItem();
     this.menuItemLanguages = new System.Windows.Forms.MenuItem();
     this.menuItemTransferDataBase = new System.Windows.Forms.MenuItem();
     this.menuItemWindows = new System.Windows.Forms.MenuItem();
     this.menuItemImagesExplorer = new System.Windows.Forms.MenuItem();
     this.menuItemDisksExporer = new System.Windows.Forms.MenuItem();
     this.menuItemItemPreview = new System.Windows.Forms.MenuItem();
     this.menuItemHelp = new System.Windows.Forms.MenuItem();
     this.menuItemAbout = new System.Windows.Forms.MenuItem();
     this.mainImageList16x16 = new System.Windows.Forms.ImageList(this.components);
     this.statusBar1 = new System.Windows.Forms.StatusBar();
     this.statusBarPanel1 = new System.Windows.Forms.StatusBarPanel();
     this.statusBarPanel2 = new System.Windows.Forms.StatusBarPanel();
     this.statusBarPanelMemory = new System.Windows.Forms.StatusBarPanel();
     this.timer = new System.Windows.Forms.Timer(this.components);
     this.imageListCatalog = new System.Windows.Forms.ImageList(this.components);
     this.dockPanel = new WeifenLuo.WinFormsUI.DockPanel();
     this.toolBar2x1 = new DisksDB.UserInterface.ToolBar.ToolBar2x();
     ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.statusBarPanelMemory)).BeginInit();
     this.SuspendLayout();
     //
     // mainMenu
     //
     this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
     this.menuItemFile,
     this.menuItemEdit,
     this.menuItemTools,
     this.menuItemWindows,
     this.menuItemHelp});
     //
     // menuItemFile
     //
     this.menuItemFile.Index = 0;
     this.menuItemFile.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
     this.menuItemPageSetup,
     this.menuItemPrintPreview,
     this.menuItemPrint,
     this.menuItemExit});
     this.menuItemFile.Text = "File";
     //
     // menuItemPageSetup
     //
     this.menuItemPageSetup.Index = 0;
     this.menuItemPageSetup.Text = "Page Setup...";
     this.menuItemPageSetup.Click += new System.EventHandler(this.PageSetup);
     //
     // menuItemPrintPreview
     //
     this.menuItemPrintPreview.Index = 1;
     this.menuItemPrintPreview.Text = "Print Preview...";
     this.menuItemPrintPreview.Click += new System.EventHandler(this.PrintPreview);
     //
     // menuItemPrint
     //
     this.menuItemPrint.Index = 2;
     this.menuItemPrint.Text = "Print...";
     this.menuItemPrint.Click += new System.EventHandler(this.PrintClick);
     //
     // menuItemExit
     //
     this.menuItemExit.Index = 3;
     this.menuItemExit.Text = "Exit";
     this.menuItemExit.Click += new System.EventHandler(this.ExitClick);
     //
     // menuItemEdit
     //
     this.menuItemEdit.Index = 1;
     this.menuItemEdit.Text = "Edit";
     //
     // menuItemTools
     //
     this.menuItemTools.Index = 2;
     this.menuItemTools.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
     this.menuItemOptions,
     this.menuItemLanguages,
     this.menuItemTransferDataBase});
     this.menuItemTools.Text = "Tools";
     //
     // menuItemOptions
     //
     this.menuItemOptions.Index = 0;
     this.menuItemOptions.Text = "Options...";
     this.menuItemOptions.Click += new System.EventHandler(this.OptionsClick);
     //
     // menuItemLanguages
     //
     this.menuItemLanguages.Index = 1;
     this.menuItemLanguages.Text = "Languages...";
     this.menuItemLanguages.Visible = false;
     this.menuItemLanguages.Click += new System.EventHandler(this.LanguagesClick);
     //
     // menuItemTransferDataBase
     //
     this.menuItemTransferDataBase.Index = 2;
     this.menuItemTransferDataBase.Text = "Transfer DataBase...";
     this.menuItemTransferDataBase.Visible = false;
     this.menuItemTransferDataBase.Click += new System.EventHandler(this.CopyDataBaseClick);
     //
     // menuItemWindows
     //
     this.menuItemWindows.Index = 3;
     this.menuItemWindows.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
     this.menuItemImagesExplorer,
     this.menuItemDisksExporer,
     this.menuItemItemPreview});
     this.menuItemWindows.Text = "Windows";
     //
     // menuItemImagesExplorer
     //
     this.menuItemImagesExplorer.Index = 0;
     this.menuItemImagesExplorer.Text = "Images Explorer";
     this.menuItemImagesExplorer.Click += new System.EventHandler(this.ShowHideImagesExplorer);
     //
     // menuItemDisksExporer
     //
     this.menuItemDisksExporer.Index = 1;
     this.menuItemDisksExporer.Text = "Disks Explorer";
     this.menuItemDisksExporer.Click += new System.EventHandler(this.ShowDisksExplorer);
     //
     // menuItemItemPreview
     //
     this.menuItemItemPreview.Index = 2;
     this.menuItemItemPreview.Text = "Item Preview";
     this.menuItemItemPreview.Click += new System.EventHandler(this.ShowItemPreview);
     //
     // menuItemHelp
     //
     this.menuItemHelp.Index = 4;
     this.menuItemHelp.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
     this.menuItemAbout});
     this.menuItemHelp.Text = "Help";
     //
     // menuItemAbout
     //
     this.menuItemAbout.Index = 0;
     this.menuItemAbout.Text = "About...";
     this.menuItemAbout.Click += new System.EventHandler(this.AboutClick);
     //
     // mainImageList16x16
     //
     this.mainImageList16x16.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("mainImageList16x16.ImageStream")));
     this.mainImageList16x16.TransparentColor = System.Drawing.Color.Magenta;
     this.mainImageList16x16.Images.SetKeyName(0, "");
     this.mainImageList16x16.Images.SetKeyName(1, "");
     this.mainImageList16x16.Images.SetKeyName(2, "");
     this.mainImageList16x16.Images.SetKeyName(3, "");
     this.mainImageList16x16.Images.SetKeyName(4, "");
     this.mainImageList16x16.Images.SetKeyName(5, "");
     this.mainImageList16x16.Images.SetKeyName(6, "");
     this.mainImageList16x16.Images.SetKeyName(7, "");
     this.mainImageList16x16.Images.SetKeyName(8, "");
     this.mainImageList16x16.Images.SetKeyName(9, "");
     this.mainImageList16x16.Images.SetKeyName(10, "");
     this.mainImageList16x16.Images.SetKeyName(11, "");
     this.mainImageList16x16.Images.SetKeyName(12, "");
     this.mainImageList16x16.Images.SetKeyName(13, "");
     this.mainImageList16x16.Images.SetKeyName(14, "");
     //
     // statusBar1
     //
     this.statusBar1.Location = new System.Drawing.Point(0, 189);
     this.statusBar1.Name = "statusBar1";
     this.statusBar1.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
     this.statusBarPanel1,
     this.statusBarPanel2,
     this.statusBarPanelMemory});
     this.statusBar1.ShowPanels = true;
     this.statusBar1.Size = new System.Drawing.Size(824, 22);
     this.statusBar1.TabIndex = 1;
     //
     // statusBarPanel1
     //
     this.statusBarPanel1.Name = "statusBarPanel1";
     this.statusBarPanel1.Text = "Ready";
     this.statusBarPanel1.Width = 150;
     //
     // statusBarPanel2
     //
     this.statusBarPanel2.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring;
     this.statusBarPanel2.Name = "statusBarPanel2";
     this.statusBarPanel2.Width = 561;
     //
     // statusBarPanelMemory
     //
     this.statusBarPanelMemory.Alignment = System.Windows.Forms.HorizontalAlignment.Right;
     this.statusBarPanelMemory.Name = "statusBarPanelMemory";
     this.statusBarPanelMemory.Width = 97;
     //
     // timer
     //
     this.timer.Enabled = true;
     this.timer.Interval = 10000;
     this.timer.Tick += new System.EventHandler(this.MemUpdate);
     //
     // imageListCatalog
     //
     this.imageListCatalog.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit;
     this.imageListCatalog.ImageSize = new System.Drawing.Size(16, 16);
     this.imageListCatalog.TransparentColor = System.Drawing.Color.Transparent;
     //
     // dockPanel
     //
     this.dockPanel.ActiveAutoHideContent = null;
     this.dockPanel.Dock = System.Windows.Forms.DockStyle.Fill;
     this.dockPanel.Font = new System.Drawing.Font("Tahoma", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World);
     this.dockPanel.Location = new System.Drawing.Point(0, 26);
     this.dockPanel.Name = "dockPanel";
     this.dockPanel.Size = new System.Drawing.Size(824, 163);
     this.dockPanel.TabIndex = 9;
     //
     // toolBar2x1
     //
     this.toolBar2x1.Dock = System.Windows.Forms.DockStyle.Top;
     this.toolBar2x1.Location = new System.Drawing.Point(0, 0);
     this.toolBar2x1.Name = "toolBar2x1";
     this.toolBar2x1.Size = new System.Drawing.Size(824, 26);
     this.toolBar2x1.TabIndex = 8;
     this.toolBar2x1.Text = "toolBar2x1";
     //
     // FormMain
     //
     this.AllowDrop = true;
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize = new System.Drawing.Size(824, 211);
     this.Controls.Add(this.dockPanel);
     this.Controls.Add(this.statusBar1);
     this.Controls.Add(this.toolBar2x1);
     this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.Menu = this.mainMenu;
     this.Name = "FormMain";
     this.Text = "CD/DVD Catalog";
     this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
     this.Closing += new System.ComponentModel.CancelEventHandler(this.AppClosing);
     this.Load += new System.EventHandler(this.FormLoaded);
     ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.statusBarPanelMemory)).EndInit();
     this.ResumeLayout(false);
 }