Ejemplo n.º 1
0
		public void ClearRows_ShouldClearLinkedControls()
		{
			Grid grid1 = new Grid();
			grid1.Redim(10, 1);
			grid1[0, 0] = new SourceGrid.Cells.Cell();
			RichTextBox rtb = new RichTextBox();
			SourceGrid.LinkedControlValue lk = new SourceGrid.LinkedControlValue(rtb, new SourceGrid.Position(0, 0));
			grid1.LinkedControls.Add(lk);
			grid1.Rows.Clear();
		}
Ejemplo n.º 2
0
        public void ClearRows_ShouldClearLinkedControls()
        {
            Grid grid1 = new Grid();

            grid1.Redim(10, 1);
            grid1[0, 0] = new SourceGrid.Cells.Cell();
            RichTextBox rtb = new RichTextBox();

            SourceGrid.LinkedControlValue lk = new SourceGrid.LinkedControlValue(rtb, new SourceGrid.Position(0, 0));
            grid1.LinkedControls.Add(lk);
            grid1.Rows.Clear();
        }
        private void AddRowToAlertGrid(NMSReportCommand nmsReportCommand)
        {
            CelotMClient.Model.Device device = nmsReportCommand.Device;
            nms_reprot_t nms = nmsReportCommand.nms_reprot_t;

            int insertRowCount = this.alertGrid.Rows.Count;
            this.alertGrid.Rows.Insert(insertRowCount);

            SourceGrid.Cells.Views.ColumnHeader nameHeaderView1 = new SourceGrid.Cells.Views.ColumnHeader();
            DevAge.Drawing.VisualElements.ColumnHeader namebackHeader1 = new DevAge.Drawing.VisualElements.ColumnHeader();
            namebackHeader1.BackColor = Color.DarkSlateGray;
            nameHeaderView1.Background = namebackHeader1;
            nameHeaderView1.Border = cellBorder;
            nameHeaderView1.ForeColor = Color.White;
            nameHeaderView1.Font = new Font("굴림", 8, FontStyle.Regular);
            nameHeaderView1.TextAlignment = DevAge.Drawing.ContentAlignment.MiddleCenter;

            alertGrid[insertRowCount, 0] = new SourceGrid.Cells.Cell(device == null ? "" : device.Name);
            alertGrid[insertRowCount, 0].View = viewNormal;

            alertGrid[insertRowCount, 1] = new SourceGrid.Cells.Cell(device == null ? "" : device.Des);
            alertGrid[insertRowCount, 1].View = viewNormal;

            alertGrid[insertRowCount, 2] = new SourceGrid.Cells.Cell(device == null ? "" : device.GroupName);
            alertGrid[insertRowCount, 2].View = viewNormal;

            alertGrid[insertRowCount, 3] = new SourceGrid.Cells.Cell(device == null ? "" : device.SerialNo.ToString());
            alertGrid[insertRowCount, 3].View = viewNormal;

            alertGrid[insertRowCount, 4] = new SourceGrid.Cells.Cell(device == null ? "" : CelotUtility.ChangePhoneNumberToFormatString(device.PhoneNumber));
            alertGrid[insertRowCount, 4].View = viewNormal;

            alertGrid[insertRowCount, 5] = new SourceGrid.Cells.Cell(device == null ? "" : device.RouterIp);
            alertGrid[insertRowCount, 5].View = viewNormal;

            alertGrid[insertRowCount, 6] = new SourceGrid.Cells.Cell(nms == null ? "" : nms.header.session_id.ToString());
            alertGrid[insertRowCount, 6].View = viewNormal;

            alertGrid[insertRowCount, 7] = new SourceGrid.Cells.Cell(nms == null ? "" : nms.data.moduleband.ToString());
            alertGrid[insertRowCount, 7].View = viewNormal;

            alertGrid[insertRowCount, 8] = new SourceGrid.Cells.Cell(nms == null ? "" : nmsReportCommand.GetLanIPString());
            alertGrid[insertRowCount, 8].View = viewNormal;

            alertGrid[insertRowCount, 9] = new SourceGrid.Cells.Cell(nms == null ? "" : nmsReportCommand.GetWanIPString());
            alertGrid[insertRowCount, 9].View = viewNormal;

            alertGrid[insertRowCount, 10] = new SourceGrid.Cells.Cell(nms == null ? "" : nms.data.devicestatus.ToString());
            alertGrid[insertRowCount, 10].View = viewNormal;

            alertGrid[insertRowCount, 11] = new SourceGrid.Cells.Cell(nms == null ? "" : nms.data.vpnstatus.ToString());
            alertGrid[insertRowCount, 11].View = viewNormal;

            alertGrid[insertRowCount, 12] = new SourceGrid.Cells.Cell(nms == null ? "" : nms.data.wifistatus.ToString());
            alertGrid[insertRowCount, 12].View = viewNormal;

            alertGrid[insertRowCount, 13] = new SourceGrid.Cells.Cell(nms == null ? "" : nms.data.newsms.ToString());
            alertGrid[insertRowCount, 13].View = viewNormal;

            alertGrid[insertRowCount, 14] = new SourceGrid.Cells.Cell(nms == null ? "" : nms.data.sw_version);
            alertGrid[insertRowCount, 14].View = viewNormal;

            alertGrid[insertRowCount, 15] = new SourceGrid.Cells.Cell(nms == null ? "" : nms.data.external_power.ToString());
            alertGrid[insertRowCount, 15].View = viewNormal;

            alertGrid[insertRowCount, 16] = new SourceGrid.Cells.Cell(nms == null ? "" : nms.data.ext_device1[0].ToString());
            alertGrid[insertRowCount, 16].View = viewNormal;

            SignalBar signal = new SignalBar();
            signal.Dock = DockStyle.None;
            signal.Minimum = 0;
            signal.Maximum = 4;
            signal.BackColor = Color.SlateGray;

            if (nms != null)
            {
                signal.CurrentValue = nmsAlertManager.getRssiLevel(nms.data.modulesignal);
            }
            else
            {
                signal.CurrentValue = 0;
            }

            SourceGrid.Cells.Cell signalCell = new SourceGrid.Cells.Cell();
            alertGrid[insertRowCount, 17] = signalCell;
            alertGrid[insertRowCount, 17].View = viewNormal;
            SourceGrid.LinkedControlValue linkedControlValue = new SourceGrid.LinkedControlValue(signal, new SourceGrid.Position(insertRowCount, 17));
            alertGrid.LinkedControls.Add(linkedControlValue);

            alertGrid[insertRowCount, 18] = new SourceGrid.Cells.Cell((nms == null ? "" : nms.data.rpt_time.ToString()));
            alertGrid[insertRowCount, 18].View = viewNormal;

            alertGrid[insertRowCount, 19] = new SourceGrid.Cells.Cell((nms == null ? "" : nms.header.pro_ver.ToString()));
            alertGrid[insertRowCount, 19].View = nameHeaderView1;

            string currentTime = CelotUtility.ChangeStampStringToLocalFormat(nms.data.current_time);
            alertGrid[insertRowCount, 20] = new SourceGrid.Cells.Cell(currentTime);
            alertGrid[insertRowCount, 20].View = viewNormal;

            string resetTime = "";
            if (device != null && device.ResetTime != 0)
            {
                resetTime = CelotUtility.UnixTimeStampToDateString(device.ResetTime);
            }
            alertGrid[insertRowCount, 21] = new SourceGrid.Cells.Cell(resetTime);
            alertGrid[insertRowCount, 21].View = viewNormal;
        }
        private void addRowToDownloadGrid(Download download)
        {
            PopupMenu menuController = new PopupMenu(this);
            int insertRowCount = downloadGrid.Rows.Count;
            download.RowIndex = insertRowCount;

            downloadGrid.Rows.Insert(insertRowCount);
            downloadGrid[insertRowCount, 0] = new SourceGrid.Cells.CheckBox(null, download.DownloadEnable);
            downloadGrid[insertRowCount, 0].View = viewCheckBox;
            downloadGrid[insertRowCount, 0].AddController(menuController);
            downloadGrid[insertRowCount, 0].Controller.RemoveController(downloadGrid[insertRowCount, 0].FindController<SourceGrid.Cells.Controllers.CheckBox>());
            downloadGrid[insertRowCount, 0].Controller.AddController(new SourceGrid.Cells.Controllers.CheckBox(false));
            downloadGrid[insertRowCount, 0].FindController<SourceGrid.Cells.Controllers.CheckBox>().CheckedChanged +=
                   ChangeActivateCheckBox(insertRowCount);

            downloadGrid[insertRowCount, 1] = new SourceGrid.Cells.Cell(download.No);
            downloadGrid[insertRowCount, 1].View = viewNormal;
            downloadGrid[insertRowCount, 1].AddController(menuController);

            downloadGrid[insertRowCount, 2] = new SourceGrid.Cells.Cell(download.Ip);
            downloadGrid[insertRowCount, 2].View = viewNormal;
            downloadGrid[insertRowCount, 2].AddController(menuController);

            downloadGrid[insertRowCount, 3] = new SourceGrid.Cells.Cell(Path.GetFileName(download.DownloadFileName));
            downloadGrid[insertRowCount, 3].View = viewNormal;
            downloadGrid[insertRowCount, 3].AddController(menuController);

            ProgressBar progressBar = new ProgressBar();
            progressBar.BackColor = Color.Gray;
            progressBar.ForeColor = Color.DarkSlateGray;
            progressBar.Value = 0;
            SourceGrid.Cells.Cell cell = new SourceGrid.Cells.Cell(download.Progress);
            downloadGrid[insertRowCount, 4] = cell;
            downloadGrid[insertRowCount, 4].View = viewNormal;
            downloadGrid[insertRowCount, 4].AddController(menuController);
            SourceGrid.LinkedControlValue linkedControlValue = new SourceGrid.LinkedControlValue(progressBar, new SourceGrid.Position(insertRowCount, 4));
            downloadGrid.LinkedControls.Add(linkedControlValue);

            SourceGrid.Cells.Views.Cell statusCell = new SourceGrid.Cells.Views.Cell();
            statusCell.Border = cellBorder;
            statusCell.Font = new Font("돋음", 8, FontStyle.Regular);
            statusCell.BackColor = download.Status.ColorParse();

            SourceGrid.Cells.Cell cell5 = new SourceGrid.Cells.Cell(download.Status.Parse());
            downloadGrid[insertRowCount, 5] = cell5;
            downloadGrid[insertRowCount, 5].View = statusCell;
            downloadGrid[insertRowCount, 5].AddController(menuController);

            DownLoadBinding binding = new DownLoadBinding();
            binding.ProgressBar = progressBar;
            binding.Cell = cell5;
            binding.StatusCell = statusCell;
            downloadGrid.Rows[insertRowCount].Tag = binding;
        }