コード例 #1
1
ファイル: frmMain.cs プロジェクト: oxan/mpwebservices
 public frmMain()
 {
     InitializeComponent();
       LoadConfig();
       nudPort.Value = (Decimal)httpPort;
       edHost.Text = tvServerHost;
       nudWidth.Value = thumbWidth;
       nudHeight.Value = thumbHeight;
       edPlayer.Text = clientPlayer;
       edUid.Text = uid;
       edPwd.Text = pwd;
       cbPlayerType.SelectedIndex = playerType;
       foreach (EncoderConfig cfg in encCfgs)
       {
     DataGridViewRow row = new DataGridViewRow();
     row.CreateCells(grid);
     row.Cells[0].Value = cfg.displayName;
     row.Cells[1].Value = cfg.useTranscoding;
     row.Cells[2].Value = cfg.fileName;
     row.Cells[3].Value = cfg.args;
     row.Cells[4].Value = cfg.inputMethod.ToString();
     row.Cells[5].Value = cfg.outputMethod.ToString();
     grid.Rows.Add(row);
       }
       grid.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
 }
コード例 #2
1
ファイル: frmEPG.cs プロジェクト: arangas/MediaPortal-1
 private void lbChannels_Click(object sender, EventArgs e)
 {
   if (lbChannels.SelectedIndex == -1)
     return;
   grid.Rows.Clear();
   string id = lbChannels.SelectedItem.ToString();
   id = id.Substring(0, id.IndexOf(" "));
   List<EPGInfo> infos = server.GetEPGForChannel(id);
   bool isAlternating = false;
   foreach (EPGInfo epg in infos)
   {
     DataGridViewRow row = new DataGridViewRow();
     row.CreateCells(grid);
     row.Cells[0].Value = epg.startTime.ToString("dd.MM.yy") + " " + epg.startTime.ToString("HH:mm") + "-" +
                          epg.endTime.ToString("HH:mm");
     row.Cells[1].Value = epg.title;
     row.DefaultCellStyle.Font = new Font("Tahoma", 8, FontStyle.Bold);
     if (isAlternating)
       row.DefaultCellStyle.BackColor = System.Drawing.Color.LightGray;
     grid.Rows.Add(row);
     row = new DataGridViewRow();
     row.CreateCells(grid);
     row.Cells[1].Value = epg.description;
     if (isAlternating)
       row.DefaultCellStyle.BackColor = System.Drawing.Color.LightGray;
     grid.Rows.Add(row);
     isAlternating = (!isAlternating);
   }
   grid.AutoResizeColumns();
 }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: psliurt/HttpQlight
        private void addHeaderBtn_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(reqHeaderKeyCmb.Text))
            { return; }

            if (string.IsNullOrEmpty(reqHeaderValTxt.Text))
            { return; }

            foreach (DataGridViewRow r in headerGrdVw.Rows)
            {
                if (r.Cells[0].Value != null &&
                    r.Cells[0].Value.ToString() == reqHeaderKeyCmb.Text)
                {
                    MessageBox.Show("該Header已存在!");
                    return;
                }
            }

            DataGridViewRow row = new DataGridViewRow();
            row.CreateCells(headerGrdVw);
            row.Cells[0].Value = reqHeaderKeyCmb.Text;
            row.Cells[1].Value = reqHeaderValTxt.Text;
            headerGrdVw.Rows.Add(row);

            reqHeaderKeyCmb.SelectedIndex = 0;
            reqHeaderValTxt.Text = string.Empty;
        }
コード例 #4
0
        protected override void OnPrimaryKeyChangedComplete(Exception error)
        {
            if (error != null)
            {
                RTOut.WriteError(error);
                throw error;
            }

            dgvUDS.Rows.Clear();

            List<string> udsNames = new List<string>();

            foreach (XElement each in UDS.Elements("Contract"))
            {
                udsNames.Add(each.AttributeText("Name"));
            }

            udsNames.Sort();

            foreach (string each in udsNames)
            {
                DataGridViewRow row = new DataGridViewRow();

                row.CreateCells(dgvUDS, each);

                dgvUDS.Rows.Add(row);
            }
        }
