當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。