当前位置: 首页>>代码示例>>C#>>正文


C# ListViewItem.Remove方法代码示例

本文整理汇总了C#中System.Windows.Forms.ListViewItem.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# ListViewItem.Remove方法的具体用法?C# ListViewItem.Remove怎么用?C# ListViewItem.Remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.ListViewItem的用法示例。


在下文中一共展示了ListViewItem.Remove方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RemoveItem

        private void RemoveItem(ListViewItem selectedItem)
        {
            var index = selectedItem.Index;
            selectedItem.Remove();
            if (index < listViewChain.Items.Count)
            {
                listViewChain.Items[index].Selected = true;
            }
            else if (listViewChain.Items.Count > 0)
            {
                listViewChain.Items[listViewChain.Items.Count - 1].Selected = true;
            }

            ResizeLists();
            UpdateButtons();
        }
开发者ID:Xuno,项目名称:MPDN_Extensions,代码行数:16,代码来源:RenderChainList.cs

示例2: DeleteMail

 void DeleteMail(ListViewItem item)
 {
     if (mailView.InvokeRequired)
     {
         mailView.Invoke(new DeleteMailsDelegate(DeleteMail), new object[] { item });
     }
     else
     {
         item.Remove();
     }
 }
开发者ID:ComputerSimp,项目名称:MailClient,代码行数:11,代码来源:MailClient.cs

示例3: UpdateFileListItem

        public void UpdateFileListItem(AccountFileStates newFileState, ListViewItem fileItem)
        {
            if ((newFileState & AccountFileStates.Deleted) != 0)
            {
                fileItem.Remove();
                return;
            }
            if ((newFileState & AccountFileStates.New) != 0)
            {
                fileItem.ForeColor = Color.Blue;
            }
            if ((newFileState & AccountFileStates.UnsyncronizedWithAllDrives) != 0)
            {
                fileItem.ForeColor = Color.Red;
            }
            if ((newFileState & AccountFileStates.UnsyncronizedWithStorage) != 0)
            {
                fileItem.Font = UnsyncronizedFileItemFont;
            }
            if ((newFileState & AccountFileStates.SyncronizedWithDrive) != 0)
            {
                fileItem.ForeColor = SystemColors.ControlText;
            }
            if ((newFileState & AccountFileStates.SyncronizedWithStorage) != 0)
            {
                fileItem.Font = Font;
            }
            if ((newFileState & AccountFileStates.Error) != 0)
            {
                fileItem.BackColor = Color.Red;
                fileItem.ForeColor = Color.White;
            }
            
            if ((newFileState & AccountFileStates.PlacedOnlyDrive) != 0)
            {
                fileItem.BackColor = Color.LightGreen;
            }

            if ((newFileState & AccountFileStates.PlacedOnlyStorage) != 0)
            {
                fileItem.ForeColor = Color.Green;
            }
        }
开发者ID:fiftin,项目名称:oblqo,代码行数:43,代码来源:FIleList.cs

示例4: removeItem

 private void removeItem(ListViewItem li)
 {
     if (lstSchedule.InvokeRequired)
     {
         lstSchedule.Invoke(new intFunctionDelegateList(removeItem), li);
         return;
     }
     if (li.Text.ToLower() == "wake up from sleep")
     {
         ((WakeUP)li.Tag).CancelWakeUp();
     }
     else
     {
         ((System.Threading.Timer)li.Tag).Dispose();
     }
     li.Remove();
 }
开发者ID:valtzu,项目名称:kake,代码行数:17,代码来源:Form1.cs

示例5: RemoveActiveScript

 public void RemoveActiveScript(ListViewItem lvw)
 {
     if (this.InvokeRequired)
     {
         MethodInvoker del = delegate
         {
             RemoveActiveScript(lvw);
         };
         this.Invoke(del);
     }
     else
     {
         if (lvw != null)
         {
             lvw.Remove();
             tbpScripts.Text = StringValue.ActiveScripts + " (" + lvwActiveScripts.Items.Count.ToString() + ")";
         }
     }
 }
开发者ID:x0x029a,项目名称:PoshSecFramework,代码行数:19,代码来源:frmMain.cs

示例6: updateListViewItem

 private void updateListViewItem(ListViewItem lvi)
 {
     iFolderObject ifolderObject = (iFolderObject)lvi.Tag;
        iFolderWeb ifolder = ifolderObject.iFolderWeb;
        if (ifolder.State.Equals("Available") &&
     (ifWebService.GetiFolder(ifolder.CollectionID) != null))
        {
     lock (ht)
     {
      ht.Remove(ifolder.ID);
     }
     lvi.Remove();
        }
        else
        {
     int imageIndex;
     lvi.SubItems[0].Text = ifolder.Name;
     lvi.SubItems[1].Text = ifolder.IsSubscription ? "" : ifolder.UnManagedPath;
     lvi.SubItems[2].Text = stateToString(ifolderObject, out imageIndex);
     lvi.ImageIndex = imageIndex;
     if (lvi.Selected && (iFolderView.SelectedItems.Count == 1))
     {
      updateMenus(ifolder);
     }
        }
 }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:26,代码来源:GlobalProperties.cs