コード例 #5
0
        /// <summary>
        /// 取得したログをGrid、Chartに出力する
        /// </summary>
        /// <param name="logData"></param>
        private void bufferingLog(LogData logData)
        {
            DataGridViewRow row = new DataGridViewRow();

            row.CreateCells(dataGridView);
            row.Cells[0].Value = logData.RelTick;
            row.Cells[1].Value = logData.DataLeft;
            row.Cells[2].Value = logData.DataRight;
            row.Cells[3].Value = logData.Light;
            row.Cells[4].Value = logData.MotorCnt0;
            row.Cells[5].Value = logData.MotorCnt1;
            row.Cells[6].Value = logData.MotorCnt2;
            row.Cells[7].Value = logData.SensorAdc0;
            row.Cells[8].Value = logData.SensorAdc1;
            row.Cells[9].Value = logData.SensorAdc2;
            row.Cells[10].Value = logData.SensorAdc3;
            row.Cells[11].Value = logData.I2c;

            logBufferList.Add(row);

            if (stopwatch4Grid.ElapsedMilliseconds > 1000 || logBufferList.Count > 100)
            {
                outputGrid();
                stopwatch4Grid.Restart();
                logBufferList.Clear();
            }
        }
コード例 #6
0
        protected override void OnPrimaryKeyChangedComplete(Exception error)
        {
            dgvTransfers.Rows.Clear();
            if (error == null)
            {
                Dictionary<int, string> indexToFIeldName = GetIndexMapping(Data);

                foreach (XElement record in Data.Elements("Record"))
                {
                    Dictionary<string, string> values = new Dictionary<string, string>();
                    foreach (XElement column in record.Elements("Column"))
                    {
                        int index = int.Parse(column.AttributeText("Index"));
                        string value = (column.Value);

                        values.Add(indexToFIeldName[index], value);
                    }

                    DataGridViewRow row = new DataGridViewRow();
                    row.Tag = values["uid"];
                    row.CreateCells(dgvTransfers, values["name"], values["token"], values["status"], values["target"]);
                    dgvTransfers.Rows.Add(row);
                }
            }
        }
コード例 #7
0
		private void FormSenka_Load(object _sender, EventArgs _e)
		{
			RecordManager.Instance.Senka.OnUpdated += UpdatedRanking;
			APIObserver.Instance.APIList["api_port/port"].ResponseReceived +=
				(_, __) => {
					UpdatedMySenka();
					UpdatedRanking();
				};

			// フォント設定変更時反映イベント
			Utility.Configuration.Instance.ConfigurationChanged += ConfigurationChanged;

			// 各順位の行を作成
			SenkaView.SuspendLayout();
			SenkaView.Rows.Clear();

			int[] ranks = { 1, 5, 20, 100, 500 };
			for(int i = 0; i < RankRows.Length; i++)
			{
				DataGridViewRow row = new DataGridViewRow();
				row.CreateCells(SenkaView);
				row.Cells[SenkaView_Rank.Index].Value = $"{ranks[i]}位";
				SenkaView.Rows.Add(row);
				RankRows[i] = row;
			}
			ConfigurationChanged();

			SenkaView.ResumeLayout();
		}
コード例 #8
0
ファイル: P2G.cs プロジェクト: C4Help/P2G_Crawler
        private void AddValidRow(DataGridViewRow dr, Dictionary<string, string> results)
        {
            if (results.Count == 0) return;

            // Prepare the new row
            DataGridViewRow dgvr = new DataGridViewRow();
            dgvr.CreateCells(gridViewResults);
            DataGridViewCellStyle style = new DataGridViewCellStyle();
            style.BackColor = Color.LightGreen;
            style.ForeColor = Color.Black;
            dgvr.Cells[3].Style = style;

            // Based on the Crawling Settings, add the new data to the result grid view
            switch (cs.CrawlItemType)
            {
                case "Social Media":
                    dgvr.SetValues(new object[] {count, dr.Cells[1].Value, dr.Cells[2].Value, "Valid", results["facebook"], results["linkedin"], results["twitter"], results["youtube"] });
                    SaveToDB(count, dr.Cells[1].Value, dr.Cells[2].Value, "Valid", results["facebook"], results["linkedin"], results["twitter"], results["youtube"]);
                    break;
                case "Contact Info":
                    dgvr.SetValues(new object[] {count, dr.Cells[1].Value, dr.Cells[2].Value, "Valid", results["email"], results["phone"], results["fax"] });

                    break;

            }
            gridViewResults.Rows.Add(dgvr);
        }
