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


C# CollectionChangedEventArgs类代码示例

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


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


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