public override int GetHashCode() { unchecked { var n = 23; var hash = 17; hash = hash * n + IconUrl.GetHashCode(); hash = hash * n + IconColour.GetHashCode(); hash = hash * n + IconScale.GetHashCode(); hash = hash * n + LineColour.GetHashCode(); hash = hash * n + LineWidth.GetHashCode(); hash = hash * n + PolygonColour.GetHashCode(); return(hash); } }
private void LoadConfiguration(bool reconfigure) { if (reconfigure) { buildUpdates.Clear(); buildContent.Clear(); lastStatusMessage = new StatusMessage { Message = "" }; buildIdsAlertedInProgress.Clear(); buildIdUris.Clear(); buildIdsAlertedQueued.Clear(); buildIdsAlertedDone.Clear(); currentIconColour = IconColour.Grey; statusMessages.Clear(); buildContentView.Clear(); foreach (var server in servers) { server.Dispose(); } } //StatusMessage initializing = new StatusMessage { Message = "Initializing..." }; //MessageWindow.Show(initializing, 3000); if (File.Exists(TeamServer.ServerConfigurationPath)) { try { servers = GetServersFromConfigurationFile(); if (servers == null || servers.Count == 0) { RunConfigurationWindow(); servers = GetServersFromConfigurationFile(); } } catch (Exception) { servers = new List<TeamServer>(); } } else { RunConfigurationWindow(); servers = GetServersFromConfigurationFile(); } //Add version as menu item if (!reconfigure) { MenuItem versionMenuItem = new MenuItem { Header = "Version : " + Assembly.GetExecutingAssembly().GetName().Version }; NotifyIconMainIcon.ContextMenu.Items.Insert(0, versionMenuItem); NotifyIconMainIcon.ContextMenu.Items.Insert(1, new Separator()); //Add Reconfigure option into menu MenuItem reconfigureMenuItem = new MenuItem { Header = "Change Servers" }; reconfigureMenuItem.Click += reconfigureMenuItem_Click; NotifyIconMainIcon.ContextMenu.Items.Insert(2, reconfigureMenuItem); } //Attach to server events foreach (TeamServer server in servers) { server.OnProjectsUpdated += Server_OnProjectsUpdated; } //Open xml file of builds to hide LoadHiddenBuilds(); InitializeServers(); }
internal void SetIcon(IconColour iconColour) { currentIconColour = iconColour; Uri iconUri = new Uri("pack://application:,,,/" + iconColour + ".ico", UriKind.RelativeOrAbsolute); NotifyIconMainIcon.Icon = BitmapFrame.Create(iconUri); }
public GameRegistration(string name, string displayName, IconColour colour) { Name = name; DisplayName = displayName; ColourId = (int)colour; }