本文整理汇总了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();
}
}
示例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 = "";
}
}
示例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);
}
示例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();
}
}
示例5: Boats_ListChanged
void Boats_ListChanged(object sender, ListChangedEventArgs e)
{
if (e != null)
{
OnPropertyChanged("Boats");
}
}
示例6: Members_ListChanged
void Members_ListChanged(object sender, ListChangedEventArgs e)
{
if (e != null)
{
SaveMembers();
}
}
示例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;
}
}
示例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;
}
}
示例9: Binding_ListChanged
private void Binding_ListChanged(object sender, ListChangedEventArgs e)
{
if (UpdateRecordCount != null)
{
UpdateRecordCount(this.Binding.Count);
}
}
示例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;
}
}
示例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;
}
示例12: ListChanged
void ListChanged(object sender, ListChangedEventArgs e)
{
if(Answers.Count > 0)
{
Type = OQuestionType.Collection;
}
}
示例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);
}
示例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);
}
示例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);
}