Beispiel #1
0
        public Form1()
        {
            InitializeComponent();

            WorkState = WorkState.DownloadAndInstall;

            ReadInstallInfo();
            ReadSetting();

            if (!Directory.Exists(Utility.DownloadDirectory))
            {
                Directory.CreateDirectory(Utility.DownloadDirectory);
            }

            var pbColumn = new DataGridViewProgressBarColumn
            {
                Name     = download,
                ReadOnly = true
            };

            dataGridView1.Columns.Add(pbColumn);
            pbColumn = new DataGridViewProgressBarColumn
            {
                Name     = install,
                ReadOnly = true
            };
            dataGridView1.Columns.Add(pbColumn);

            CheckSetting();
            CheckLangFiles();
            SetLanguage(langFileName);
        }
Beispiel #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            DataGridViewProgressBarColumn ProgressBarColumn = new DataGridViewProgressBarColumn();

            this.MissionDataGridView.Columns.Add(ProgressBarColumn);
            ProgressBarColumn.DisplayIndex = 3;
            ProgressBarColumn.CellTemplate = new DataGridViewProgressBarCell();
            ProgressBarColumn.Name         = "ProgressBar";
            //valueDataGridViewProgressBarColumn.ReadOnly = true;
            ProgressBarColumn.DataPropertyName = "value";
            ProgressBarColumn.HeaderText       = "Progress";
            ProgressBarColumn.Maximum          = 10000;
            ProgressBarColumn.Minimum          = 0;
            //ProgressBarColumn.ValueType = Type.GetType("float");
            //this.MissionDataGridView.Rows[0].ReadOnly = true;
            //this.MissionDataGridView.Rows.Add();
            //this.MissionDataGridView.Rows[0].ReadOnly = true;
            //this.MissionDataGridView.Rows[0].Cells[6].Value = 20;
            this.MissionDataGridView.CellContentDoubleClick += MissionDataGridView_CellContentDoubleClick;
        }
Beispiel #3
0
        public static void InitRunDataGrid(System.Windows.Forms.DataGridView grid, string tagName)
        {
            #region MyRegion
            if (grid.InvokeRequired)
            {
                grid.Invoke(new MethodInvoker(delegate()
                {
                    InitRunDataGrid(grid, tagName);
                }));
                return;
            }
            grid.Tag = tagName;
            grid.Columns.Clear();
            DataGridViewTextBoxColumn colGaterherState = new DataGridViewTextBoxColumn();
            colGaterherState.HeaderText       = "状态";
            colGaterherState.Name             = "GaterherState";
            colGaterherState.DataPropertyName = "GaterherState";
            grid.Columns.Add(colGaterherState);


            DataGridViewTextBoxColumn colTaskName = new DataGridViewTextBoxColumn();
            colTaskName.HeaderText       = "任务名称";
            colTaskName.Name             = "TaskName";
            colTaskName.DataPropertyName = "TaskName";
            colTaskName.Width            = 200;
            grid.Columns.Add(colTaskName);

            DataGridViewTextBoxColumn colTaskType = new DataGridViewTextBoxColumn();
            colTaskType.HeaderText       = "任务类型";
            colTaskType.Name             = "TaskType";
            colTaskType.DataPropertyName = "TaskType";
            grid.Columns.Add(colTaskType);

            DataGridViewTextBoxColumn colLoginFlag = new DataGridViewTextBoxColumn();
            colLoginFlag.HeaderText       = "是否登录";
            colLoginFlag.DataPropertyName = "LoginFlag";
            colLoginFlag.Name             = "LoginFlag";
            grid.Columns.Add(colLoginFlag);

            DataGridViewTextBoxColumn colTrueCount = new DataGridViewTextBoxColumn();
            colTrueCount.HeaderText       = "完成页面";
            colTrueCount.DataPropertyName = "TrueCount";
            colTrueCount.Name             = "TrueCount";
            grid.Columns.Add(colTrueCount);

            DataGridViewTextBoxColumn colErrorCount = new DataGridViewTextBoxColumn();
            colErrorCount.HeaderText       = "错误数量";
            colErrorCount.DataPropertyName = "ErrorCount";
            colErrorCount.Name             = "ErrorCount";
            grid.Columns.Add(colErrorCount);

            DataGridViewTextBoxColumn colTotalCount = new DataGridViewTextBoxColumn();
            colTotalCount.HeaderText       = "采集页面";
            colTotalCount.DataPropertyName = "TotalCount";
            colTotalCount.Name             = "TotalCount";
            grid.Columns.Add(colTotalCount);

            DataGridViewProgressBarColumn colProgessValue = new DataGridViewProgressBarColumn();
            colProgessValue.HeaderText       = "当前进度";
            colProgessValue.Maximum          = 100;
            colProgessValue.Mimimum          = 0;
            colProgessValue.Width            = 120;
            colProgessValue.DataPropertyName = "ProgessValue";
            colProgessValue.ValueType        = typeof(int);
            colProgessValue.Name             = "ProgessValue";
            grid.Columns.Add(colProgessValue);

            DataGridViewTextBoxColumn colExcuteType = new DataGridViewTextBoxColumn();
            colExcuteType.HeaderText       = "执行类型";
            colExcuteType.DataPropertyName = "ExcuteType";
            colExcuteType.Name             = "ExcuteType";
            grid.Columns.Add(colExcuteType);

            DataGridViewTextBoxColumn colThreadNum = new DataGridViewTextBoxColumn();
            colThreadNum.HeaderText       = "线程数";
            colThreadNum.DataPropertyName = "ThreadNum";
            colThreadNum.Name             = "ThreadNum";
            grid.Columns.Add(colThreadNum);

            DataGridViewTextBoxColumn colTaskTempName = new DataGridViewTextBoxColumn();
            colTaskTempName.HeaderText       = "TaskTempName";
            colTaskTempName.DataPropertyName = "TaskTempName";
            colTaskTempName.Name             = "TaskTempName";
            colTaskTempName.Visible          = false;
            grid.Columns.Add(colTaskTempName);
            #endregion
        }