示例#1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (ScoutName.Length != 0)
            {
                hash ^= ScoutName.GetHashCode();
            }
            if (TrainerId != 0UL)
            {
                hash ^= TrainerId.GetHashCode();
            }
            if (DropRate != 0)
            {
                hash ^= DropRate.GetHashCode();
            }
            if (DisplayOrder != 0)
            {
                hash ^= DisplayOrder.GetHashCode();
            }
            if (U5 != 0)
            {
                hash ^= U5.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
        private void LoadModuleScoutTabComponents()
        {
            int currentRow  = 0;
            int binaryCount = 0;

            string ftpHost     = this.formRepoAccountInfo.RepoAccountHost;
            string ftpPort     = this.formRepoAccountInfo.RepoAccountPort;
            string ftpUser     = this.formRepoAccountInfo.RepoAccountLogin;
            string ftpPassword = this.formRepoAccountInfo.RepoAccountPassword;

            this.binaryUpdateStatus = GenerateBinaryUpdateStatusList(ftpHost, ftpPort, ftpUser, ftpPassword);

            // remove existing tab contents
            if (null != this.tableLayoutPanelModuleScout)
            {
                this.tabModuleScouts.Controls.Remove(this.tableLayoutPanelModuleScout);
            }

            // create the components that are not dynamic
            this.tableLayoutPanelModuleScout = new System.Windows.Forms.TableLayoutPanel();
            this.buttonModuleScoutRefresh    = new System.Windows.Forms.Button();
            this.labelModuleScoutLatest      = new System.Windows.Forms.Label();
            this.labelModuleScoutYours       = new System.Windows.Forms.Label();


            // suspend all layout
            tabModuleScouts.SuspendLayout();
            this.tableLayoutPanelModuleScout.SuspendLayout();

            // calc the total number of rows = # of binaries + 5
            binaryCount += this.binaryUpdateStatus[AppName].Count;
            binaryCount += this.binaryUpdateStatus[DriverName].Count;
            binaryCount += this.binaryUpdateStatus[ScoutName].Count;

            this.tableLayoutPanelModuleScout.RowCount = binaryCount + 5;

            // initialize the non-dynamic components

            //
            // tableLayoutPanelModuleScout
            //
            this.tableLayoutPanelModuleScout.AutoScroll      = true;
            this.tableLayoutPanelModuleScout.CellBorderStyle = TableLayoutPanelCellBorderStyle.None;
            this.tableLayoutPanelModuleScout.ColumnCount     = 6;
            this.tableLayoutPanelModuleScout.AutoSize        = true;
            this.tableLayoutPanelModuleScout.Location        = new System.Drawing.Point(0, 0);
            this.tableLayoutPanelModuleScout.Name            = "tableLayoutPanelModuleScout";
            this.tableLayoutPanelModuleScout.MinimumSize     = new Size(this.tabModuleScouts.Size.Width, this.tabModuleScouts.Size.Height);
            this.tableLayoutPanelModuleScout.MaximumSize     = this.tabModuleScouts.Size;
            this.tableLayoutPanelModuleScout.TabIndex        = 0;

            this.tabModuleScouts.Controls.Add(this.tableLayoutPanelModuleScout);

            //
            // labelModuleScoutLatest
            //
            this.labelModuleScoutLatest.Dock     = System.Windows.Forms.DockStyle.None;
            this.labelModuleScoutLatest.AutoSize = false;
            this.labelModuleScoutLatest.Font     = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.labelModuleScoutLatest.Name     = "labelModuleScoutLatest";
            this.labelModuleScoutLatest.TabIndex = 4;
            this.labelModuleScoutLatest.Text     = "On FTP";
            this.labelModuleScoutLatest.Margin   = new Padding(0);
            //
            // labelModuleScoutYours
            //
            this.labelModuleScoutYours.Dock     = System.Windows.Forms.DockStyle.None;
            this.labelModuleScoutYours.AutoSize = false;
            this.labelModuleScoutYours.Font     = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.labelModuleScoutYours.Name     = "labelModuleScoutYours";
            this.labelModuleScoutYours.TabIndex = 4;
            this.labelModuleScoutYours.Text     = "Local";
            this.labelModuleScoutYours.Margin   = new Padding(0);


            // add some of the non-dyamic components to the layout panel

            this.tableLayoutPanelModuleScout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 22));
            this.tableLayoutPanelModuleScout.Controls.Add(this.labelModuleScoutLatest, 1, currentRow);
            this.tableLayoutPanelModuleScout.Controls.Add(this.labelModuleScoutYours, 2, currentRow++);


            //
            // labelApps
            //
            this.labelApps           = new System.Windows.Forms.Label();
            this.labelApps.AutoSize  = false;
            this.labelApps.Dock      = System.Windows.Forms.DockStyle.None;
            this.labelApps.Name      = "labelApps";
            this.labelApps.Font      = new Font(FontFamily.GenericSansSerif, 12F, FontStyle.Bold);
            this.labelApps.TabIndex  = 6;
            this.labelApps.Text      = AppName.ToUpper();
            this.labelApps.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.labelApps.Margin    = new Padding(0);

            //
            // labelDrivers
            //
            this.labelDrivers           = new System.Windows.Forms.Label();
            this.labelDrivers.AutoSize  = false;
            this.labelDrivers.Dock      = System.Windows.Forms.DockStyle.None;
            this.labelDrivers.Name      = "labelDrivers";
            this.labelDrivers.Font      = new Font(FontFamily.GenericSansSerif, 12F, FontStyle.Bold);
            this.labelDrivers.TabIndex  = 6;
            this.labelDrivers.Text      = DriverName.ToUpper();
            this.labelDrivers.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.labelDrivers.Margin    = new Padding(0);

            //
            // labelScouts
            //
            this.labelScouts           = new System.Windows.Forms.Label();
            this.labelScouts.AutoSize  = false;
            this.labelScouts.Dock      = System.Windows.Forms.DockStyle.None;
            this.labelScouts.Name      = "labelScouts";
            this.labelScouts.Font      = new Font(FontFamily.GenericSansSerif, 12F, FontStyle.Bold);
            this.labelScouts.TabIndex  = 6;
            this.labelScouts.Text      = ScoutName.ToUpper();
            this.labelScouts.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.labelScouts.Margin    = new Padding(0);

            //
            // buttonModuleScoutRefresh
            //
            this.buttonModuleScoutRefresh.AutoSize = false;
            this.buttonModuleScoutRefresh.Dock     = System.Windows.Forms.DockStyle.Bottom;
            this.buttonModuleScoutRefresh.Name     = "buttonModuleScoutRefresh";
            this.buttonModuleScoutRefresh.TabIndex = 1;
            this.buttonModuleScoutRefresh.Text     = "Refresh";
            this.buttonModuleScoutRefresh.UseVisualStyleBackColor = true;
            this.buttonModuleScoutRefresh.Click += new System.EventHandler(this.buttonModuleScoutRefresh_Click);
            this.buttonModuleScoutRefresh.Margin = new Padding(0);

            // Apps label
            this.tableLayoutPanelModuleScout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 22));
            this.tableLayoutPanelModuleScout.Controls.Add(this.labelApps, 0, currentRow++);

            // create the list of apps rows

            this.HubOtherUpdatePanelList = new List <HubOtherUpdatePanelRowItem>();
            for (int i = 0; i < this.binaryUpdateStatus[AppName].Count; ++i)
            {
                this.tableLayoutPanelModuleScout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 22));
                HubOtherUpdatePanelRowItem hubOtherUpdatePanelRowItem = new HubOtherUpdatePanelRowItem(
                    this.tableLayoutPanelModuleScout,
                    currentRow++,
                    this.binaryUpdateStatus[AppName][i].Item1,
                    AppName,
                    this.binaryUpdateStatus[AppName][i].Item3,
                    this.binaryUpdateStatus[AppName][i].Item2,
                    !this.binaryUpdateStatus[AppName][i].Item4 /* needs repo update == Item4*/,
                    this.folderBrowserWorkingDir.SelectedPath + "\\binaries\\Pipeline\\AddIns",
                    this.folderBrowserWorkingDir.SelectedPath + "\\HomeStore\\Repository",
                    ftpHost,
                    ftpPort,
                    ftpUser,
                    ftpPassword,
                    this.logger
                    );
                this.HubOtherUpdatePanelList.Add(hubOtherUpdatePanelRowItem);
            }

            // Drivers label
            this.tableLayoutPanelModuleScout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 22));
            this.tableLayoutPanelModuleScout.Controls.Add(this.labelDrivers, 0, currentRow++);

            // create the list of driver rows

            this.HubOtherUpdatePanelList = new List <HubOtherUpdatePanelRowItem>();
            for (int i = 0; i < this.binaryUpdateStatus[DriverName].Count; ++i)
            {
                this.tableLayoutPanelModuleScout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 22));
                HubOtherUpdatePanelRowItem hubOtherUpdatePanelRowItem = new HubOtherUpdatePanelRowItem(
                    this.tableLayoutPanelModuleScout,
                    currentRow++,
                    this.binaryUpdateStatus[DriverName][i].Item1,
                    DriverName,
                    this.binaryUpdateStatus[DriverName][i].Item3,
                    this.binaryUpdateStatus[DriverName][i].Item2,
                    !this.binaryUpdateStatus[DriverName][i].Item4 /* needs repo update == Item4*/,
                    this.folderBrowserWorkingDir.SelectedPath + "\\binaries\\Pipeline\\AddIns",
                    this.folderBrowserWorkingDir.SelectedPath + "\\HomeStore\\Repository",
                    ftpHost,
                    ftpPort,
                    ftpUser,
                    ftpPassword,
                    this.logger
                    );
                this.HubOtherUpdatePanelList.Add(hubOtherUpdatePanelRowItem);
            }

            // Scouts label
            this.tableLayoutPanelModuleScout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 22));
            this.tableLayoutPanelModuleScout.Controls.Add(this.labelScouts, 0, currentRow++);

            // create the list of scout rows

            this.HubOtherUpdatePanelList = new List <HubOtherUpdatePanelRowItem>();
            for (int i = 0; i < this.binaryUpdateStatus[ScoutName].Count; ++i)
            {
                this.tableLayoutPanelModuleScout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 22));
                HubOtherUpdatePanelRowItem hubOtherUpdatePanelRowItem = new HubOtherUpdatePanelRowItem(
                    this.tableLayoutPanelModuleScout,
                    currentRow++,
                    this.binaryUpdateStatus[ScoutName][i].Item1,
                    ScoutName,
                    this.binaryUpdateStatus[ScoutName][i].Item3,
                    this.binaryUpdateStatus[ScoutName][i].Item2,
                    !this.binaryUpdateStatus[ScoutName][i].Item4 /* needs repo update == Item4*/,
                    this.folderBrowserWorkingDir.SelectedPath + "\\binaries\\Scouts",
                    this.folderBrowserWorkingDir.SelectedPath + "\\HomeStore\\Repository",
                    ftpHost,
                    ftpPort,
                    ftpUser,
                    ftpPassword,
                    this.logger
                    );
                this.HubOtherUpdatePanelList.Add(hubOtherUpdatePanelRowItem);
            }

            // add the Update button component add the bottom

            this.tableLayoutPanelModuleScout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 22));
            this.tableLayoutPanelModuleScout.Controls.Add(this.buttonModuleScoutRefresh, 0, currentRow++);

            Debug.Assert(currentRow == this.tableLayoutPanelModuleScout.RowCount);

            // resume layout
            this.tabModuleScouts.ResumeLayout(false);
            this.tableLayoutPanelModuleScout.ResumeLayout(false);
            this.tableLayoutPanelModuleScout.PerformLayout();
        }