예제 #1
0
 private void listView1_SelectedIndexChanged(object sender, EventArgs e)
 {
     foreach (ListViewItem item in listView1.SelectedItems)
     {
         ListViewSubItemCollection subItem = item.SubItems;
     }
 }
예제 #2
0
 public void AddRange(ListViewSubItemCollection items)
 {
     foreach (ListViewSubItem item in items)
     {
         this.Add(item);
     }
 }
예제 #3
0
        private void searchRegionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ListViewSubItemCollection items = listViewRanges.SelectedItems[0].SubItems;

            textBoxFrom.Text = "0x" + items[0].Text.TrimStart(new char[] { '0' });
            textBoxTo.Text   = "0x" + items[1].Text.TrimStart(new char[] { '0' });
        }
예제 #4
0
 private void listView1_SelectedIndexChanged(object sender, EventArgs e)
 {
     foreach (ListViewItem item in listView1.SelectedItems)
     {
         ListViewSubItemCollection subItem = item.SubItems;
         label1.Text = $"{item.Text}의 국가 번호는 {subItem[1].Text}";
     }
 }
예제 #5
0
 public ListViewItem(string[] items)
 {
     this.subItems = new ListViewSubItemCollection(this);
     if (items.Length > 0)
     {
         subItems.AddRange(items);
     }
 }
 public ListViewItem(string[] items)
 {
     this.subItems = new ListViewSubItemCollection(this);
     if (items.Length > 0)
     {
         subItems.AddRange(items);
     }
 }
예제 #7
0
 public ListViewItem(ListView owner)
 {
     _owner                 = owner;
     _subItems              = new ListViewSubItemCollection(this);
     _font                  = _owner.Font;
     _subItems.AfterClear  += _subItems_AfterClear;
     _subItems.AfterInsert += _subItems_AfterInsert;
     _subItems.AfterRemove += _subItems_AfterRemove;
     _subItems.AfterSet    += _subItems_AfterSet;
 }
예제 #8
0
 public ListViewItem()
 {
     listViewSubItemCollection = null;
     index      = -1;
     imageIndex = -1;
     selected   = false;
     useItemStyleForSubItems = true;
     imageIndex    = -1;
     subItemsCount = 0;
 }
예제 #9
0
 private void ShowSubBtn_Click(object sender, EventArgs e)
 {
     SubListBox.Items.Clear();
     for (int i = 0; i < listView1.SelectedItems.Count; i++)
     {
         ListViewSubItemCollection subItems = listView1.SelectedItems[i].SubItems;
         Worker cw = CasheAllWorkerHelper.GetInstance()
                     .GetWorkerByID(int.Parse(subItems[0].Text));
         if (cw.Subbordinate != null)
         {
             SubListBox.Items.Add("-----------" + cw.Name + "-----------");
             for (int j = 0; j < cw.GetCountAllSubordinate(); j++)
             {
                 SubListBox.Items.Add(cw.Subbordinate[j].Name);
             }
         }
     }
 }
예제 #10
0
        private void UpdateWorkerData(ListViewSubItemCollection subItems, ProgressBar responsivenessProgressBar, IFlooder flooder)
        {
            const int StatusIndex         = 1;
            const int RequestedIndex      = 2;
            const int DownloadedIndex     = 3;
            const int FailedIndex         = 4;
            const int ResponsivenessIndex = 5;

            var elapsed = flooder.Clock.Elapsed;
            //var totalMilliseconds = elapsed.TotalMilliseconds;
            var totalSeconds = elapsed.TotalSeconds;

            //
            // Time Progress
            {
                responsivenessProgressBar.Maximum = (int)flooder.Settings.Timeout.TotalSeconds;
                if (totalSeconds > responsivenessProgressBar.Maximum)
                {
                    responsivenessProgressBar.Value = responsivenessProgressBar.Maximum;
                }
                else
                {
                    responsivenessProgressBar.Value = (int)totalSeconds;
                }
            }
            //

            //
            // Responsiveness
            {
                subItems[ResponsivenessIndex].Text = Format.Time(elapsed);
            }
            //

            //
            // State
            {
                subItems[StatusIndex].Text     = flooder.State.Status.ToString();
                subItems[RequestedIndex].Text  = Format.Size(flooder.State.Requested).ToString();
                subItems[DownloadedIndex].Text = Format.Size(flooder.State.Downloaded).ToString();
                subItems[FailedIndex].Text     = Format.Size(flooder.State.Failed).ToString();
            }
            //
        }