コード例 #9
0
ファイル: MainForm.cs プロジェクト: nodia/scut
        private void AddRows(IEnumerable<string> rows)
        {
            _exampleRow = rows.First();
            var rowArray = rows.Select(row =>
            {
                var model = RowViewModel.Parse(_settings, row);
                var dgrow = new DataGridViewRow();
                dgrow.CreateCells(gridView, model.Data);
                dgrow.DefaultCellStyle.BackColor = model.Color;
                dgrow.Visible = !model.Hidden;
                return dgrow;
            }).ToArray();
            gridView.Rows.AddRange(rowArray);

            if (!toolStripButtonScrollLock.Checked) return;

            for (int index = gridView.Rows.Count - 1; index > 0; index--)
            {
                var dataGridViewRow = gridView.Rows[index];
                if (dataGridViewRow.Visible)
                {
                    gridView.FirstDisplayedScrollingRowIndex = index;
                    return;
                }
            }
        }
コード例 #10
0
		public DialogShipGroupColumnFilter( DataGridView target, ShipGroupData group ) {
			InitializeComponent();


			var rows = new LinkedList<DataGridViewRow>();
			var row = new DataGridViewRow();

			row.CreateCells( ColumnView );
			row.SetValues( "(全て)", null, null, "-" );
			row.Cells[ColumnView_Width.Index].ReadOnly = true;
			rows.AddLast( row );

			foreach ( var c in group.ViewColumns.Values.OrderBy( c => c.DisplayIndex ) ) {
				row = new DataGridViewRow();
				row.CreateCells( ColumnView );
				row.SetValues( target.Columns[c.Name].HeaderText, c.Visible, c.AutoSize, c.Width );
				row.Cells[ColumnView_Width.Index].ValueType = typeof( int );
				row.Tag = c.Name;
				rows.AddLast( row );
			}

			ColumnView.Rows.AddRange( rows.ToArray() );


			ScrLkColumnCount.Minimum = 0;
			ScrLkColumnCount.Maximum = group.ViewColumns.Count;
			ScrLkColumnCount.Value = group.ScrollLockColumnCount;
		}
コード例 #11
0
        protected override void OnPrimaryKeyChangedComplete(Exception error)
        {
            if (error != null)
            {
                RTOut.WriteError(error);
                throw error;
            }

            dgvUDT.Rows.Clear();

            List<string> udtNames = new List<string>();

            foreach (XElement each in UDT.Elements("TableName"))
                udtNames.Add(each.Value);

            udtNames.Sort();

            foreach (string each in udtNames)
            {
                DataGridViewRow row = new DataGridViewRow();

                row.CreateCells(dgvUDT, each);

                dgvUDT.Rows.Add(row);
            }
        }
コード例 #12
0
ファイル: TableForm.cs プロジェクト: Upliner/XFormTrans
        public TableForm(string name, IDataReader rdr)
        {
            DataGridView dgv = new DataGridView();
            dgv.Dock = DockStyle.Fill;
            DataGridViewTextBoxCell template = new DataGridViewTextBoxCell();
            template.Style.Font = new Font("DejaVu Sans",10);
            for (int i = 0;i < rdr.FieldCount;i++)
            {
                DataGridViewColumn col = new DataGridViewColumn(template);
                col.Name = rdr.GetName(i);
                dgv.Columns.Add(col);
            }
            while (rdr.Read())
            {
                DataGridViewRow row = new DataGridViewRow();
                row.CreateCells(dgv);
                for (int i = 0;i < rdr.FieldCount;i++)
                {
                    object val = rdr[i];
                    if (val is byte[])
                    {
                        val = Encoding.UTF8.GetString((byte[])val);
                    }
                    row.Cells[i].Value = val;
                }
                dgv.Rows.Add(row);
            }

            Controls.Add(dgv);
        }
コード例 #13
0
        public void DoQuery()
        {
            AddSelect(ActiveQuery);
            if (Root == null)
            {
                MessageBox.Show("Please select a node to start the query at");
                return;
            }
            if (ActiveQuery == null || ActiveQuery == "")
            {
                MessageBox.Show("Please enter a query string");
                return;
            }
            List<IAttribute> results = new List<IAttribute>(5);

            Root.SimpleQuery(ActiveQuery, results, true);
            //{
            //     MessageBox.Show("Query failed\nPartial results displayed");
            //}
            dataGridView1.Rows.Clear();
            DataGridViewRow row;
            foreach (IAttribute entry in results)
            {
                row = new DataGridViewRow();
                row.CreateCells(dataGridView1, entry.Parent.Label, entry.Label, entry.Value);
                row.Tag = entry;
                Grid.Rows.Add(row);
            }
        }
