Exemplo n.º 1
0
    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);
        }
    }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
 internal void SetIcon(IconColour iconColour)
 {
     currentIconColour = iconColour;
     Uri iconUri = new Uri("pack://application:,,,/" + iconColour + ".ico", UriKind.RelativeOrAbsolute);
     NotifyIconMainIcon.Icon = BitmapFrame.Create(iconUri);
 }
Exemplo n.º 4
0
 public GameRegistration(string name, string displayName, IconColour colour)
 {
     Name        = name;
     DisplayName = displayName;
     ColourId    = (int)colour;
 }