本文整理汇总了C#中BindingList.Add方法的典型用法代码示例。如果您正苦于以下问题:C# BindingList.Add方法的具体用法?C# BindingList.Add怎么用?C# BindingList.Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BindingList
的用法示例。
在下文中一共展示了BindingList.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: updateListBox
//Input data into the list box
public void updateListBox()
{
objectsInScene = new BindingList<object>();
//Gets all objects from the input panel
pointsInScene = getPoints();
linesInScene = getLines();
anglesInScene = getAngles();
//Adds each object to one Binding List
foreach (Point p in pointsInScene)
{
objectsInScene.Add(p);
}
foreach (Line l in linesInScene)
{
objectsInScene.Add(l);
}
foreach (Angle a in anglesInScene)
{
objectsInScene.Add(a);
}
//Converts the Binding List to appropriate strings, and puts this data in the list for the user
objectListBox.DataSource = convertToString(objectsInScene);
}
示例2: GenerateHardCodedEmployees
public static BindingList<Employee> GenerateHardCodedEmployees ()
{
Employee em1 = new Employee("Jari", "Korppunen");
em1.EmployeeId = 1;
em1.SocialID = "120467-872J";
em1.Title = "Toimitusjohtaja";
em1.Salary = 4650;
em1.ContractType = (int)Employee.ContractTypes.Permanent;
em1.DateOfBirth = new DateTime(1967, 4, 12);
em1.DateOfWorkStarted = new DateTime(1993, 2, 19);
Employee em2 = new Employee("Eino", "Leino");
em2.EmployeeId = 2;
em2.SocialID = "01021920-852A";
em2.Title = "Apulaissihteerin sijainen";
em2.Salary = 1200;
em2.ContractType = (int)Employee.ContractTypes.Permanent;
em2.DateOfBirth = new DateTime(1920, 2, 1);
em2.DateOfWorkStarted = new DateTime(1999, 2, 2);
Employee em3 = new Employee("Kalervo", "Kullervo");
em3.SocialID = "051293-1238";
em3.EmployeeId = 3;
em3.ContractType = (int)Employee.ContractTypes.PartTime;
em3.DateOfBirth = new DateTime(1993, 12, 5);
em3.DateOfWorkStarted = new DateTime(2014, 2, 9);
BindingList<Employee> em = new BindingList<Employee>();
em.Add(em1);
em.Add(em2);
em.Add(em3);
return em;
}
示例3: TestDataBindingSubList
public void TestDataBindingSubList()
{
var boundDataGridView = new BoundDataGridView
{
BindingContext = new BindingContext(),
DataSource = new BindingListSource(),
};
using (boundDataGridView)
{
var columnIds = new[]
{
PropertyPath.Root,
PropertyPath.Parse("Sequence"),
PropertyPath.Parse("AminoAcidsList!*.Code"),
PropertyPath.Parse("Molecule!*"),
};
var viewSpec = new ViewSpec()
.SetColumns(columnIds.Select(id => new ColumnSpec().SetPropertyPath(id)))
.SetSublistId(PropertyPath.Parse("AminoAcidsList!*"));
var viewInfo = new ViewInfo(new DataSchema(), typeof (LinkValue<Peptide>), viewSpec);
// ReSharper disable once UseObjectOrCollectionInitializer
var innerList = new BindingList<LinkValue<Peptide>>();
innerList.Add(new LinkValue<Peptide>(new Peptide("AD"), null));
((BindingListSource)boundDataGridView.DataSource).SetViewContext(new TestViewContext(viewInfo.DataSchema, new[]{new RowSourceInfo(innerList, viewInfo)}));
Assert.AreEqual(2, boundDataGridView.Rows.Count);
innerList.Add(new LinkValue<Peptide>(new Peptide("TISE"), null));
Assert.AreEqual(6, boundDataGridView.Rows.Count);
}
}
示例4: AssembleWorkPegging
public IList<Material> AssembleWorkPegging()
{
IList<Material> MH = new BindingList<Material>();
Material mh = new Material();
Material mh1 = new Material();
Material mh2 = new Material();
//mh.name = "汽车";
//mh.number = "1200";
//mh.type = "21";
//mh.versions = "";
//mh.status = "";
//mh1.name = "飞机";
//mh1.number = "2200";
//mh1.type = "213";
//mh1.versions = "";
//mh1.status = "";
//mh2.name = "轮船";
//mh2.number = "3200";
//mh2.type = "211";
//mh2.versions = "";
//mh2.status = "";
MH.Add(mh);
MH.Add(mh1);
MH.Add(mh2);
return MH;
}
示例5: MealTime_Load
private void MealTime_Load(object sender, EventArgs e)
{
try
{
if (Equals(null, _controller))
{
foreach (Control control in this.Controls)
{
if (0 != String.Compare(control.Text, "Cancel", false))
control.Enabled = false;
}
return;
}
BindingList<Nom> noms = new BindingList<Nom>();
if (_meal.MyCat.DietIsRestricted)
{
foreach (Nom nom in _meal.MyCat.NomsAsList)
noms.Add(nom);
_selectNom.DropDownStyle = ComboBoxStyle.DropDownList;
}
else
{
foreach (Nom nom in _controller.GetNoms())
noms.Add(nom);
_selectNom.DropDownStyle = ComboBoxStyle.DropDown;
}
_selectNom.DataSource = noms;
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message);
Debug.WriteLine(ex.StackTrace);
}
}
示例6: AP
public IList<Material> AP()
{
IList<Material> Me = new BindingList<Material>();
Material me = new Material();
Material me1 = new Material();
Material me2 = new Material();
//me.name = "孙悟空";
//me.number = "1101";
//me.type = "异种";
//me.versions = "老大";
//me1.name = "猪八戒";
//me1.number = "1201";
//me1.type = "元帅";
//me1.versions = "老二";
//me2.name = "沙和尚";
//me2.number = "1302";
//me2.type = "将军";
//me2.versions = "老三";
Me.Add(me);
Me.Add(me1);
Me.Add(me2);
return Me;
}
示例7: CreateData
BindingList<PersonRegistration> CreateData()
{
BindingList<PersonRegistration> res = new BindingList<PersonRegistration>();
res.Add(AddPersonRegistration(res.Count + 1, "Andrew", "Fuller", 42, "[email protected]", DateTime.Today.AddDays(-32)));
res.Add(AddPersonRegistration(res.Count + 1, "Nancy", "Davolio", 34, "[email protected]", DateTime.Today.AddDays(4)));
res.Add(AddPersonRegistration(res.Count + 1, "Margaret", "Peackop", 48, "margaret.peackop.devexpress.com", DateTime.Today.AddDays(6)));
res.Add(AddPersonRegistration(res.Count + 1, "Robert", "K", 29, "[email protected]", DateTime.Today.AddDays(5)));
res.Add(AddPersonRegistration(res.Count + 1, "Anne", "Dodsworth", 17, "[email protected]", DateTime.Today.AddDays(4)));
return res;
}
示例8: TestSuiteState
public TestSuiteState()
{
Variables = new BindingList<string>();
ConnectionStringNames = new BindingList<string>();
TestCases = new DataTable();
Tests = new LargeBindingList<Test>();
Settings = new BindingList<Setting>();
Settings.Add(new Setting() { Name = "Default - System-under-test" });
Settings.Add(new Setting() { Name = "Default - Assert" });
}
示例9: GetGioiTinh
public static BindingList<ComboboxData> GetGioiTinh()
{
BindingList<ComboboxData> ls = new BindingList<ComboboxData>();
ComboboxData data1 = new ComboboxData("Nam", "1");
ComboboxData data2 = new ComboboxData("Nữ", "0");
ls.Add(data1);
ls.Add(data2);
return ls;
}
示例10: SqlLoginPage
public SqlLoginPage()
{
InitializeComponent();
BindingList<AutheticationMapper> autheticationmapper = new BindingList<AutheticationMapper>();
autheticationmapper.Add(new AutheticationMapper("Window Authentication", 1));
autheticationmapper.Add(new AutheticationMapper("SQL Server Authentication", 2));
drpAuthenticationType.DataSource = autheticationmapper;
drpAuthenticationType.DisplayMember = "AuthType";
drpAuthenticationType.ValueMember = "ID";
}
示例11: GetCustomers
private BindingList<Customer> GetCustomers()
{
BindingList<Customer> customers = new BindingList<Customer>();
customers.Add(new Customer("David"));
customers.Add(new Customer("Andrew"));
customers.Add(new Customer("Bob"));
customers.Add(new Customer("Chris"));
return customers;
}
示例12: BondStructureFwdAnalysis
public BondStructureFwdAnalysis(BondStructure structure_)
{
m_asOfAte = CarbonHistoricRetriever.GetDateForward(DateTime.Today, -1);
m_fwdDate = CarbonHistoricRetriever.GetDateForward(AsOfSettleDate, 1, Symmetry.Carbon.Model.DateUnit.M);
m_structure = structure_;
Lines = new BindingList<BondStructureFwdAnalysisLine>();
foreach (var v in structure_.Components)
Lines.Add(new BondStructureFwdAnalysisLine(this,v));
Lines.Add(CombinedLine= new BondStructureFwdAnalysisLine("Combined"));
}
示例13: GetKhuVucSong
public static BindingList<ComboboxData> GetKhuVucSong()
{
BindingList<ComboboxData> ls = new BindingList<ComboboxData>();
ComboboxData data1 = new ComboboxData("K1", "K1");
ComboboxData data2 = new ComboboxData("K2", "K2");
ComboboxData data3 = new ComboboxData("K3", "K3");
ls.Add(data1);
ls.Add(data2);
ls.Add(data3);
return ls;
}
示例14: findRelatedOperation
public IList<Operation> findRelatedOperation(int roleId)
{
IList<Operation> list = new BindingList<Operation>();
Operation operation = new Operation();
operation.Id = 1;
operation.Name = "删除";
Operation operation1 = new Operation();
operation1.Id = 1;
operation1.Name = "添加";
list.Add(operation);
list.Add(operation1);
return list;
}
示例15: findRelatedMenu
public IList<Menus> findRelatedMenu(int roleId)
{
IList<Menus> list = new BindingList<Menus>();
Menus menu = new Menus();
menu.Id = 1;
menu.Name = "系统管理工具";
Menus menu1 = new Menus();
menu1.Id = 2;
menu1.Name = "项目管理";
list.Add(menu);
list.Add(menu1);
return list;
}