コード例 #14
0
ファイル: canMessage.cs プロジェクト: Cougar/HomeAutomation
        public DataGridViewRow getDataGridViewRow(DataGridView dg, KeeperTracker mt)
        {
            DataGridViewRow row = new DataGridViewRow();
            row.CreateCells(dg);

            string dgIdentifier = this.ident.ToString("X").PadLeft(8, '0') + "h";
            string dgRemoteRequest = (this.remote_request?"Yes":"No");
            string dgLength = this.data_length.ToString();
            string dgData = byteArrayToHexString(this.data, this.data_length);
            string dgPeriod = mt.getPeriod(this).ToString();
            string dgCount = mt.getCount(this).ToString();
            string dgTime = mt.getTime(this).ToLongTimeString();

            ArrayList a = new ArrayList();
            a.Add(dgIdentifier);
            a.Add(dgRemoteRequest);
            a.Add(dgLength);
            a.Add(dgData);
            a.Add(dgPeriod);
            a.Add(dgCount);
            a.Add(dgTime);
            a.Add(this.ident);
            a.Add(this);
            row.SetValues(a.ToArray());

            return row;
        }
コード例 #15
0
        private void ReLoad()
        {
            dataGridView1.Rows.Clear();
            foreach (string each in classIDList)
            {
                //傳入 class類型 / classID系統編號
                //取得該班級的所有電子報表
                DSXmlHelper helper = QueryElectronicPaper.GetPaperItemByViewer("Class", each).GetContent();

                foreach (XmlElement paper in helper.GetElements("PaperItem"))
                {
                    DSXmlHelper paperHelper = new DSXmlHelper(paper);

                    DataGridViewRow row = new DataGridViewRow();
                    row.CreateCells(dataGridView1);

                    //儲存電子報表編號
                    row.Cells[0].Value = paperHelper.GetText("@ID");

                    //班級名稱
                    ClassRecord cr = K12.Data.Class.SelectByID(each);
                    row.Cells[1].Value = cr.Name;

                    //電子報表名稱
                    row.Cells[2].Value = paperHelper.GetText("PaperName");
                    //製表日期
                    row.Cells[3].Value = paperHelper.GetText("Timestamp");

                    dataGridView1.Rows.Add(row);
                }
            }
        }
コード例 #16
0
 internal ItemFactors(Class71 class71_1)
 {
     this.class71_0 = class71_1;
     this.InitializeComponent();
     if (class71_1.CustomItemFactors == null)
     {
         class71_1.CustomItemFactors = new Dictionary<D3Attribute, float>();
     }
     foreach (D3Attribute d3Attribute in Enum.GetValues(typeof(D3Attribute)))
     {
         DataGridViewRow dataGridViewRow = new DataGridViewRow();
         float num = 0f;
         if (!class71_1.CustomItemFactors.TryGetValue(d3Attribute, out num))
         {
             num = 0f;
         }
         dataGridViewRow.CreateCells(this.dataGridView1, new object[]
         {
             d3Attribute.ToString(),
             num
         });
         dataGridViewRow.Tag = d3Attribute;
         this.dataGridView1.Rows.Add(dataGridViewRow);
     }
     this.textBox1.Text = class71_1.CustomItemFactors_MinimumValue.ToString();
     this.textBox2.Text = class71_1.CustomItemFactors_MaximumValue.ToString();
 }
