コード例 #1
0
        void SkinEngine_BackColorChanged(object sender, System.EventArgs e)
        {
            MyForm.ChangeControlColor();
            MyForm.ChangeSystemButtonColor();

            MyButton.ChangeControlColor();
            MyHScrollBar.ChangeControlColor();
            MyVScrollBar.ChangeControlColor();
            MyToolStrip.ChangeControlColor();
            MyToolStripButton.ChangeControlColor();
            MyToolStripSeparator.ChangeControlColor();
            MyStatusStrip.ChangeControlColor();

            foreach (Form form in Application.OpenForms)
            {
                form.Refresh();
            }
        }
コード例 #2
0
        private static System.Windows.Forms.ToolStrip GenerateWindowMenu(IList<WindowMenuInfo> windowMenuInfos, IList<IButton> tsbs, Dictionary<string, ToolStripItem> haveTsbs)
        {
            System.Windows.Forms.ToolStrip toolStrip2 = new System.Windows.Forms.ToolStrip();
            foreach (WindowMenuInfo windowMenuInfo in windowMenuInfos)
            {
                if (windowMenuInfo.Type == WindowMenuType.Separator)
                {
                    toolStrip2.Items.Add(new System.Windows.Forms.ToolStripSeparator());
                }
                else
                {
                    if (string.IsNullOrEmpty(windowMenuInfo.OriginalName))
                    {
                        MyToolStripButton tsb = new MyToolStripButton();
                        tsb.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                        if (!string.IsNullOrEmpty(windowMenuInfo.ImageName))
                        {
                            tsb.Image = Feng.Windows.ImageResource.Get("Icons." + windowMenuInfo.ImageName + ".png").Reference;
                        }
                        if (tsb.Image == null)
                        {
                            tsb.Image = Feng.Windows.ImageResource.Get("Feng", "Icons.iconProcess.png").Reference;
                        }
                        tsb.Name = "tsb" + windowMenuInfo.Name;
                        tsb.Text = windowMenuInfo.Text;
                        tsb.ToolTipText = windowMenuInfo.Description;

                        tsb.Tag = windowMenuInfo;
                        tsb.Click += new EventHandler(tsb_Click);
                        toolStrip2.Items.Add(tsb);

                        tsbs.Add(tsb);
                    }
                    else
                    {
                        if (haveTsbs.ContainsKey(windowMenuInfo.OriginalName))
                        {
                            MyToolStripButton tsb = haveTsbs[windowMenuInfo.OriginalName] as MyToolStripButton;
                            if (tsb == null)
                                continue;
                            tsb.DisplayStyle = ToolStripItemDisplayStyle.Image;

                            if (!string.IsNullOrEmpty(windowMenuInfo.ImageName))
                            {
                                tsb.Image = Feng.Windows.ImageResource.Get("Icons." + windowMenuInfo.ImageName + ".png").Reference;
                            }
                            if (tsb.Image == null)
                            {
                                tsb.Image = Feng.Windows.ImageResource.Get("Feng", "Icons.iconProcess.png").Reference;
                            }
                            tsb.Name = "tsb" + windowMenuInfo.Name;
                            tsb.Text = windowMenuInfo.Text;
                            tsb.ToolTipText = windowMenuInfo.Description;

                            tsb.Tag = windowMenuInfo;

                            EventSuppressor es = new EventSuppressor(tsb);
                            es.Suppress();

                            tsb.Click += new EventHandler(tsb_Click);

                            tsbs.Add(tsb);
                        }
                        else
                        {
                            throw new ArgumentException("There is no ToolStripItem of " + windowMenuInfo.OriginalName + "!");
                        }
                    }
                }
            }
            return toolStrip2;
        }
コード例 #3
0
        private static System.Windows.Forms.ToolStrip GenerateWindowMenu(IList <WindowMenuInfo> windowMenuInfos, IList <IButton> tsbs, Dictionary <string, ToolStripItem> haveTsbs)
        {
            System.Windows.Forms.ToolStrip toolStrip2 = new System.Windows.Forms.ToolStrip();
            foreach (WindowMenuInfo windowMenuInfo in windowMenuInfos)
            {
                if (windowMenuInfo.Type == WindowMenuType.Separator)
                {
                    toolStrip2.Items.Add(new System.Windows.Forms.ToolStripSeparator());
                }
                else
                {
                    if (string.IsNullOrEmpty(windowMenuInfo.OriginalName))
                    {
                        MyToolStripButton tsb = new MyToolStripButton();
                        tsb.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                        if (!string.IsNullOrEmpty(windowMenuInfo.ImageName))
                        {
                            tsb.Image = Feng.Windows.ImageResource.Get("Icons." + windowMenuInfo.ImageName + ".png").Reference;
                        }
                        if (tsb.Image == null)
                        {
                            tsb.Image = Feng.Windows.ImageResource.Get("Feng", "Icons.iconProcess.png").Reference;
                        }
                        tsb.Name        = "tsb" + windowMenuInfo.Name;
                        tsb.Text        = windowMenuInfo.Text;
                        tsb.ToolTipText = windowMenuInfo.Description;

                        tsb.Tag    = windowMenuInfo;
                        tsb.Click += new EventHandler(tsb_Click);
                        toolStrip2.Items.Add(tsb);

                        tsbs.Add(tsb);
                    }
                    else
                    {
                        if (haveTsbs.ContainsKey(windowMenuInfo.OriginalName))
                        {
                            MyToolStripButton tsb = haveTsbs[windowMenuInfo.OriginalName] as MyToolStripButton;
                            if (tsb == null)
                            {
                                continue;
                            }
                            tsb.DisplayStyle = ToolStripItemDisplayStyle.Image;

                            if (!string.IsNullOrEmpty(windowMenuInfo.ImageName))
                            {
                                tsb.Image = Feng.Windows.ImageResource.Get("Icons." + windowMenuInfo.ImageName + ".png").Reference;
                            }
                            if (tsb.Image == null)
                            {
                                tsb.Image = Feng.Windows.ImageResource.Get("Feng", "Icons.iconProcess.png").Reference;
                            }
                            tsb.Name        = "tsb" + windowMenuInfo.Name;
                            tsb.Text        = windowMenuInfo.Text;
                            tsb.ToolTipText = windowMenuInfo.Description;

                            tsb.Tag = windowMenuInfo;

                            EventSuppressor es = new EventSuppressor(tsb);
                            es.Suppress();

                            tsb.Click += new EventHandler(tsb_Click);

                            tsbs.Add(tsb);
                        }
                        else
                        {
                            throw new ArgumentException("There is no ToolStripItem of " + windowMenuInfo.OriginalName + "!");
                        }
                    }
                }
            }
            return(toolStrip2);
        }