示例7: AddControloAut

		private void AddControloAut(object Sender, ListViewItem ListViewItem)
		{
			GISADataset.IndexFRDCARow IndexFRDCARow = null;
			IndexFRDCARow = (GISADataset.IndexFRDCARow)ListViewItem.Tag;
			if (ListViewItem.ListView == lstVwSubTipoInformacional)
				IndexFRDCARow.Selector = 1;
            else if (ListViewItem.ListView == lstVwTipoInformacional)
                IndexFRDCARow.Selector = -1;

			ListViewItem.SubItems.Add(TranslationHelper.FormatBoolean(IndexFRDCARow.ControloAutRow.Autorizado));
			ListViewItem.SubItems.Add(TranslationHelper.FormatBoolean(IndexFRDCARow.ControloAutRow.Completo));

			// se se tratar de uma tipologia informacional garantir que existe apenas um item
            if (ListViewItem.ListView == lstVwTipoInformacional) {

                if (lstVwTipoInformacional.Items.Count > 1) {
                    GISADataset.IndexFRDCARow idxCARow = null;
                    switch (MessageBox.Show("Não pode existir mais que uma tipologia informacional. Deseja substituir a existente?", "Tipologia informacional", MessageBoxButtons.OKCancel, MessageBoxIcon.Question)) {
                        case DialogResult.OK:
                            // eliminar todos as tipologias informacionais excepto a que acaba de ser adicionada
                            foreach (ListViewItem item in lstVwTipoInformacional.Items) {
                                if (!(item == ListViewItem)) {
                                    idxCARow = (GISADataset.IndexFRDCARow)item.Tag;
                                    item.Remove();
                                    idxCARow.Delete();
                                }
                            }
                            break;
                        case DialogResult.Cancel:
                            // eliminar a tipologia informacional que acaba de ser adicionada
                            idxCARow = (GISADataset.IndexFRDCARow)ListViewItem.Tag;
                            ListViewItem.Remove();
                            idxCARow.Delete();
                            break;
                    }
                }

                // Mandar actualizar o PanelConteudoInformacional
                this.TheGenericDelegate.Invoke();
            }
		}
开发者ID:aureliopires,项目名称:gisa,代码行数:41,代码来源:PanelAmbitoConteudo.cs

示例8: RemoveListViewItem

 private void RemoveListViewItem(ListViewItem listViewItem) {
   if (listViewItem == null) throw new ArgumentNullException();
   IRun run = listViewItem.Tag as IRun;
   if (run != null) {
     itemListViewItemMapping[run].Remove(listViewItem);
     if (itemListViewItemMapping[run].Count == 0) {
       DeregisterItemEvents(run);
       itemListViewItemMapping.Remove(run);
     }
   }
   listViewItem.Remove();
 }
开发者ID:t-h-e,项目名称:HeuristicLab,代码行数:12,代码来源:RunCollectionView.cs

示例9: DisplayOutput

 public void DisplayOutput(String output, ListViewItem lvw, bool clicked, bool cancelled = false)
 {
     if (this.InvokeRequired)
     {
         MethodInvoker del = delegate
         {
             DisplayOutput(output, lvw, clicked, cancelled);
         };
         this.Invoke(del);
     }
     else
     {
         if ((txtPShellOutput.Text.Length + output.Length + (Environment.NewLine + "psf > ").Length) > txtPShellOutput.MaxLength)
         {
             txtPShellOutput.Text = txtPShellOutput.Text.Substring(output.Length + 500, txtPShellOutput.Text.Length - (output.Length + 500));
         }
         txtPShellOutput.AppendText(output);
         txtPShellOutput.AppendText(Environment.NewLine + "psf > ");
         mincurpos = txtPShellOutput.Text.Length;
         txtPShellOutput.SelectionStart = mincurpos;
         if (clicked || cancelled)
         {
             //Not sure why this happens, but if you type the command the scroll to caret isn't needed.
             //If you initiate a script or command by double clicking, or you abort the thread, you do.
             txtPShellOutput.ScrollToCaret();
         }
         txtPShellOutput.ReadOnly = false;
         if (lvw != null)
         {
             lvw.Remove();
             tbpScripts.Text = "Active Scripts (" + lvwActiveScripts.Items.Count.ToString() + ")";
         }
     }
 }
开发者ID:rjcassara,项目名称:PoshSecFramework,代码行数:34,代码来源:frmMain.cs

示例10: Trocar

		private void Trocar(ListViewItem pri, ListViewItem seg)
		{
			lock (this)
			{
				int i = pri.Index;

				pri.Remove();
				seg.Remove();

				lstFuncionários.Items.Insert(i - 1, pri);
				lstFuncionários.Items.Insert(i, seg);
			}		
		}
开发者ID:andrepontesmelo,项目名称:imjoias,代码行数:13,代码来源:RodízioPropriedades.cs