コード例 #17
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            DataGridViewRow newrow = new DataGridViewRow();
            newrow.CreateCells(dataGridView1);
            newrow.Cells[0].Value = eventstat.NrOfReg() +" Users";
            newrow.Cells[1].Value = eventstat.TickWithDiscount() * 45 + eventstat.TickWithoutDiscount() * 50 + " €";
            newrow.Cells[2].Value = eventstat.NrOfCampRented() + " rented camps";
            newrow.Cells[3].Value = eventstat.CampRev() + " €";
            newrow.Cells[4].Value = eventstat.FoodRev() + " €";
            newrow.Cells[5].Value = eventstat.LoanMatRev() + " €";
            newrow.Cells[6].Value = eventstat.TickWithDiscount() * 45 + eventstat.TickWithoutDiscount() * 50 + eventstat.CampRev() + eventstat.FoodRev() + eventstat.LoanMatRev() + " €";
            dataGridView1.Rows.Add(newrow);

            textBox2.Text = eventstat.NrOfReg().ToString(); textBox2.BackColor = Color.GreenYellow;// visitors expected
            textBox7.Text = Convert.ToString(eventstat.NrOfVisPresent()); textBox7.BackColor = Color.GreenYellow;// visitors presents
            textBox6.Text = (eventstat.NrOfReg() - eventstat.NrOfVisPresent()).ToString(); textBox6.BackColor = Color.GreenYellow;// visitors left
            textBox3.Text = eventstat.EvAccountBalance().ToString() + " €"; textBox3.BackColor = Color.GreenYellow;// event account balance
            textBox5.Text = Convert.ToString(150 - eventstat.NrOfCampRented()); textBox5.BackColor = Color.GreenYellow;// Number of free camping spots

            //textBox12.Text = eventstat.BBurgerSold().ToString(); textBox12.BackColor = Color.GreenYellow;// big burger sold
            //textBox11.Text = eventstat.CColaSold().ToString(); textBox11.BackColor = Color.GreenYellow;// coca cola sold
            //textBox9.Text = eventstat.ChickBurgerSold().ToString(); textBox9.BackColor = Color.GreenYellow;// chicken burger sold
            //textBox13.Text = eventstat.FFriesSold().ToString(); textBox13.BackColor = Color.GreenYellow;// french fries sold
            //textBox14.Text = eventstat.HBeerSold().ToString(); textBox14.BackColor = Color.GreenYellow;// Heinneken beer sold
            //textBox15.Text = eventstat.SaladSold().ToString(); textBox15.BackColor = Color.GreenYellow;// Salad sold
        }
コード例 #18
0
ファイル: frmViewInfo.cs プロジェクト: TeamGnome/SxSTools
        private void btnFile_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog ofd = new OpenFileDialog())
             {
            ofd.Filter = "Delta files|*.*";
            ofd.Multiselect = false;
            ofd.CheckFileExists = true;
            ofd.AddExtension = true;

            if (ofd.ShowDialog() == DialogResult.OK)
            {
               DeltaHeaderInfo dhi = DeltaAPI.GetDeltaInformation(ofd.FileName);

               gvInformation.Rows.Clear();

               Type typeData = typeof(DeltaHeaderInfo);
               foreach(var field in typeData.GetFields())
               {
                  DataGridViewRow row = new DataGridViewRow();
                  row.CreateCells(gvInformation);

                  row.Cells[0].Value = field.Name;
                  row.Cells[1].Value = field.GetValue(dhi).ToString();

                  gvInformation.Rows.Add(row);
               }
            }
             }
        }
コード例 #19
0
        private static void Find(object o)
        {
            try
            {
                Timer.Change(Timeout.Infinite, Timeout.Infinite);
                var data = SolicitudEntregaRepository.GetSolicitudesEntregadas();

                if (data.Any())
                {
                    var newData = data.ToList()
                        .Where(d =>Grid.Rows.Cast<DataGridViewRow>().All(r => !string.Equals(r.Cells[0].Value.ToString(), d.Id.ToString())))
                        .ToList();

                    newData.ToList().ForEach(d => Grid.Invoke(new Action(() =>
                    {                        
                        var row = new DataGridViewRow();
                        row.CreateCells(Grid);
                        row.Cells[0].Value = d.Id;
                        row.Cells[1].Value = d.StartAt;
                        row.Cells[2].Value = d.ProveedorRazonSocial;
                        row.Cells[3].Value = d.OrdenesDeCompra;
                        Grid.Rows.Insert(0,row);
                    })));



                    if (newData.Any())
                    {
                        Form.Invoke(new Action(() =>
                        {                            
                            Form.WindowState = FormWindowState.Minimized;
                            Form.WindowState = FormWindowState.Maximized; 

                            Form.Show();
                            Form.Focus();
                            Form.BringToFront();
                        }));

                        var first = newData.Last();

                        Label.Invoke(new Action(() =>
                        {
                            Label.Text = string.Format("Nro. Solicitud: {0} - Proveedor: {1}", first.Id, first.ProveedorRazonSocial);
                        }));

                        LabelAnimationManager.StartAnimation(Label);
                    }
                }

                Timer.Change(Period, Period);
            }
            catch (Exception ex)
            {
                Label.Invoke(new Action(() =>
                {
                    Label.Text = ex.Message;
                }));            
            }
        }
