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


C# ComponentModel.ListChangedEventArgs类代码示例

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


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

示例1: OnBindingListChanged

		private void OnBindingListChanged(object sender, ListChangedEventArgs e)
		{
			switch (e.ListChangedType)
			{
				case ListChangedType.Reset:
					this.RaiseDataCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
					break;
				case ListChangedType.ItemAdded:
					this.RaiseDataCollectionChanged(
						new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, ((IList)sender)[e.NewIndex], e.NewIndex));
					break;
				case ListChangedType.ItemDeleted:
					//TODO: implement conversion
					this.RaiseDataCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
					break;
				case ListChangedType.ItemMoved:
					this.RaiseDataCollectionChanged(
						new NotifyCollectionChangedEventArgs(
							NotifyCollectionChangedAction.Move, ((IList)sender)[e.NewIndex], e.NewIndex, e.OldIndex));
					break;
				case ListChangedType.ItemChanged:
					//TODO: implement conversion
					this.RaiseDataCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
					break;
				case ListChangedType.PropertyDescriptorAdded:
					break;
				case ListChangedType.PropertyDescriptorDeleted:
					break;
				case ListChangedType.PropertyDescriptorChanged:
					break;
				default:
					throw new ArgumentOutOfRangeException();
			}
		}
开发者ID:gleblebedev,项目名称:toe,代码行数:34,代码来源:DataContextContainer.cs

示例2: ItemClearAll

 public override void ItemClearAll()
 {
     int newIndex = -1;
     try
     {
         if (base.bsRepeat != null)
         {
             newIndex = base.bsRepeat.Position;
             base.bsRepeat.RaiseListChangedEvents = false;
             base.bsRepeat.SuspendBinding();
         }
         base.Items.ClearAll();
     }
     finally
     {
         if (base.bsRepeat != null)
         {
             base.bsRepeat.RaiseListChangedEvents = true;
             base.bsRepeat.ResumeBinding();
             base.bsRepeat.ResetBindings(false);
             if (base.bsRepeat.Position == newIndex)
             {
                 ListChangedEventArgs e = new ListChangedEventArgs(ListChangedType.ItemMoved, newIndex);
                 base.bsRepeat.OnPositionChangedEx(e);
             }
             else
             {
                 base.bsRepeat.Position = newIndex;
             }
         }
         base.lblNextpage.Text = "";
     }
 }
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:33,代码来源:JobPanel.cs

示例3: OnPropertiesListChanged

        private void OnPropertiesListChanged(object sender, ListChangedEventArgs e)
        {
            if (e.ListChangedType != ListChangedType.ItemAdded)
                return;

            var property = ((PropertyCollection)sender)[e.NewIndex];

            if (!MustEncrypt(property))
                return;

            property.DbType = System.Data.DbType.Binary;
            property.MaxLength = 8000;

            if (property.Entity.AmbientParameters[PassPhraseParameterName] != null)
                return;

            // create one pass phrase ambient parameter for each entity that has at least one crypt property
            var passPhraseParameter = new MethodParameter
            {
                Name = PassPhraseParameterName,
                ClrFullTypeName = "string",
                Nullable = CodeFluent.Model.Code.Nullable.False,
                Options = MethodParameterOptions.Ambient |
                            MethodParameterOptions.Inherits |
                            MethodParameterOptions.UsedForLoad |
                            MethodParameterOptions.UsedForSearch |
                            MethodParameterOptions.UsedForCount |
                            MethodParameterOptions.UsedForRaw |
                            MethodParameterOptions.UsedForSave,
                ModelName = "[" + Project.DefaultNamespace + ".PassPhrase.GetPassPhrase()]",
                AmbientExpression = "(1=1)"
            };

            property.Entity.AmbientParameters.Add(passPhraseParameter);
        }
开发者ID:modulexcite,项目名称:CodeFluent-Entities,代码行数:35,代码来源:EncryptAspect.cs

示例4: approvedBindingSource_ListChanged

 private void approvedBindingSource_ListChanged(object sender, ListChangedEventArgs e) {
     if (inited) {
         PluginSettings.Default.Quotes = new ArrayList(approvedBindingSource.List);
         PluginSettings.Default.UnapprovedQuotes = new ArrayList(pendingBindingSource.List);
         PluginSettings.Default.Save();
     }
 }
开发者ID:shruggles,项目名称:dynamicskypebot,代码行数:7,代码来源:QuoteConfigForm.cs

示例5: Boats_ListChanged

 void Boats_ListChanged(object sender, ListChangedEventArgs e)
 {
     if (e != null)
     {
         OnPropertyChanged("Boats");
     }
 }
开发者ID:kristofferlind,项目名称:1dv407-ooad,代码行数:7,代码来源:BoatManager.cs

示例6: Members_ListChanged

 void Members_ListChanged(object sender, ListChangedEventArgs e)
 {
     if (e != null)
     {
         SaveMembers();
     }
 }
开发者ID:kristofferlind,项目名称:1dv407-ooad,代码行数:7,代码来源:MemberRegister.cs

示例7: DataSource_ListChanged

        void DataSource_ListChanged(object sender, ListChangedEventArgs e)
        {
            switch (e.ListChangedType)
            {
                case ListChangedType.ItemAdded:
                {
                    vScrollBar.Value = 0;
                    Twitter.Status newTweet = DataSource[e.NewIndex];

                    TweetPane newPane = new TweetPane(newTweet);
                    newPane.Location = new Point(0, 0);
                    newPane.Size = new Size(panelTweetPanels.Width, 140);
                    newPane.Visible = true;
                    foreach (var item in Panes)
                        item.Location = new Point(item.Location.X, item.Location.Y + 140);
                    Panes.Add(newPane);
                    panelTweetPanels.Controls.Add(newPane);
                    vScrollBar.Maximum = Panes.Count * 140;
                    newPane.Reply += new TweetReplyEventHandler(TweetPane_Reply);
                    break;
                }
                default:
                    break;
            }            
        }
