public override bool Initialize(IPluginHost host) { if (host == null) { return(false); } _host = host; _controlVisitor = new ControlVisitor(HandleControlVisit); _theme = new KeeTheme(); if (Program.TriggerSystem.Enabled) { // It's better to enable theme as late as possible, but not too late Program.TriggerSystem.RaisingEvent += HandleTriggerSystemRaisingEvent; } else { InitializeTheme(); } GlobalWindowManager.WindowAdded += HandleGlobalWindowManagerWindowAdded; return(true); }
private void HandleTabControlAdded(object sender, ControlEventArgs e) { if (e.Control is TabPage) { var visitor = new ControlVisitor(Apply); visitor.Visit(e.Control); } }
public override bool Initialize(IPluginHost host) { if (host == null) { return(false); } _host = host; _controlVisitor = new ControlVisitor(HandleControlVisit); _theme = new KeeTheme(); Program.TriggerSystem.RaisingEvent += HandleTriggerSystemRaisingEvent; GlobalWindowManager.WindowAdded += HandleGlobalWindowManagerWindowAdded; return(true); }
public override bool Initialize(IPluginHost host) { if (host == null) { return(false); } _host = host; _controlVisitor = new ControlVisitor(HandleControlVisit); var themeEnabled = host.CustomConfig.GetBool(KeeThemeOnConfigItem, false); _theme = new KeeTheme(themeEnabled); if (_theme.Enabled) { ApplyThemeInOpenForms(); } GlobalWindowManager.WindowAdded += HandleGlobalWindowManagerWindowAdded; return(true); }