コード例 #20
0
 private void FillGridViewGradeYear()
 {
     foreach (int each in GroupGradeYear().Keys)
     {
         DataGridViewRow row = new DataGridViewRow();
         row.CreateCells(dgvTimes, each.ToString(), "", "");
         dgvTimes.Rows.Add(row);
     }
 }
コード例 #21
0
        private void AddPasswordType(PasswordType passwordType)
        {
            var item = new DataGridViewRow();
            item.CreateCells(dgvItems, passwordType.Name, passwordType.Fields.Count);
            item.Tag = passwordType;

            dgvItems.Rows.Add(item);
            item.Selected = true;
        }
コード例 #22
0
        private void AddField(Field field)
        {
            var item = new DataGridViewRow();
            item.CreateCells(dgvFields, field.Name, field.IsEncrypt);
            item.Tag = field;

            dgvFields.Rows.Add(item);
            item.Selected = true;
        }
コード例 #23
0
ファイル: Form1.cs プロジェクト: princehaku/BookLib
 //查询图书
 private void button1_Click(object sender, EventArgs e)
 {
     bookresult.Rows.Clear();
     if (textBox1.Text != "")
     {
         db.query("select from `book` where `id`='" + textBox1.Text + "'");
     }
     if (textBox2.Text != "")
     {
         db.query("select from `book` where `booktitle`='" + textBox2.Text + "'");
     }
     if (textBox3.Text != "")
     {
         db.query("select from `book` where `publisher`='" + textBox3.Text + "'");
     }
     if (textBox12.Text != "")
     {
         db.query("select from `book` where `writer`='" + textBox12.Text + "'");
     }
     if (textBox11.Text != "")
     {
         db.query("select from `book` where `type`='" + textBox11.Text + "'");
     }
     if (textBox18.Text != "")
     {
         int i = int.Parse(textBox18.Text) - 1;
         db.query("select from `book` where `id`>'" + i.ToString() + "'");
     }
     if (textBox19.Text != "")
     {
         int i = int.Parse(textBox19.Text) + 1;
         db.query("select from `book` where `id`<'" + i.ToString() + "'");
     }
     while (db.fetchline())
     {
         string id = db.get("id");
         string booktitle = db.get("booktitle");
         string description = db.get("description");
         string writer = db.get("writer");
         string publisher = db.get("publisher");
         string type = db.get("type");
         string store = db.get("store");
         string nums = db.get("nums");
         DataGridViewRow row = new DataGridViewRow();
         row.CreateCells(bookresult);
         row.Cells[0].Value = id;
         row.Cells[1].Value = booktitle;
         row.Cells[2].Value = description;
         row.Cells[3].Value = writer;
         row.Cells[4].Value = publisher;
         row.Cells[5].Value = type;
         row.Cells[6].Value = store;
         row.Cells[7].Value = nums;
         bookresult.Rows.Add(row);
     }
     bookresult.Visible = true;
 }
コード例 #24
0
 public void AddLexeme(string sHeadword, string sHash)
 {
     DataGridViewRow r = new DataGridViewRow();
     r.CreateCells(dataGridView);
     r.Cells[0].Value = true;
     r.Cells[1].Value = sHash;
     //            r.Cells[1].Tag = v;
     r.Cells[2].Value = sHeadword;
     dataGridView.Rows.Add(r);
 }
コード例 #25
0
ファイル: CommonUser.cs プロジェクト: xxxhycl2010/RBAC-1
        private void refreshActivateRoles()
        {
            this.checkedListBox_Roles.Items.Clear();
            this.listBox_Activating_Permissions.Items.Clear();

            LinkedList<string> DirectRole = Security_Officer.Get_User_Direct_Roles(GetUserName);//获取用户拥有 的所有角色
            while (DirectRole.Count != 0)
            {
                DataGridViewRow r = new DataGridViewRow();
                r.CreateCells(this.View_RolesData);
                r.Cells[0].Value = DirectRole.First.Value;

                LinkedList<string> DirectFatherRoles = Security_Officer.GetDirectFatherRoles(DirectRole.First.Value);
                LinkedList<string> FatherRoles = Security_Officer.GetFatherRoles(DirectRole.First.Value);

                LinkedList<string> DirectChildRoles = Security_Officer.GetDirectChildRoles(DirectRole.First.Value);
                LinkedList<string> ChildRoles = Security_Officer.GetChildRoles(DirectRole.First.Value);

                while (FatherRoles.Count != 0)
                {
                    if (DirectFatherRoles.Find(FatherRoles.First.Value) == null)
                    {
                        r.Cells[3].Value += FatherRoles.First.Value + " ";

                    }
                    FatherRoles.RemoveFirst();
                }

                while (ChildRoles.Count != 0)
                {
                    if (DirectChildRoles.Find(ChildRoles.First.Value) == null)
                    {
                        r.Cells[4].Value += ChildRoles.First.Value + " ";

                    }
                    ChildRoles.RemoveFirst();
                }
                while (DirectFatherRoles.Count != 0)
                {
                    r.Cells[1].Value += DirectFatherRoles.First.Value + " ";
                    DirectFatherRoles.RemoveFirst();

                }
                while (DirectChildRoles.Count != 0)
                {
                    r.Cells[2].Value += DirectChildRoles.First.Value + " ";
                    DirectChildRoles.RemoveFirst();
                }

                DirectRole.RemoveFirst();

                this.View_RolesData.Rows.Add(r);
            }
        }
