• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# CollectionChangedEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CollectionChangedEventArgs的典型用法代码示例。如果您正苦于以下问题:C# CollectionChangedEventArgs类的具体用法?C# CollectionChangedEventArgs怎么用?C# CollectionChangedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CollectionChangedEventArgs类属于命名空间,在下文中一共展示了CollectionChangedEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Items_Added

 private void Items_Added(object sender, CollectionChangedEventArgs<Item> e)
 {
     Dispatcher.Invoke(() =>
     {
         foreach (Item i in e)
             list.Items.Add(i);
     });
 }
开发者ID:greeduomacro,项目名称:UOInterface,代码行数:8,代码来源:ItemBrowser.xaml.cs


示例2: NamedReporters_RemovedItem

 private void NamedReporters_RemovedItem(object sender, CollectionChangedEventArgs e)
 {
     Invoke(new Action(() =>
     {
         var reporter = e.TargetObject as INamedProgressReporter;
         _reporterContexts.Remove(reporter);
         outputSourcesToolStripComboBox.Items.RemoveAt(e.TargetIndex);
     }));
 }
开发者ID:die-Deutsche-Orthopaedie,项目名称:LiteDevelop,代码行数:9,代码来源:OutputContent.cs


示例3: References_RemovedItem

 private void References_RemovedItem(object sender, CollectionChangedEventArgs e)
 {
     foreach (TreeNode node in Nodes)
     {
         if (node is FileReferenceNode && (node as FileReferenceNode).Reference == e.TargetObject as string)
         {
             node.Remove();
             break;
         }
     }
 }
开发者ID:ThrDev,项目名称:LiteDevelop,代码行数:11,代码来源:ReferencesNode.cs


