Example #1
0
 private void CloseAllTab()
 {
     if (MainDockPanel.DocumentStyle == DocumentStyle.SystemMdi)
     {
         foreach (Form form in MdiChildren)
         {
             form.Close();
         }
     }
     else
     {
         for (int index = MainDockPanel.Contents.Count - 1; index >= 0; index--)
         {
             if (MainDockPanel.Contents[index] != null)
             {
                 IDockContent content = MainDockPanel.Contents[index];
                 if (content.GetType().Name != "InfomationForm" &&
                     content.GetType().Name != "ProxyForm" &&
                     content.GetType().Name != "StartForm")
                 {
                     content.DockHandler.Close();
                 }
             }
         }
     }
 }
        private void SetSelectedNode(IDockContent ActiveContent)
        {
            if (ActiveContent == null)
            {
                ResetSelectedNode();

                return;
            }

            if (ActiveContent is MenuItemTreePanel)
            {
                return;
            }

            if (LastActiveContent == ActiveContent)
            {
                return;
            }

            LastActiveContent = ActiveContent;

            Type   t      = ActiveContent.GetType();
            string shell  = t.Assembly.ManifestModule.Name;
            var    result = from item in myMenuItem
                            where item.Shell == shell
                            select item;
            TreeNode node = result.FirstOrDefault().Node;

            SetSelectedNode(ActiveContent, node);
        }
Example #3
0
        private static string Save(IDockContent p)
        {
            var b = new StringBuilder();

            b.Append(p.GetType().FullName);
            b.Append(":");
            if (p is IDockSerializable)
            {
                b.Append("D:");
                b.Append((p as IDockSerializable).Serialize());
            }
            b.Append(":");
            return(b.ToString());
        }
Example #4
0
        private IDockContent LayoutLoadCallback(string PersistString)
        {
            Assembly     assembly = Assembly.GetExecutingAssembly();
            IDockContent obj      = (IDockContent)assembly.CreateInstance(PersistString);

            if (obj != null)
            {
                if (obj.GetType() == typeof(ViewWindow))
                {
                    mViewwindow = (ViewWindow)obj;
                }
                else if (obj.GetType() == typeof(PropertyWindow))
                {
                    mPropertyWindow = (PropertyWindow)obj;
                }



                return(obj);
            }


            return(null);
        }
Example #5
0
 /// <summary>
 ///     判断主窗体上是否有本插件
 /// </summary>
 public void ActiveProxyForm()
 {
     for (int index = app.DockPanel.Contents.Count - 1; index >= 0; index--)
     {
         if (app.DockPanel.Contents[index] is IDockContent)
         {
             IDockContent content = app.DockPanel.Contents[index];
             if (content.GetType().Name == "ProxyForm")
             {
                 content.DockHandler.Activate();
                 return;
             }
         }
     }
 }
Example #6
0
        /// <summary>
        ///     获取内置浏览器窗体
        /// </summary>
        /// <returns></returns>
        public List <IEBrowserForm> GetBrowserForms()
        {
            var browserForms = new List <IEBrowserForm>();

            if (MainDockPanel.DocumentStyle != DocumentStyle.SystemMdi)
            {
                for (int index = MainDockPanel.Contents.Count - 1; index >= 0; index--)
                {
                    if (MainDockPanel.Contents[index] != null)
                    {
                        IDockContent content = MainDockPanel.Contents[index];
                        if (content.GetType().Name == "IEBrowserForm")
                        {
                            var ie = (IEBrowserForm)content;
                            browserForms.Add(ie);
                        }
                    }
                }
            }
            return(browserForms);
        }
Example #7
0
 static bool IsNameFor(IDockContent control, string name)
 {
     return(StringComparer.Ordinal.Equals(control.GetType().ToString(), name));
 }
Example #8
0
 static bool IsNameFor(IDockContent control, string name)
 {
     return StringComparer.Ordinal.Equals(control.GetType().ToString(), name);
 }