示例11: remove

 private void remove(ListViewItem i)
 {
     if (lvPC.SelectedItems.Count > 0)
     {
         try
         {
             string nome, endereco;
             nome = i.SubItems[0].Text;
             endereco = i.SubItems[1].Text;
             i.Remove();
             log("Removido PC " + nome + " - " + endereco + " à lista de execução em lotes.");
             //savelist();
         }
         catch (Exception ex)
         {
             log("Exception encontrada: " + ex.Message);
         }
     }
     else
     {
         MessageBox.Show("ERRO: Selecione um item para ser excluido!");
     }
 }
开发者ID:gabrielsolucoesvip,项目名称:atualizador,代码行数:23,代码来源:Atualizador.cs

示例12: listViewFormats_KeyDown

		private void listViewFormats_KeyDown(object sender, KeyEventArgs e)
		{
			switch (e.KeyCode)
			{
				case Keys.Insert:
					{
						CUEToolsFormat format;
						if (_config.formats.TryGetValue("new", out format))
							return;
						format = new CUEToolsFormat("new", CUEToolsTagger.TagLibSharp, true, true, false, false, false, null, null, null);
						_config.formats.Add("new", format);
						ListViewItem item = new ListViewItem(format.extension, "." + format.extension);
						item.Tag = format;
						listViewFormats.Items.Add(item);
						comboBoxEncoderExtension.Items.Add(format.extension);
						comboBoxDecoderExtension.Items.Add(format.extension);
						item.BeginEdit();
						break;
					}
				case Keys.Delete:
					{
						if (listViewFormats.SelectedItems.Count <= 0)
							return;
						CUEToolsFormat format = (CUEToolsFormat)listViewFormats.SelectedItems[0].Tag;
						if (format.builtin)
						    return;
						List<string> decodersToRemove = new List<string>();
						foreach (KeyValuePair<string, CUEToolsUDC> decoder in _config.decoders)
							if (decoder.Value.extension == format.extension)
								decodersToRemove.Add(decoder.Key);
						foreach (string decoder in decodersToRemove)
						{
							_config.decoders.Remove(decoder);
							foreach (ListViewItem item in listViewDecoders.Items)
								if (item.Text == decoder)
								{
									item.Remove();
									break;
								}
						}
						List<string> encodersToRemove = new List<string>();
						foreach (CUEToolsUDC encoder in _config.encoders)
							if (encoder.extension == format.extension)
								encodersToRemove.Add(encoder.name);
						foreach (string encoder in encodersToRemove)
							_config.encoders.Remove(_config.encoders[encoder]);
						comboBoxEncoderExtension.Items.Remove(format.extension);
						comboBoxDecoderExtension.Items.Remove(format.extension);
						_config.formats.Remove(format.extension);
						listViewFormats.SelectedItems[0].Remove();
						break;
					}
			}
		}
开发者ID:androidhacker,项目名称:DotNetProjs,代码行数:54,代码来源:frmSettings.cs

示例13: removeAttendee

        // Remove selected item
        private void removeAttendee(ListViewItem lvi)
        {
            int guestID = Convert.ToInt32(lvi.SubItems[2].Text);
            lvi.Remove();

            // find row in Datatable using GUEST_ID
            DataRow[] removeRow = AttendeeDT.Select("GUEST_ID = " + guestID.ToString());
            if (removeRow.Length > 0)
            {
                int SelectedIndex = AttendeeDT.Rows.IndexOf(removeRow[0]);
                AttendeeDT.Rows.RemoveAt(SelectedIndex);
                updateGuestCount();
            }

            CheckGuestCount();
        }
开发者ID:SmashInc,项目名称:Efficienseat,代码行数:17,代码来源:Attendee_List.cs

示例14: updateFilterForUnbudgetingPart

 /// <summary>
 /// If the list view is filtered to display only budgeted part, in case the user un-budget a part
 /// (i.e. delete its budget), we need to make it disapear from the list of item and place it in the
 /// not budgeted part temporary list
 /// </summary>
 /// <param name="unbudgetedItem">The item whose budget was removed</param>
 private void updateFilterForUnbudgetingPart(ListViewItem unbudgetedItem)
 {
     if (Budget.Budget.Instance.ShouldShowOnlyBudgetedParts)
     {
         // search in the item list and in the filtered list (but this last case should never happe
         // as the item must be in the list to be un-bugeted, otherwise the user cannot edit its buget)
         if (this.Items.Contains(unbudgetedItem))
         {
             unbudgetedItem.Remove();
             // then add it to the list of unbugeted items
             mNotBudgetedItems.Add(unbudgetedItem);
         }
         else if (this.mFilteredItems.Contains(unbudgetedItem))
         {
             this.mFilteredItems.Remove(unbudgetedItem);
             // then add it to the list of unbugeted items
             mNotBudgetedItems.Add(unbudgetedItem);
         }
     }
 }
开发者ID:henrihs,项目名称:bluebrick-id-fork,代码行数:26,代码来源:PartListView.cs


注:本文中的System.Windows.Forms.ListViewItem.Remove方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。