コード例 #26
0
        public void receiveSms(string phoneNum, PDUData pduData)
        {
            DataGridViewRow d = new DataGridViewRow();
            d.CreateCells(dataGridView1, phoneNum, pduData.getOA(), pduData.getTimeStamp(), pduData.getMsg());
            dataGridView1.Rows.Insert(0,d);

            if (dataGridView1.Rows.Count - 1 > 5)
            {
                dataGridView1.Rows.RemoveAt(5);
            }
        }
コード例 #27
0
ファイル: Supplier.cs プロジェクト: kapa76/price_checker
        private void AddRow(Cell cell)
        {
            var val = new DataGridViewRow();

            val.CreateCells(grid, "cell1", "cell2", "cell3");
            val.Cells[0].Value = cell.Row.ToString();
            val.Cells[1].Value = cell.Col.ToString();
            val.Cells[2].Value = cell.Name;

            grid.Rows.Add(val);
        }
コード例 #28
0
ファイル: P2G.cs プロジェクト: C4Help/P2G_Crawler
        private void AddInvalidRow(DataGridViewRow dr)
        {
            DataGridViewCellStyle style = new DataGridViewCellStyle();
            style.BackColor = Color.Red;
            style.ForeColor = Color.Black;

            DataGridViewRow dgvr = new DataGridViewRow();
            dgvr.CreateCells(gridViewResults);
            dgvr.SetValues(new object[] {count, dr.Cells[1].Value, dr.Cells[2].Value, "Invalid" });
            dgvr.Cells[3].Style = style;
            gridViewResults.Rows.Add(dgvr);
        }
コード例 #29
0
        private void InitialReceives()
        {
            //progress update
            Receive<GithubProgressStats>(stats =>
            {
                //time to start animating the progress bar
                if (!_hasSetProgress && stats.ExpectedUsers > 0)
                {
                    _progressBar.Minimum = 0;
                    _progressBar.Step = 1;
                    _progressBar.Maximum = stats.ExpectedUsers;
                    _progressBar.Value = stats.UsersThusFar;
                    _progressBar.Visible = true;
                    _statusLabel.Visible = true;
                }

                _statusLabel.Text = string.Format("{0} out of {1} users ({2} failures) [{3} elapsed]",
                    stats.UsersThusFar, stats.ExpectedUsers, stats.QueryFailures, stats.Elapsed);
                _progressBar.Value = stats.UsersThusFar + stats.QueryFailures;
            });

            //user update
            Receive<IEnumerable<SimilarRepo>>(repos =>
            {
                foreach (var similarRepo in repos)
                {
                    var repo = similarRepo.Repo;
                    var row = new DataGridViewRow();
                    row.CreateCells(_userDg);
                    row.Cells[0].Value = repo.Owner.Login;
                    row.Cells[1].Value = repo.Name;
                    row.Cells[2].Value = repo.HtmlUrl;
                    row.Cells[3].Value = similarRepo.SharedStarrers;
                    row.Cells[4].Value = repo.SubscribersCount;
                    row.Cells[5].Value = repo.StargazersCount;
                    row.Cells[6].Value = repo.ForksCount;
                    _userDg.Rows.Add(row);
                }
            });

            //critical failure, like not being able to connect to Github
            Receive<GithubCoordinatorActor.JobFailed>(failed =>
            {
                _progressBar.Visible = true;
                _progressBar.ForeColor = Color.Red;
                _progressBar.Maximum = 1;
                _progressBar.Value = 1;
                _statusLabel.Visible = true;
                _statusLabel.Text = string.Format("Failed to gather data for Github repository {0} / {1}",
                    failed.Repo.Owner, failed.Repo.Repo);
            });
        }
