本文整理汇总了C#中System.Windows.Forms.ListViewItem.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# ListViewItem.Clone方法的具体用法?C# ListViewItem.Clone怎么用?C# ListViewItem.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.ListViewItem
的用法示例。
在下文中一共展示了ListViewItem.Clone方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: copy_listview
private void copy_listview(ListView seme)
{
for (int icnt = 0; icnt < seme.Items.Count; icnt++)
{
ListViewItem items = new ListViewItem();
items = seme.Items[icnt];
reg_goods_list.Items.Insert(icnt, (ListViewItem)items.Clone());
}
}
示例2: AddListViewItem
private void AddListViewItem()
{
foreach (GeoPolygonRegion region in this.m_PolyRegionList)
{
ListViewItem item = new ListViewItem(region.Name);
item.Tag = region.ID;
this.ltvPolygon.Items.Add(item);
this.ltvPolygon2.Items.Add((ListViewItem) item.Clone());
}
}
示例3: FillEnumLists
void FillEnumLists() {
foreach( Permission permission in Enum.GetValues( typeof( Permission ) ) ) {
ListViewItem item = new ListViewItem( permission.ToString() ) { Tag = permission };
vPermissions.Items.Add( item );
}
foreach( LogType type in Enum.GetValues( typeof( LogType ) ) ) {
if( type == LogType.Trace ) continue;
ListViewItem item = new ListViewItem( type.ToString() ) { Tag = type };
vLogFileOptions.Items.Add( item );
vConsoleOptions.Items.Add( (ListViewItem)item.Clone() );
}
}
示例4: FillOptionList
void FillOptionList() {
foreach( Permission permission in Enum.GetValues( typeof( Permission ) ) ) {
ListViewItem item = new ListViewItem( permission.ToString() );
item.Tag = permission;
vPermissions.Items.Add( item );
}
foreach( LogType type in Enum.GetValues( typeof( LogType ) ) ) {
ListViewItem item = new ListViewItem( type.ToString() );
item.Tag = type;
vLogFileOptions.Items.Add( item );
vConsoleOptions.Items.Add( (ListViewItem)item.Clone() );
}
}
示例5: SetModuleList
/// <summary>
/// Sets the modules list.
/// </summary>
/// <param name="modules">The modules.</param>
/// <remarks>Documented by Dev05, 2009-06-26</remarks>
public void SetModuleList(List<ModuleInfo> modules)
{
ModuleBaseList = modules;
foreach (ModuleInfo info in modules)
{
ListViewItem item = new ListViewItem(Group);
while (item.SubItems.Count < 6) item.SubItems.Add(new ListViewItem.ListViewSubItem());
item.SubItems[0].Text = info.Title;
item.SubItems[1].Text = info.Author;
item.SubItems[2].Text = Categories.Find(c => c.Id == Convert.ToInt32(info.Categories[0])).Title;
item.SubItems[3].Text = info.Cards.ToString();
item.SubItems[4].Text = Methods.GetFileSize(info.Size);
item.Tag = info;
item.ImageIndex = 0;
OwnModules.Add(item);
foreach (string catString in info.Categories.ToArray())
{
int cat = Convert.ToInt32(catString);
if (mainNode.CategoryNodes.ContainsKey(cat))
{
ListViewItem cloneItem = item.Clone() as ListViewItem;
cloneItem.SubItems[2].Text = Categories.Find(c => c.Id == cat).Title;
mainNode.CategoryNodes[cat].OwnSubCategoryModules.Add(cloneItem);
}
}
}
}
示例6: bttn_AddtoDownloads_Click
}//add to DL's
private void bttn_AddtoDownloads_Click(object sender, EventArgs e)
{
int i = 0;
ATorrent DLList = new ATorrent();
DLList.Torrents = new ATorrent[100];
foreach (ListViewItem li in lstv_Downloads.Items)
{
ATorrent t = new ATorrent(li.Text);
t.Seeders = Int32.Parse(li.SubItems[1].Text);
t.FileSize = li.SubItems[2].Text;
t.Quality = li.SubItems[3].Text;
t.DaysOld = li.SubItems[4].Text;
t.Language = li.SubItems[5].Text;
t.Link = li.SubItems[6].Text;
DLList.Torrents[i] = t;
i++;
}
ListViewItem item = new ListViewItem();
if (lstv_SearchResults.SelectedItems.Count > 0)
item = lstv_SearchResults.SelectedItems[0];
else
item = lstv_SearchResults.Items[0];
ATorrent ms = new ATorrent(item.Text);
ms.Link = item.SubItems[6].Text;
if (item.Text.IndexOf("No Results Found!") == -1)
{
if (DLList.ExactMatch(ms) == 9999)
lstv_Downloads.Items.Add((ListViewItem)item.Clone());
else lblSearch.Text = "Show is already on the DLList!";
}
}
示例7: AddMessageBrowsingColumn
private void AddMessageBrowsingColumn(ListViewItem addItem)
{
ListViewItem selectedDuplicateItem = (ListViewItem)addItem.Clone();
addItem.Tag = selectedDuplicateItem;
selectedDuplicateItem.Tag = addItem;
messageBrowsingColumnsSelectedListView.Items.Add(selectedDuplicateItem);
addItem.Checked = true;
selectedDuplicateItem.Checked = true;
}
示例8: AddMediaField
/// <summary>
/// Adds a media field to the playback sequence listview.
/// </summary>
/// <param name="item">The item.</param>
/// <remarks>Documented by Dev02, 2008-03-30</remarks>
private void AddMediaField(ListViewItem item)
{
item = (ListViewItem)item.Clone();
MediaField mediafield = item.Tag as MediaField;
if (mediafield != null && mediafield.Type == MediaField.TypeEnum.Silence && mediafield.SilenceDuration == 0)
{
//ask the user to enter the desired duration of the silence
mediafield = InputSilenceLength(mediafield);
if (mediafield.SilenceDuration == 0)
return;
else
{
item.Tag = mediafield;
item.Text = mediafield.ToString();
}
}
listViewPlaybackSequence.Items.Add(item);
}
示例9: Core_onPlayerJoinedChannel
void Core_onPlayerJoinedChannel(object sender, PlayerJoinedChannelEventArgs e)
{
ListViewItem user = new ListViewItem(e.User.Username);
user.Tag = e.User.UserID;
if (Convert.ToBoolean(e.User.Flags & HoNClient.USER_FLAG_S2))
{
switch (e.User.Status)
{
case HoNClient.USER_STATUS_ONLINE:
user.Font = new Font("Arial", 8.25F, FontStyle.Bold);
user.ForeColor = Color.FromArgb(253, 0, 0);
user.ImageIndex = 4;
break;
case HoNClient.USER_STATUS_LOBBY:
case HoNClient.USER_STATUS_GAME:
user.Font = new Font("Arial", 8.25F, FontStyle.Bold);
user.ForeColor = Color.FromArgb(118, 0, 0);
user.ImageIndex = 4;
break;
}
}
else if (Convert.ToBoolean(e.User.Flags & HoNClient.USER_FLAG_PURCHASED))
{
switch (e.User.Status)
{
case HoNClient.USER_STATUS_ONLINE:
user.Font = new Font("Arial", 8.25F, FontStyle.Bold);
user.ForeColor = Color.FromArgb(53, 53, 53);
user.ImageIndex = 2;
break;
case HoNClient.USER_STATUS_LOBBY:
case HoNClient.USER_STATUS_GAME:
user.Font = new Font("Arial", 8.25F, FontStyle.Bold);
user.ForeColor = Color.FromArgb(53, 53, 53);
user.ImageIndex = 2;
break;
}
}
else
{
switch (e.User.Status)
{
case HoNClient.USER_STATUS_ONLINE:
user.Font = new Font("Arial", 8.25F, FontStyle.Bold);
user.ForeColor = Color.FromArgb(53, 53, 53);
user.ImageIndex = 1;
break;
case HoNClient.USER_STATUS_LOBBY:
case HoNClient.USER_STATUS_GAME:
user.Font = new Font("Arial", 8.25F, FontStyle.Bold);
user.ForeColor = Color.FromArgb(53, 53, 53);
user.ImageIndex = 0;
break;
}
}
for (int count = 1; count <= 8; count++)
{
if (ChannelID[count] == e.ChannelID)
{
if (count == CurrentChannel)
{
this.Invoke(new EventHandler(
delegate
{
if (btnChannel.Checked)
{
foreach (HoNOper oper in ChannelOpers[e.ChannelID])
{
if (oper.OperID == e.User.UserID)
{
switch (oper.OperType)
{
case HoNClient.OPER_TYPE_FOUNDER:
user.ImageIndex = 5;
break;
case HoNClient.OPER_TYPE_LEADER:
user.ImageIndex = 4;
break;
case HoNClient.OPER_TYPE_OFFICER:
user.ImageIndex = 3;
break;
}
}
}
lstPlayers.Items.Add(user);
}
ChannelUsers[count].Items.Add((ListViewItem)user.Clone());
}));
}
else
//.........这里部分代码省略.........
示例10: AddItem
internal void AddItem(ItemType itemType, int lineNumber, string description, Protean.Hub.Files.File sourceFile)
{
ListViewItem item = new ListViewItem();
item.Tag = sourceFile;
item.Text = itemType.ToString();
item.ImageIndex = this.IconFromType(itemType);
item.SubItems.Add(new ListViewItem.ListViewSubItem(item, lineNumber.ToString()));
item.SubItems.Add(new ListViewItem.ListViewSubItem(item, description.Trim()));
item.SubItems.Add(new ListViewItem.ListViewSubItem(item, sourceFile.FileNameOnly));
item.SubItems.Add(new ListViewItem.ListViewSubItem(item, sourceFile.FileNameExpanded));
this.m_ListItems.Add(item);
this.lsv_Tasks.Items.Add((ListViewItem)item.Clone());
this.sbp_TotalItems.Text = "Total items: " + this.lsv_Tasks.Items.Count.ToString();
this.sbp_FilterItems.Text = "Filtered items: " + this.lsv_Tasks.Items.Count.ToString();
}
示例11: FillLogEnum
void FillLogEnum() {
foreach (LogType type in Enum.GetValues(typeof(LogType))) {
if (type == LogType.Trace) continue;
ListViewItem item = new ListViewItem(type.ToString()) {
Tag = type
};
vLogFileOptions.Items.Add(item);
vConsoleOptions.Items.Add((ListViewItem)item.Clone());
}
}
示例12: updateGenresAndSoundbytes
private void updateGenresAndSoundbytes()
{
msgbox msgbox;
CallResponse callGenres = calls.getGenres();
CallResponse callSoundbytes = calls.getSoundbytes();
switch (callSoundbytes.Response)
{
case CallResponse.responseType.SUCCESS:
if (callSoundbytes.SatteliteData is soundbyte[])
{
listView1.Items.Clear();
soundbytes = (soundbyte[])callSoundbytes.SatteliteData;
foreach (soundbyte sb in soundbytes)
{
ListViewItem lvi = new ListViewItem();
lvi.Tag = sb.ID;
lvi.Text = sb.Name;
lvi.SubItems.Add(sb.GenreName);
switch (sb.HorrorNightType)
{
case soundbyte.HorrorNightTypes.AVAILABLE_ALL_THE_TIME:
lvi.SubItems.Add("Always");
break;
case soundbyte.HorrorNightTypes.AVAILABLE_ONLY_ON_HORROR_NIGHT:
lvi.SubItems.Add("Only");
break;
case soundbyte.HorrorNightTypes.NOT_AVAILBLE_ON_HORROR_NIGHT:
lvi.SubItems.Add("Blocked");
break;
}
lvi.SubItems.Add(sb.UploadedBy);
ListViewItem lvi2 = (ListViewItem)lvi.Clone();
listView1.Items.Add(lvi);
}
}
break;
case CallResponse.responseType.FAILURE:
msgbox = new msgbox(false, callGenres.ErrorData);
msgbox.Show();
break;
}
switch (callGenres.Response)
{
case CallResponse.responseType.SUCCESS:
if (callGenres.SatteliteData is genre[])
{
comboBox1.Items.Clear();
comboBox1.Items.Add("All");
comboBox1.Items.Add("Horror Night");
genres = (genre[])callGenres.SatteliteData;
foreach (genre genre in genres)
{
comboBox1.Items.Add(char.ToUpper(genre.Name[0]) + genre.Name.Substring(1));
}
comboBox1.SelectedIndex = 0;
}
break;
case CallResponse.responseType.FAILURE:
msgbox = new msgbox(false, callGenres.ErrorData);
msgbox.Show();
break;
}
}
示例13: GetModelEditInfor
//得到模型编辑界面所有信息
private void GetModelEditInfor()
{
//复制和移动和WAVE的模型列表
lvwCopy.Items.Clear();
lvwMove.Items.Clear();
lvwWaveModel.Items.Clear();
List<S_Model> modellist = XML3DPPM.GetModelList(XmlFile);
foreach (S_Model model in modellist)
{
if (!string.IsNullOrEmpty(model.filename))
{
ListViewItem newitem = new ListViewItem(model.filename);
newitem.SubItems.Add(GetModelFullDescription(model.a, model.b));
lvwCopy.Items.Add(newitem);
lvwMove.Items.Add((ListViewItem)newitem.Clone());
lvwWaveModel.Items.Add((ListViewItem)newitem.Clone());
}
}
//导入
txtModelEditImport.Text = "";
//Wave
WaveSelectObjects.Clear();
label_waveSelect.Text = "已选定对象数量(" + WaveSelectObjects.Count.ToString() + ")";
lvwWaveInfor.Items.Clear();
string filename = XML3DPPM.GetModelName(OnEditModel_a, OnEditModel_b, XmlFile);
if (!string.IsNullOrEmpty(filename))
{
List<S_WaveInfor> WaveInforList = NXFun.GetSinglePrtWaveInfor(ToFullPath(filename));
foreach (S_WaveInfor waveInfor in WaveInforList)
{
ListViewItem li = new ListViewItem(waveInfor.childname);
li.Tag = waveInfor.child;
li.SubItems.Add(waveInfor.isbreak ? "断开" : "正常");
li.SubItems.Add(ToFileName(waveInfor.fatherpath));
li.SubItems.Add(GetModelFullDescription(ToFileName(waveInfor.fatherpath)));
li.SubItems.Add(waveInfor.fathername);
lvwWaveInfor.Items.Add(li);
}
}
}
示例14: ListAll
//thread
private void ListAll()
{
isTxtanBtmEnable(true);
if (collection.Count == 0)
{
editToolStripMenuItem.Enabled = false;
lstVoca.Items.Clear();
foreach (Vocabulary voca in all_content)
{
foreach (string item in voca.Tr_ver)
{
ListViewItem li = new ListViewItem();
li.Text = voca.Eng_ver;
li.SubItems.Add(item);
lstVoca.Items.Add(li);
collection.Add((ListViewItem)li.Clone());
}
}
}
else
{
lstVoca.Items.Clear();
foreach (ListViewItem item in collection)
{
lstVoca.Items.Add((ListViewItem)item.Clone());
}
}
isTxtanBtmEnable(false);
}
示例15: BwFillViewsDoWork
private void BwFillViewsDoWork(object sender, DoWorkEventArgs e)
{
string entityLogicalName = e.Argument.ToString();
List<Entity> viewsList = ViewHelper.RetrieveViews(entityLogicalName, entitiesCache, service);
viewsList.AddRange(ViewHelper.RetrieveUserViews(entityLogicalName, entitiesCache, service));
foreach (Entity view in viewsList)
{
bool display = true;
var item = new ListViewItem(view["name"].ToString());
item.Tag = view;
display = ShouldDisplayItem(item);
if (display)
{
if (view.Contains("statecode"))
{
int statecodeValue = ((OptionSetValue)view["statecode"]).Value;
switch (statecodeValue)
{
case ViewHelper.VIEW_STATECODE_ACTIVE:
item.SubItems.Add("Active");
break;
case ViewHelper.VIEW_STATECODE_INACTIVE:
item.SubItems.Add("Inactive");
break;
}
}
// Add view to each list of views (source and target)
ListViewItem clonedItem = (ListViewItem)item.Clone();
ListViewDelegates.AddItem(lvSourceViews, item);
if (view.Contains("iscustomizable") &&
((BooleanManagedProperty)view["iscustomizable"]).Value == false)
{
clonedItem.ForeColor = Color.Gray;
clonedItem.ToolTipText = "This view has not been defined as customizable";
}
//ListViewDelegates.AddItem(lvTargetViews, clonedItem);
}
}
}