开发者ID:swatt6400,项目名称:NetOffice,代码行数:25,代码来源:TweetGrid.cs

示例8: Items_ListChanged

        void Items_ListChanged(object sender, ListChangedEventArgs e)
        {
            // find at what point the BindingSources changed
            int from = 0;
            for (; from < layoutFieldPaths.Controls.Count && from < Adapter.Items.Count && ((ComboBox)layoutFieldPaths.Controls[from]).DataSource == Adapter.Items[from].Fields; from++) ;

            for (int i = layoutFieldPaths.Controls.Count - 1; i >= from; i--)
            {
                var cbo = (ComboBox)layoutFieldPaths.Controls[i];
                cbo.SelectedIndexChanged -= cboFields_SelectedIndexChanged;
                layoutFieldPaths.Controls.Remove(cbo);
                layoutFieldPaths.RowStyles.RemoveAt(i);
                cbo.Dispose();
            }
            for (int i = from; i < Adapter.Items.Count; i++)
            {
                var cbo = new ComboBox();
                cbo.DropDownStyle = ComboBoxStyle.DropDownList;
                cbo.Anchor = AnchorStyles.Left | AnchorStyles.Right;

                layoutFieldPaths.RowStyles.Add(new RowStyle(SizeType.AutoSize));
                layoutFieldPaths.Controls.Add(cbo);

                var item = Adapter.Items[i];
                cbo.DisplayMember = "DisplayName";
                cbo.DataSource = item.Fields;
                //cbo.DataBindings.Add("SelectedItem", item, "SelectedField", false, DataSourceUpdateMode.OnPropertyChanged);
                cbo.SelectedItem = item.SelectedField;
                cbo.Tag = item;
                cbo.SelectedIndexChanged += cboFields_SelectedIndexChanged;
            }
        }
开发者ID:AdamCollings,项目名称:dbqf,代码行数:32,代码来源:FieldPathCombo.cs

示例9: Binding_ListChanged

 private void Binding_ListChanged(object sender, ListChangedEventArgs e)
 {
     if (UpdateRecordCount != null)
     {
         UpdateRecordCount(this.Binding.Count);
     }
 }
开发者ID:swanestle,项目名称:iXY,代码行数:7,代码来源:ActiveListContainer.cs

示例10: dataSource_ListChanged

        private void dataSource_ListChanged( object sender, ListChangedEventArgs e )
        {
            switch( e.ListChangedType )
            {
            case ListChangedType.ItemChanged:
                ItemChanged( e.NewIndex );
                break;

            case ListChangedType.ItemAdded:
                ItemAdded( e.NewIndex );
                break;

            case ListChangedType.ItemDeleted:
                ItemDeleted( e.NewIndex );
                break;

            case ListChangedType.ItemMoved:
                ItemMoved( e.OldIndex, e.NewIndex );
                break;

            case ListChangedType.Reset:
                ResetList();
                break;
            }
        }
开发者ID:pdjonov,项目名称:x42view,代码行数:25,代码来源:ProxyObjectListPanel.cs

示例11: bindingSourceProfiles_ListChanged

 private void bindingSourceProfiles_ListChanged(object sender, ListChangedEventArgs e)
 {
     button4.Enabled = bindingSourceProfiles.Current != null;
     btnNewVariable.Enabled = bindingSourceProfiles.Current != null;
     btnEditVariable.Enabled = bindingSourceProfiles.Current != null;
     btnDeleteVariable.Enabled = bindingSourceProfiles.Current != null;
 }
开发者ID:bmeric,项目名称:Envared,代码行数:7,代码来源:processLauncher.cs

示例12: ListChanged

 void ListChanged(object sender, ListChangedEventArgs e)
 {
    if(Answers.Count > 0)
    {
        Type = OQuestionType.Collection;
    }
 }
开发者ID:aelhadi,项目名称:opencbs,代码行数:7,代码来源:Question.cs

示例13: Parts_ListChanged

 void Parts_ListChanged(object sender, ListChangedEventArgs e)
 {
     if (e.ListChangedType == ListChangedType.ItemAdded)
         AddPart(_adapter.Parts[e.NewIndex], e.NewIndex);
     else if (e.ListChangedType == ListChangedType.ItemDeleted)
         RemovePart(e.NewIndex);
 }
开发者ID:AdamCollings,项目名称:dbqf,代码行数:7,代码来源:AdvancedPartJunctionView.cs

示例14: Ctor_ListChangedType_NewIndex_OldIndex

		public void Ctor_ListChangedType_NewIndex_OldIndex()
		{
			ListChangedEventArgs e = new ListChangedEventArgs (ListChangedType.ItemMoved, 1, 2);
			Assert.AreEqual (ListChangedType.ItemMoved, e.ListChangedType);
			Assert.AreEqual (1,  e.NewIndex);
			Assert.AreEqual (2,  e.OldIndex);
		}
开发者ID:nlhepler,项目名称:mono,代码行数:7,代码来源:ListChangedEventArgsTest.cs

示例15: Ctor_ListChangedType_NewIndex

		public void Ctor_ListChangedType_NewIndex()
		{
			ListChangedEventArgs e = new ListChangedEventArgs (ListChangedType.ItemAdded, 0);
			Assert.AreEqual (ListChangedType.ItemAdded, e.ListChangedType);
			Assert.AreEqual (0,   e.NewIndex);
			Assert.AreEqual (-1,  e.OldIndex);
		}
开发者ID:nlhepler,项目名称:mono,代码行数:7,代码来源:ListChangedEventArgsTest.cs


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