コード例 #30
0
ファイル: FindFigure.cs プロジェクト: Temerin/AreaCalc
 private void buttonFind_Click(object sender, EventArgs e)
 {
     //FormFigure main = Owner as FormFigure;
     double findArea = 0;
     if (textBoxArea.Text != "")
     {
         findArea = Convert.ToDouble(textBoxArea.Text.Replace(".", ","));
     }
     if (FigureList != null) //если есть где искать
     {
         if (checkBoxCircle.Checked || checkBoxRectangle.Checked || checkBoxTriangle.Checked)
             //если выбран поиск по типу
         {
             foreach (var item in FigureList) //перебираем все объекты
             {
                 if ((item is Сircle) && (checkBoxCircle.Checked))
                 {
                     if ((item.Area == findArea) || (textBoxArea.Text == ""))
                     {
                         DataGridViewRow row = new DataGridViewRow();
                         row.CreateCells(dataGridView);
                         row.Cells[0].Value = "Круг";
                         row.Cells[1].Value = item.Area;
                         dataGridView.Rows.Add(row);
                     }
                 }
                 if ((item is AreaCalc.Rectangle) && (checkBoxRectangle.Checked))
                 {
                     if ((item.Area == findArea) || (textBoxArea.Text == ""))
                     {
                         DataGridViewRow row = new DataGridViewRow();
                         row.CreateCells(dataGridView);
                         row.Cells[0].Value = "Прямоугольник";
                         row.Cells[1].Value = item.Area;
                         dataGridView.Rows.Add(row);
                     }
                 }
                 if ((item is Triangle) && (checkBoxTriangle.Checked))
                 {
                     if ((item.Area == findArea) || (textBoxArea.Text == ""))
                     {
                         DataGridViewRow row = new DataGridViewRow();
                         row.CreateCells(dataGridView);
                         row.Cells[0].Value = "Треугольник";
                         row.Cells[1].Value = item.Area;
                         dataGridView.Rows.Add(row);
                     }
                 }
             }
         }
     }
 }
コード例 #31
0
 private void dgv_syain_MouseDown(object sender, MouseEventArgs e)
 {
     //編集モードになっていない場合は、ドラッグ&ドロップを許可しない
     if (w_hensyu_flg == 0)
     {
         return;
     }
     //マウスの左ボタンが押されている場合
     if (e.Button == MouseButtons.Left)
     {
         //MouseDownイベント発生時のX,Y座標を取得
         DataGridView.HitTestInfo hit = dgv_syain.HitTest(e.X, e.Y);
         //複写元となる行データ
         System.Windows.Forms.DataGridViewRow SourceRow;
         //ドラッグ元としての指定位置が有効なセル上を選択している場合
         if (hit.Type == DataGridViewHitTestType.Cell && (dgv_syain.NewRowIndex == -1 || dgv_syain.NewRowIndex != hit.RowIndex))
         {
             //複写元となる行データ
             SourceRow = dgv_syain.Rows[hit.RowIndex];
             //該当行を選択状態にする
             dgv_syain.Rows[hit.RowIndex].Selected = true;
         }
         //ドラッグ元の指定位置が有効なセル上を選択していない場合
         else
         {
             //指定行はドラッグ&ドロップの対象ではないので処理を終了
             return;
         }
         //ドロップ先に送る行データの作成
         //複写先となる行用オブジェクトを作成
         System.Windows.Forms.DataGridViewRow DestinationRow;
         DestinationRow = new System.Windows.Forms.DataGridViewRow();
         DestinationRow.CreateCells(dgv_kintai);  // 複写先DataGridViewを指定
         //受け渡すrowdデータにデータをセット
         DestinationRow.Cells[0].Value = SourceRow.Cells["syain_cd"].Value;
         DestinationRow.Cells[1].Value = SourceRow.Cells["syain_name"].Value;
         //ドラッグ&ドロップを開始
         //ドラッグソースのデータは行データDestinationRowとする
         //また、ドラッグソースのデータはドロップ先に複写する
         DoDragDrop(DestinationRow, DragDropEffects.Copy);
     }
 }