SetStyle() публичный Метод

public SetStyle ( ToolStrip strip, VsVersion version, ThemeBase theme ) : void
strip ToolStrip
version VsVersion
theme ThemeBase
Результат void
Пример #1
0
        public void EnableVSRenderer(ThemeBase theme, VisualStudioToolStripExtender.VsVersion version = VisualStudioToolStripExtender.VsVersion.Vs2015)
        {
            System.Reflection.FieldInfo[] fieldInfo = this.GetType().GetFields(System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);

            for (int i = 0; i < fieldInfo.Length; i++)
            {
                switch (fieldInfo[i].FieldType.Name)
                {
                case "ContextMenuStrip":
                    ContextMenuStrip cms = (ContextMenuStrip)fieldInfo[i].GetValue(this);
                    cms.DropShadowEnabled = false;
                    vsToolStripExtender.SetStyle(cms, version, theme);
                    break;

                case "ToolStrip":
                    ToolStrip ts = (ToolStrip)fieldInfo[i].GetValue(this);
                    vsToolStripExtender.SetStyle(ts, version, theme);
                    break;

                case "StatusStrip":
                    StatusStrip ss = (StatusStrip)fieldInfo[i].GetValue(this);
                    vsToolStripExtender.SetStyle(ss, version, theme);
                    break;
                }
            }
        }
Пример #2
0
 private new void ApplyTheme()
 {
     if (ThemeManager.getInstance().ThemingActive)
     {
         base.ApplyTheme();
         this.vsToolStripExtender            = new WeifenLuo.WinFormsUI.Docking.VisualStudioToolStripExtender(this.components);
         vsToolStripExtender.DefaultRenderer = _toolStripProfessionalRenderer;
         vsToolStripExtender.SetStyle(cMenScreenshot, ThemeManager.getInstance().ActiveTheme.Version, ThemeManager.getInstance().ActiveTheme.Theme);
     }
 }