本文整理汇总了C#中BindingList类的典型用法代码示例。如果您正苦于以下问题:C# BindingList类的具体用法?C# BindingList怎么用?C# BindingList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BindingList类属于命名空间,在下文中一共展示了BindingList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitTabControlPages
private void InitTabControlPages()
{
foreach(var obj in CardLevels)
{
var page = new TabPage { Text = CardLevel.RoleCardLevelName(obj) };
CardTabControl.TabPages.Add(page);
var listData = new BindingList<RoleCard>();
var list = new ListBox()
{
Dock = DockStyle.Fill,
ContextMenuStrip = TabControlContextMenu,
DisplayMember = "Name",
ValueMember = "Id",
DataSource = listData,
};
list.SelectedIndexChanged += (sender, msg) =>
{
var item = list.SelectedItem as RoleCard;
if (ListOfRoleCardList[CardTabControl.SelectedIndex].Contains(item))
{
SelectedItem = item;
cardInfoControl1.BeginModify();
cardInfoControl1.Images = CardImageDictionary[SelectedItem.Id];
cardInfoControl1.RoleCard = SelectedItem;
cardInfoControl1.EndModify();
}
};
page.Controls.Add(list);
ListOfRoleCardList.Add(listData);
}
}
示例2: CalcPurchOrderLine
private BindingList<PurchOrder_Receive> CalcPurchOrderLine(Session session)
{
BindingList<PurchOrder_Receive> poReceives = new BindingList<PurchOrder_Receive>();
XPClassInfo poLineClass;
CriteriaOperator criteria;
SortingCollection sortProps;
StringBuilder sbCriteria = new StringBuilder();
sbCriteria.Append(string.Format("OrderStatus = '{0}'", PurchOrderLine.PurchOrderStatus.Active));
if (txtItemNo.Text != "")
sbCriteria.Append(string.Format(" AND Item.ItemNo = '{0}'", txtItemNo.Text));
if (txtVendor.Text != "")
sbCriteria.Append(string.Format(" AND Vendor.No = '{0}'", txtVendor.Text));
poLineClass = session.GetClassInfo(typeof(PurchOrderLine));
criteria = CriteriaOperator.Parse(sbCriteria.ToString());
sortProps = new SortingCollection(null);
ICollection poLines = session.GetObjects(poLineClass, criteria, sortProps, int.MaxValue, false, true);
foreach (PurchOrderLine poLine in poLines)
{
PurchOrder_Receive poReceive = new PurchOrder_Receive();
poReceive.PurchOrderLine = poLine;
poReceive.Item = poLine.Item;
poReceive.ItemType = poLine.Item.ItemType;
poReceive.ReceivedWarehouse = poLine.Warehouse;
poReceives.Add(poReceive);
}
return poReceives;
}
示例3: RealGridsManagerWindow
public RealGridsManagerWindow()
{
InitializeComponent();
_savedList = new List<RealGridData>();
_gridsList = new BindingList<RealGridData>();
_gridListView.ItemsSource = _gridsList;
}
示例4: MakeMaterialsPage
private void MakeMaterialsPage()
{
Materials = new BindingList<MaterialDataBinder>();
foreach( MaterialData material in Application.OpenedProject.Materials )
Materials.Add( new MaterialDataBinder( new MaterialData( material ) ) );
listBoxMedium.DataSource = Materials;
}
示例5: MovieSetManager
/// <summary>
/// Initializes static members of the <see cref="MovieSetManager"/> class.
/// </summary>
static MovieSetManager()
{
database = new BindingList<MovieSetModel>();
currentSet = new MovieSetModel();
database.ListChanged += Database_ListChanged;
}
示例6: VirtualListVewModel
public VirtualListVewModel(SynchronizationContext bindingContext, DataService service)
{
_virtualRequest = new BehaviorSubject<VirtualRequest>(new VirtualRequest(0,10));
Items = new BindingList<Poco>();
var sharedDataSource = service
.DataStream
.Do(x => Trace.WriteLine($"Service -> {x}"))
.ToObservableChangeSet()
.Publish();
var binding = sharedDataSource
.Virtualise(_virtualRequest)
.ObserveOn(bindingContext)
.Bind(Items)
.Subscribe();
//the problem was because Virtualise should fire a noticiation if count changes, but it does not [BUG]
//Therefore take the total count from the underlying data NB: Count is DD.Count() not Observable.Count()
Count = sharedDataSource.Count().DistinctUntilChanged();
Count.Subscribe(x => Trace.WriteLine($"Count = {x}"));
var connection = sharedDataSource.Connect();
_disposables = new CompositeDisposable(binding, connection);
}
示例7: DomainFacade
private DomainFacade(IPlugin pPlugin)
{
cPlugin = pPlugin;
cObserverList = new List<IObserver>();
cRecordList = new BindingList<DNSPoisonRecord>();
cInfrastructure = InfrastructureFacade.getInstance(pPlugin);
}
示例8: AddMappingDialog
public AddMappingDialog(BindingList<KeyMapping> mappings, ClassDefinition acls, ClassDefinition rcls)
: this()
{
_mappings = mappings;
lblClass.Text = rcls.QualifiedName;
lblAssocClass.Text = acls.QualifiedName;
List<DataPropertyDefinition> aprops = new List<DataPropertyDefinition>();
List<DataPropertyDefinition> rprops = new List<DataPropertyDefinition>();
foreach (PropertyDefinition p in acls.Properties)
{
if (p.PropertyType == PropertyType.PropertyType_DataProperty)
aprops.Add((DataPropertyDefinition)p);
}
foreach (PropertyDefinition p in rcls.Properties)
{
if (p.PropertyType == PropertyType.PropertyType_DataProperty)
rprops.Add((DataPropertyDefinition)p);
}
cmbActiveProperty.DataSource = rprops;
cmbAssociatedProperty.DataSource = aprops;
cmbActiveProperty.SelectedIndex = 0;
cmbAssociatedProperty.SelectedIndex = 0;
}
示例9: DeserializeFromXml
public static void DeserializeFromXml(string xml)
{
//When there is nothing to deserialize, add default scripts
if (string.IsNullOrEmpty(xml))
{
Scripts = new BindingList<ScriptInfo>();
AddDefaultScripts();
return;
}
try
{
var serializer = new XmlSerializer(typeof(BindingList<ScriptInfo>));
using (var stringReader = new StringReader(xml))
using (var xmlReader = new XmlTextReader(stringReader))
{
Scripts = serializer.Deserialize(xmlReader) as BindingList<ScriptInfo>;
}
}
catch (Exception ex)
{
Scripts = new BindingList<ScriptInfo>();
DeserializeFromOldFormat(xml);
Trace.WriteLine(ex.Message);
}
}
示例10: BaseJointShow
public BaseJointShow(string name)
{
_name = name;
_importedShows = new BindingList<IShow>();
_showOrderList = new BindingList<IShow>();
}
示例11: Convert
/// <summary>
/// Converts a value.
/// </summary>
/// <returns>
/// A converted value. If the method returns null, the valid null value is used.
/// </returns>
/// <param name="value">The value produced by the binding source.</param><param name="targetType">The type of the binding target property.</param><param name="parameter">The converter parameter to use.</param><param name="culture">The culture to use in the converter.</param>
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
AudioTrack track = value as AudioTrack;
if (track != null && track.ScannedTrack != null)
{
HBAudioEncoder encoder =
HandBrakeEncoderHelpers.GetAudioEncoder(EnumHelper<AudioEncoder>.GetShortName(track.Encoder));
BindingList<HBMixdown> mixdowns = new BindingList<HBMixdown>();
foreach (HBMixdown mixdown in HandBrakeEncoderHelpers.Mixdowns)
{
if (HandBrakeEncoderHelpers.MixdownIsSupported(
mixdown,
encoder,
track.ScannedTrack.ChannelLayout))
{
mixdowns.Add(mixdown);
}
}
return mixdowns;
}
return value;
}
示例12: MainWindow
public MainWindow()
{
InitializeComponent();
TextItems = new BindingList<string>();
TheItems.ItemsSource = TextItems;
}
示例13: KeyboardConsumer
public KeyboardConsumer()
: base()
{
singleStroke = false;
keymappings = new BindingList<Keymapping>();
InitKeys();
_converter = new MovCodeToStringConverter();
_movsToKeyCodes = new Dictionary<int, VirtualKeyCode>();
_keyboardControl = new KeyboardControl();
_keyboardControl.viewModel.keyboardConsumer = this;
consumerControl = new BaseControl();
((BaseControl)consumerControl).viewModel.realtimeConsumer = this;
((BaseControl)consumerControl).itemsGrid.Children.Clear();
((BaseControl)consumerControl).itemsGrid.Children.Add(_keyboardControl);
_simulator = new InputSimulator();
//UpdateKeymappings();
keymappings.ListChanged += keymappings_ListChanged;
//Configuring a timer that will call the Keystroke method each 100 milliseconds.
_timer = new FastTimer(3, 100, Keystroke);
}
示例14: FormIgnores
public FormIgnores()
{
InitializeComponent();
Opcodes = new BindingList<ushort>(Ignores.I.Values);
listOpcodes.DataSource = Opcodes;
}
示例15: ReadData
public BindingList<RowModel> ReadData()
{
var list = new BindingList<RowModel>();
string text = File.ReadAllText(FileName);
string[] lines = text.Split('\n');
foreach (var line in lines)
{
if (string.IsNullOrEmpty(line.Trim()))
{
continue;
}
var values = line.Split(',');
var id = int.Parse(values[0].Trim().Trim('\r'));
var description = values[1].Trim().Trim('\r');
var state = (State)Enum.Parse(typeof(State), values[2].Trim().Trim('\r'));
var isCompleted = bool.Parse(values[3].Trim().Trim('\r'));
var model = new RowModel
{
Id = id,
Description = description,
State = state,
IsCompleted = isCompleted,
};
list.Add(model);
}
return list;
}