예제 #11
0
        public void UpdateProxies(ProxyTesterState state)
        {
            if (state == null)
            {
                throw new ArgumentNullException(nameof(state));
            }

            ListViewItem item = listViewProxies.Items[0];
            ListViewSubItemCollection subItems = item.SubItems;

            listViewProxies.BeginUpdate();

            subItems[1].Text = state.Total.ToString();
            subItems[2].Text = state.Types.ToString();
            subItems[3].Text = state.Testing.ToString();
            subItems[4].Text = state.Tested.ToString();
            subItems[5].Text = state.Failed.ToString();
            subItems[6].Text = state.Available.ToString();

            listViewProxies.EndUpdate();
        }
예제 #12
0
 private void CalculateSalaryBtn_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < listView1.SelectedItems.Count; i++)
     {
         ListViewSubItemCollection subItems = listView1.SelectedItems[i].SubItems;
         var cw = CasheAllWorkerHelper.GetInstance()
                  .GetWorkerByID(int.Parse(subItems[0].Text));
         //Worker cw = group.CurrentGroup.Equals(Worker.Group.Employee) ? (Employee)group
         //    : (group.CurrentGroup.Equals(Worker.Group.Manager)) ? (Manager)group
         //    : (group.CurrentGroup.Equals(Worker.Group.Salesman)) ? (Salesman)group : group;
         float salary = cw.GetPayroll(DateTime.Parse(dateTimePicker1.Value.Date.ToShortDateString()),
                                      (DateTime.Parse(dateTimePicker2.Value.Date.ToShortDateString())));
         if (salary == 0)
         {
             subItems[4].Text = "ERROR DATE";
         }
         else
         {
             subItems[4].Text = salary.ToString();
         }
     }
 }
예제 #13
0
        private void AddOrUpdateToListViewContent(string path, int?forceIndex = null)
        {
            ListViewItem currentListViewItem;

            if (forceIndex.HasValue && listViewPaths.Items.Count > 0)
            {
                currentListViewItem = listViewPaths.Items[forceIndex.Value];
            }
            else
            {
                currentListViewItem = listViewPaths.Items.Cast <ListViewItem>()
                                      .FirstOrDefault(w => w.Text == path);
            }

            var listViewItemExists = null != currentListViewItem;

            listViewPaths.BeginUpdate();

            if (!listViewItemExists)
            {
                var item = new ListViewItem(path);
                var data = new[] {
                    "0",
                    "0",
                };

                item.SubItems.AddRange(data);
                listViewPaths.Items.Add(item);
            }
            else
            {
                ListViewSubItemCollection subItems = currentListViewItem.SubItems;

                subItems[0].Text = path;
            }

            listViewPaths.EndUpdate();
        }
예제 #14
0
        public void UpdateAttacks(AttackState state)
        {
            if (state == null)
            {
                throw new ArgumentNullException(nameof(state));
            }

            ListViewItem item = listViewAttacks.Items[0];
            ListViewSubItemCollection subItems = item.SubItems;

            listViewAttacks.BeginUpdate();

            subItems[0].Text = state.Idle.ToString();
            subItems[1].Text = state.Connecting.ToString();
            subItems[2].Text = state.Requesting.ToString();
            subItems[3].Text = state.Downloading.ToString();
            subItems[4].Text = state.Downloaded.ToString();
            subItems[5].Text = state.Requested.ToString();
            subItems[6].Text = state.Failed.ToString();
            subItems[7].Text = Format.Time(state.AverageResponseTime);

            listViewAttacks.EndUpdate();
        }