示例4: collectionChangedEventArgs_ctor_changeType_should_set_default_values

        public void collectionChangedEventArgs_ctor_changeType_should_set_default_values()
        {
            var cType = CollectionChangeType.Reset;

            var target = new CollectionChangedEventArgs<Object>( cType );

            target.ChangeType.Should().Be.EqualTo( cType );
            target.Index.Should().Be.EqualTo( -1 );
            target.Item.Should().Be.Null();
            target.OldIndex.Should().Be.EqualTo( -1 );
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:11,代码来源:CollectionChangedEventArgsTests.cs


示例5: Mobiles_Added

 private void Mobiles_Added(object sender, CollectionChangedEventArgs<Mobile> e)
 {
     Dispatcher.Invoke(() =>
     {
         foreach (Mobile m in e)
         {
             m.AppearanceChanged += Mobile_AppearanceChanged;
             list.Items.Add(m);
         }
     });
 }
开发者ID:greeduomacro,项目名称:UOInterface,代码行数:11,代码来源:MobileBrowser.xaml.cs


示例6: Items_Removed

 private void Items_Removed(object sender, CollectionChangedEventArgs<Item> e)
 {
     Dispatcher.Invoke(() =>
     {
         foreach (Item i in e)
         {
             list.Items.Remove(i);
             if (list.SelectedItem == i)
                 list.SelectedItem = null;
         }
     });
 }
开发者ID:greeduomacro,项目名称:UOInterface,代码行数:12,代码来源:ItemBrowser.xaml.cs


示例7: NamedReporters_InsertedItem

        private void NamedReporters_InsertedItem(object sender, CollectionChangedEventArgs e)
        {
            Invoke(new Action(() =>
            {
                var reporter = e.TargetObject as INamedProgressReporter;
                _reporterContexts.Add(reporter, new ReporterContext(reporter));

                outputSourcesToolStripComboBox.Items.Insert(e.TargetIndex, reporter.DisplayName);

                reporter.DisplayNameChanged += reporter_DisplayNameChanged;
            }));
        }
开发者ID:die-Deutsche-Orthopaedie,项目名称:LiteDevelop,代码行数:12,代码来源:OutputContent.cs


示例8: Mobiles_Removed

 private void Mobiles_Removed(object sender, CollectionChangedEventArgs<Mobile> e)
 {
     Dispatcher.Invoke(() =>
     {
         foreach (Mobile m in e)
         {
             list.Items.Remove(m);
             m.AppearanceChanged -= Mobile_AppearanceChanged;
             if (list.SelectedItem == m)
                 list.SelectedItem = null;
         }
     });
 }
开发者ID:greeduomacro,项目名称:UOInterface,代码行数:13,代码来源:MobileBrowser.xaml.cs


示例9: collectionChangedEventArgs_ctor_changeType_index_oldIndex_item_should_set_default_values

        public void collectionChangedEventArgs_ctor_changeType_index_oldIndex_item_should_set_default_values()
        {
            var item = new Object();
            var cType = CollectionChangeType.ItemMoved;
            var index = 10;
            var oldIndex = 1;

            var target = new CollectionChangedEventArgs<Object>( cType, index, oldIndex, item );

            target.ChangeType.Should().Be.EqualTo( cType );
            target.Index.Should().Be.EqualTo( index );
            target.Item.Should().Be.EqualTo( item );
            target.OldIndex.Should().Be.EqualTo( oldIndex );
        }
开发者ID:RadicalFx,项目名称:Radical,代码行数:14,代码来源:CollectionChangedEventArgsTests.cs


示例10: Bookmarks_InsertedItem

        private void Bookmarks_InsertedItem(object sender, CollectionChangedEventArgs e)
        {
            var bookmark = e.TargetObject as Bookmark;

            var item = new ListViewItem(new string[] { 
                bookmark.Location.Line.ToString(), 
                // bookmark.Tooltip, 
                bookmark.Location.FilePath.ToString() })
            {
                ImageIndex = listView1.Items.Count
            };

            _imageList.Images.Add(bookmark.Image);
            listView1.Items.Add(item);

            bookmark.LocationChanged += bookmark_LocationChanged;
            bookmark.ImageChanged += bookmark_ImageChanged;

            _bookmarkItems.Add(bookmark, item);
        }
开发者ID:die-Deutsche-Orthopaedie,项目名称:LiteDevelop,代码行数:20,代码来源:BookmarksContent.cs


示例11: viewItems_RemovedItem

 private void viewItems_RemovedItem(object sender, CollectionChangedEventArgs e)
 {
     ViewMenu.DropDownItems.Remove(e.TargetObject as ToolStripItem);
 }
开发者ID:phoenixhf,项目名称:LiteDevelop,代码行数:4,代码来源:ControlManager.cs


示例12: viewItems_InsertedItem

 private void viewItems_InsertedItem(object sender, CollectionChangedEventArgs e)
 {
     // insert before full screen menu item.
     ViewMenu.DropDownItems.Insert(ViewMenu.DropDownItems.Count - 2, e.TargetObject as ToolStripItem);
 }
开发者ID:phoenixhf,项目名称:LiteDevelop,代码行数:5,代码来源:ControlManager.cs


示例13: viewContent_RemovedItem

 private void viewContent_RemovedItem(object sender, CollectionChangedEventArgs e)
 {
     LiteViewContent viewContent = e.TargetObject as LiteViewContent;
     var dockContent = DockPanel.GetContainer(viewContent);
     dockContent.DockHandler.Close();
 }
开发者ID:phoenixhf,项目名称:LiteDevelop,代码行数:6,代码来源:ControlManager.cs


示例14: viewContent_InsertedItem

 private void viewContent_InsertedItem(object sender, CollectionChangedEventArgs e)
 {
     AddContainer(e.TargetObject as LiteViewContent).ShowAndActivate(DockPanel);
 }
开发者ID:phoenixhf,项目名称:LiteDevelop,代码行数:4,代码来源:ControlManager.cs


示例15: Assemblies_RemovedItem

 private static void Assemblies_RemovedItem(object sender, CollectionChangedEventArgs<AssemblyDefinition> e)
 {
     e.TargetObject.Compilation = null;
 }
开发者ID:JerreS,项目名称:AbstractCode,代码行数:4,代码来源:Compilation.cs


示例16: References_RemovedItem

 protected virtual void References_RemovedItem(object sender, CollectionChangedEventArgs e)
 {
     var item = _msBuildProject.Items.FirstOrDefault(x => x.ItemType == "Reference" && x.Include == e.TargetObject as string);
     if (item != null)
         item.Parent.RemoveChild(item);
 }
开发者ID:ThrDev,项目名称:LiteDevelop,代码行数:6,代码来源:MSBuildProject.cs


示例17: ProjectFiles_RemovedItem

        protected virtual void ProjectFiles_RemovedItem(object sender, CollectionChangedEventArgs e)
        {
            var file = (e.TargetObject as ProjectFileEntry);
            string hintPath = file.FilePath.GetRelativePath(this);

            var item = _msBuildProject.Items.FirstOrDefault(x => x.ItemType == GetItemType(hintPath) && x.Include.Equals(hintPath, StringComparison.OrdinalIgnoreCase));
            if (item != null)
            {
                item.Parent.RemoveChild(item);
            }

            RemoveFileEventHandlers(file);
        }
开发者ID:ThrDev,项目名称:LiteDevelop,代码行数:13,代码来源:MSBuildProject.cs


示例18: Errors_RemovedItem

 private void Errors_RemovedItem(object sender, CollectionChangedEventArgs e)
 {
     foreach (ListViewItem item in listView1.Items)
     {
         if (item.Tag == e.TargetObject)
         {
             item.Remove();
             break;
         }
     }
 }
开发者ID:die-Deutsche-Orthopaedie,项目名称:LiteDevelop,代码行数:11,代码来源:ErrorContent.cs


示例19: _statusStripItems_RemovedItem

 private void _statusStripItems_RemovedItem(object sender, CollectionChangedEventArgs e)
 {
     StatusStrip.Items.Remove(e.TargetObject as ToolStripItem);
 }
开发者ID:phoenixhf,项目名称:LiteDevelop,代码行数:4,代码来源:ControlManager.cs


示例20: Errors_InsertedItem

 private void Errors_InsertedItem(object sender, CollectionChangedEventArgs e)
 {
     AddError(e.TargetObject as BuildError);
     UpdateToolbar();
 }
开发者ID:die-Deutsche-Orthopaedie,项目名称:LiteDevelop,代码行数:5,代码来源:ErrorContent.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CollectionDataContract类代码示例发布时间:2022-05-24
下一篇:
C# CollectionChangeEventHandler类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap