public bool Hilite(HiliteLevel level, string pathString) { var path = pathString.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); if (path.Length == 0) { return(false); } if (path[0] != PathHead) { return(false); } if (path.Length >= 2 && path[1] == "battle") { return(toolTabs.SetHilite("Battle", level, false)); } else if (path.Length >= 3) { if (path[1] == "channel") { return(toolTabs.SetHilite(path[2], level, false)); } if (path[1] == "user") { return(toolTabs.SetHilite(path[2], level, true)); } } return(false); }
public bool HilitePath(string navigationPath, HiliteLevel hiliteLevel) { if (string.IsNullOrEmpty(navigationPath)) { return(false); } if (hiliteLevel == HiliteLevel.Flash) { foreach (var b in ButtonList) { if (navigationPath.StartsWith(b.TargetPath)) { b.IsAlerting = true; //make BUTTON turn red } } } var navigable = tabControl.Controls.OfType <Object>().Select(GetINavigatableFromControl).First(x => x != null && navigationPath.Contains(x.PathHead)); if (navigable != null) { return(navigable.Hilite(hiliteLevel, navigationPath)); //make ChatTab's tab to flash } else { return(false); } }
public bool SetHilite(string tabName, HiliteLevel level, bool isPrivateTab) { //Some complicated sequence of call (for reference): //ChatControl.client_said -> MainWindow.NotifyUser -> NavigationControl.HilitePath -> ChatTab.Hilite -> this.SetHiLite //BattleChatControl.TasClient_Said -> MainWindow.NotifyUser -> NavigationControl.HilitePath -> ChatTab.Hilite -> this.SetHiLite //ChatTab.client_said -> MainWindow.NotifyUser -> NavigationControl.HilitePath -> ChatTab.Hilite -> this.SetHiLite tabName = isPrivateTab ? (tabName + "_pm") : (tabName + "_chan"); var button = GetItemByName(toolStrip.Items, tabName); if (button == null) { return(false); } HiliteLevel?current = button.Tag as HiliteLevel?; if (current != null && level == HiliteLevel.Bold && current.Value == HiliteLevel.Flash) { return(false); // dont change from flash to bold } button.Tag = level; var oldFont = button.Font; switch (level) { case HiliteLevel.None: button.BackColor = Color.Empty; button.Font = new Font(oldFont.FontFamily, oldFont.SizeInPoints, FontStyle.Regular, oldFont.Unit, oldFont.GdiCharSet); //oldFont.Dispose(); break; case HiliteLevel.Bold: button.BackColor = Color.Empty; button.Font = new Font(oldFont.FontFamily, oldFont.SizeInPoints, FontStyle.Bold | FontStyle.Italic, oldFont.Unit, oldFont.GdiCharSet); //oldFont.Dispose(); break; case HiliteLevel.Flash: button.Font = new Font(oldFont.FontFamily, oldFont.SizeInPoints, FontStyle.Bold, oldFont.Unit, oldFont.GdiCharSet); //oldFont.Dispose(); break; } return(true); }
public bool Hilite(HiliteLevel level, string pathString) { var path = pathString.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); if (path.Length == 0) { return(false); } if (path[0] != PathHead) { return(false); } else if (path.Length >= 2 && !String.IsNullOrEmpty(path[1])) { return(toolTabs.SetHilite(path[1], level)); } return(false); }
public bool SetHilite(string tabName, HiliteLevel level) { var button = GetItemByName(toolStrip.Items, tabName); if (button == null) { return(false); } HiliteLevel?current = button.Tag as HiliteLevel?; if (current != null && level == HiliteLevel.Bold && current.Value == HiliteLevel.Flash) { return(false); // dont change from flash to bold } button.Tag = level; var oldFont = button.Font; switch (level) { case HiliteLevel.None: button.BackColor = Color.Empty; button.Font = new Font(oldFont.FontFamily, oldFont.SizeInPoints, FontStyle.Regular, oldFont.Unit, oldFont.GdiCharSet); //oldFont.Dispose(); break; case HiliteLevel.Bold: button.BackColor = Color.Empty; button.Font = new Font(oldFont.FontFamily, oldFont.SizeInPoints, FontStyle.Bold | FontStyle.Italic, oldFont.Unit, oldFont.GdiCharSet); //oldFont.Dispose(); break; case HiliteLevel.Flash: button.Font = new Font(oldFont.FontFamily, oldFont.SizeInPoints, FontStyle.Bold, oldFont.Unit, oldFont.GdiCharSet); //oldFont.Dispose(); break; } return(true); }
public bool SetHilite(string tabName, HiliteLevel level, bool isPrivateTab) { tabName = isPrivateTab ? (tabName + "_pm") : (tabName + "_chan"); if (!toolStrip.Items.ContainsKey(tabName)) { return(false); } var button = (ToolStripButton)toolStrip.Items[tabName]; HiliteLevel?current = button.Tag as HiliteLevel?; if (current != null && level == HiliteLevel.Bold && current.Value == HiliteLevel.Flash) { return(false); // dont change from flash to bold } button.Tag = level; var oldFont = button.Font; switch (level) { case HiliteLevel.None: button.BackColor = Color.Empty; button.Font = new Font(oldFont.FontFamily, oldFont.SizeInPoints, FontStyle.Regular, oldFont.Unit, oldFont.GdiCharSet); //oldFont.Dispose(); break; case HiliteLevel.Bold: button.BackColor = Color.Empty; button.Font = new Font(oldFont.FontFamily, oldFont.SizeInPoints, FontStyle.Bold | FontStyle.Italic, oldFont.Unit, oldFont.GdiCharSet); //oldFont.Dispose(); break; case HiliteLevel.Flash: button.Font = new Font(oldFont.FontFamily, oldFont.SizeInPoints, FontStyle.Bold, oldFont.Unit, oldFont.GdiCharSet); //oldFont.Dispose(); break; } return(true); }
public bool Hilite(HiliteLevel level, string pathString) { var path = pathString.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); if (path.Length == 0) return false; if (path[0] != PathHead) return false; if (path.Length >= 2 && path[1] == "battle") return toolTabs.SetHilite("Battle", level, false); else if (path.Length >= 3) { if (path[1] == "channel") return toolTabs.SetHilite(path[2], level, false); if (path[1] == "user") return toolTabs.SetHilite(path[2], level, true); } return false; }
public bool Hilite(HiliteLevel level, string path) { return false; }
public bool SetHilite(string tabName, HiliteLevel level, bool isPrivateTab) { //Some complicated sequence of call (for reference): //ChatControl.client_said -> MainWindow.NotifyUser -> NavigationControl.HilitePath -> ChatTab.Hilite -> this.SetHiLite //BattleChatControl.TasClient_Said -> MainWindow.NotifyUser -> NavigationControl.HilitePath -> ChatTab.Hilite -> this.SetHiLite //ChatTab.client_said -> MainWindow.NotifyUser -> NavigationControl.HilitePath -> ChatTab.Hilite -> this.SetHiLite tabName = isPrivateTab ? (tabName + "_pm") : (tabName + "_chan"); var button = GetItemByName(toolStrip.Items, tabName); if (button == null) return false; HiliteLevel? current = button.Tag as HiliteLevel?; if (current != null && level == HiliteLevel.Bold && current.Value == HiliteLevel.Flash) return false; // dont change from flash to bold button.Tag = level; var oldFont = button.Font; switch (level) { case HiliteLevel.None: button.BackColor = Color.Empty; button.Font = new Font(oldFont.FontFamily, oldFont.SizeInPoints, FontStyle.Regular, oldFont.Unit, oldFont.GdiCharSet); //oldFont.Dispose(); break; case HiliteLevel.Bold: button.BackColor = Color.Empty; button.Font = new Font(oldFont.FontFamily, oldFont.SizeInPoints, FontStyle.Bold | FontStyle.Italic, oldFont.Unit, oldFont.GdiCharSet); //oldFont.Dispose(); break; case HiliteLevel.Flash: button.Font = new Font(oldFont.FontFamily, oldFont.SizeInPoints, FontStyle.Bold, oldFont.Unit, oldFont.GdiCharSet); //oldFont.Dispose(); break; } return true; }
public bool Hilite(HiliteLevel level, string path) { return(false); }
public bool HilitePath(string navigationPath, HiliteLevel hiliteLevel) { if (string.IsNullOrEmpty(navigationPath)) return false; if (hiliteLevel == HiliteLevel.Flash) foreach (var b in ButtonList) if (navigationPath.StartsWith(b.TargetPath)) b.IsAlerting = true; //make BUTTON turn red var navigable = tabControl.Controls.OfType<object>().Select(GetINavigatableFromControl).First(x => x != null && navigationPath.Contains(x.PathHead)); if (navigable != null) return navigable.Hilite(hiliteLevel, navigationPath); //make ChatTab's tab to flash return false; }
public bool SetHilite(string tabName, HiliteLevel level) { var button = GetItemByName(toolStrip.Items, tabName); if (button == null) return false; HiliteLevel? current = button.Tag as HiliteLevel?; if (current != null && level == HiliteLevel.Bold && current.Value == HiliteLevel.Flash) return false; // dont change from flash to bold button.Tag = level; var oldFont = button.Font; switch (level) { case HiliteLevel.None: button.BackColor = Color.Empty; button.Font = new Font(oldFont.FontFamily, oldFont.SizeInPoints, FontStyle.Regular, oldFont.Unit, oldFont.GdiCharSet); //oldFont.Dispose(); break; case HiliteLevel.Bold: button.BackColor = Color.Empty; button.Font = new Font(oldFont.FontFamily, oldFont.SizeInPoints, FontStyle.Bold | FontStyle.Italic, oldFont.Unit, oldFont.GdiCharSet); //oldFont.Dispose(); break; case HiliteLevel.Flash: button.Font = new Font(oldFont.FontFamily, oldFont.SizeInPoints, FontStyle.Bold, oldFont.Unit, oldFont.GdiCharSet); //oldFont.Dispose(); break; } return true; }