예제 #15
0
 public ListViewItem()
 {
     this.subItems = new ListViewSubItemCollection(this);
     this.subItems.Add("");
 }
예제 #16
0
		public ListViewItem (string text, int imageIndex)
		{
			this.image_index = imageIndex;
			this.sub_items = new ListViewSubItemCollection (this, text);
		}
예제 #17
0
		public ListViewItem (string [] items, int imageIndex)
		{
			this.sub_items = new ListViewSubItemCollection (this, null);
			if (items != null) {
				for (int i = 0; i < items.Length; i++)
					sub_items.Add (new ListViewSubItem (this, items [i]));
			}
			this.image_index = imageIndex;
		}
 public ListViewItem(string text)
 {
     this.subItems = new ListViewSubItemCollection(this);
     this.subItems.Add("");
     this.Text = text;
 }
 public ListViewItem()
 {
     this.subItems = new ListViewSubItemCollection(this);
     this.subItems.Add("");
 }
예제 #20
0
		public ListViewItem(ListViewSubItem[] subItems, string imageKey)
		{
			this.sub_items = new ListViewSubItemCollection (this, null);
			for (int i = 0; i < subItems.Length; i++)
				this.sub_items.Add (subItems [i]);
			this.ImageKey = imageKey;
		}
예제 #21
0
		protected virtual void Deserialize (SerializationInfo info, StreamingContext context)
		{
			sub_items = new ListViewSubItemCollection (this, null);
			int sub_items_count = 0;

			foreach (SerializationEntry entry in info) {
				switch (entry.Name) {
					case "Text":
						sub_items.Add ((string)entry.Value);
						break;
					case "Font":
						font = (Font)entry.Value;
						break;
					case "Checked":
						is_checked = (bool)entry.Value;
						break;
					case "ImageIndex":
						image_index = (int)entry.Value;
						break;
					case "StateImageIndex":
						state_image_index = (int)entry.Value;
						break;
					case "UseItemStyleForSubItems":
						use_item_style = (bool)entry.Value;
						break;
					case "SubItemCount":
						sub_items_count = (int)entry.Value;
						break;
					case "Group":
						group = (ListViewGroup)entry.Value;
						break;
					case "ImageKey":
						if (image_index == -1)
							image_key = (string)entry.Value;
						break;
				}
			}

			Type subitem_type = typeof (ListViewSubItem);
			if (sub_items_count > 0) {
				sub_items.Clear (); // .net fixup
				Text = info.GetString ("Text");
				for (int i = 0; i < sub_items_count - 1; i++)
					sub_items.Add ((ListViewSubItem)info.GetValue ("SubItem" + (i + 1), subitem_type));
			}

			// After any sub item has been added.
			ForeColor = (Color)info.GetValue ("ForeColor", typeof (Color));
			BackColor = (Color)info.GetValue ("BackColor", typeof (Color));
		}
예제 #22
0
 public ListViewItem(string text)
 {
     this.subItems = new ListViewSubItemCollection(this);
     this.subItems.Add("");
     this.Text = text;
 }
예제 #23
0
		public ListViewItem (ListViewItem.ListViewSubItem [] subItems, int imageIndex)
		{
			this.sub_items = new ListViewSubItemCollection (this, null);
			for (int i = 0; i < subItems.Length; i++)
				sub_items.Add (subItems [i]);
			this.image_index = imageIndex;
		}
예제 #24
0
		public ListViewItem()
		{
			listViewSubItemCollection = null;
			index = -1;
			imageIndex = -1;
			selected = false;
			useItemStyleForSubItems = true;
			imageIndex = -1;
			subItemsCount = 0;
		}