本文整理汇总了C#中BindingList.ToList方法的典型用法代码示例。如果您正苦于以下问题:C# BindingList.ToList方法的具体用法?C# BindingList.ToList怎么用?C# BindingList.ToList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BindingList
的用法示例。
在下文中一共展示了BindingList.ToList方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CustomTeam_Load
private void CustomTeam_Load(object sender, EventArgs e)
{
currId = 0;
if (this.team == null)
{
this.players = new BindingList<Player>();
this.team = new Team("" + System.DateTime.Today.ToString(), this.teamNameTextBox.Text, players.ToList<Player>());
}
else
{
this.players = new BindingList<Player>(team.Players);
}
this.playersListBox.DataSource = players;
updateForm();
}
示例2: Main_Load
private void Main_Load(object sender, EventArgs e)
{
Microsoft.Win32.SystemEvents.DisplaySettingsChanged +=
new System.EventHandler(displaySettingsChanged);
ChangeWindowSize();
PrepareMainScreen();
lstCourses = dlRegistration.getClasses();
lstCoursesList = lstCourses.ToList();
lstCourseCodes = new List<string>();
foreach (course crsCourses in lstCoursesList)
{
lstCourseCodes.Add(crsCourses.CourseCode);
}
validStudents = dlRegistration.getRegisteredStudents();
}
示例3: GetAllUnitGroup
public List<UnitGroup> GetAllUnitGroup()
{
var UG = new BindingList<UnitGroup>();
UnitGroup ug1 = new UnitGroup();
UnitGroup ug2 = new UnitGroup();
ug1.name = "652";
ug1.number = "1";
ug1.description = "挤爆了";
ug1.create_date = new DateTime();
ug1.create_user_id = 1;
ug1.Id = 1;
ug1.is_delete = "是";
ug1.modify_date = new DateTime();
ug1.modify_user_id = 1;
ug1.Parent_Id = 0;
ug2.name = "158";
ug2.number = "2";
ug2.description = "挤上天";
ug2.create_date = new DateTime();
ug2.create_user_id = 2;
ug2.Id = 2;
ug2.is_delete = "否";
ug2.modify_date = new DateTime();
ug2.modify_user_id = 2;
ug2.Parent_Id = 0;
UG.Add(ug1);
UG.Add(ug2);
return UG.ToList();
}
示例4: FindRelatedUsersForUserGroup
public List<Users> FindRelatedUsersForUserGroup(int groupID)
{
IList<Users> list = new BindingList<Users>();
Users user = new Users();
Users user1 = new Users();
user.login_name = "小徐";
user.real_name = "查到了";
user.isChecked = false;
user.birthday = new DateTime();
user.sex = "男";
user.age = 18;
user.remark = "我是小徐,大家好";
user.major = "本科(买的)";
user.email = "[email protected]";
user.birthday = new DateTime();
user.company_id = 1;
user.audit_state = "0";
user.stor_key = "123";
user.mobile_phone = "119";
user.office_phone = "120";
user.immediate_manager = "威哥";
user.user_number = "1234567usernumber";
user.default_department = "酱油部门";
user.create_user_id = 123;
user.create_date = new DateTime();
user.modify_user_id = 1234;
user.modify_date = new DateTime();
user.is_delete = "1";
user.id = 1;
user1.login_name = "小宫";
user1.real_name = "很高兴";
user1.isChecked = false;
user1.birthday = new DateTime();
user1.sex = "男";
user1.age = 18;
user1.remark = "我是小宫,大家好";
user1.major = "专科";
user1.email = "[email protected]";
user1.birthday = new DateTime();
user1.company_id = 1;
user1.audit_state = "0";
user1.stor_key = "123";
user1.mobile_phone = "119";
user1.office_phone = "120";
user1.immediate_manager = "威哥";
user1.user_number = "123456usernumber";
user1.default_department = "酱油部门";
user1.create_user_id = 123;
user1.create_date = new DateTime();
user1.modify_user_id = 1234;
user1.modify_date = new DateTime();
user1.is_delete = "1";
user1.id = 2;
list.Add(user);
list.Add(user1);
return list.ToList();
}
示例5: SubscribeListBindingEvents
private void SubscribeListBindingEvents()
{
CurrentBudget.Model.PropertyChanged += BudgetModelOnPropertyChanged;
Incomes = new BindingList<Income>(CurrentBudget.Model.Incomes.ToList());
Incomes.ToList().ForEach(
i =>
{
i.PropertyChanged += OnIncomeAmountPropertyChanged;
i.Bucket.PropertyChanged += OnIncomeAmountPropertyChanged;
});
Expenses = new BindingList<Expense>(CurrentBudget.Model.Expenses.ToList());
Expenses.ToList().ForEach(
e =>
{
e.PropertyChanged += OnExpenseAmountPropertyChanged;
e.Bucket.PropertyChanged += OnExpenseAmountPropertyChanged;
});
}
示例6: loadAddress
public void loadAddress(BindingList<String> direcciones)
{
this.Direcciones.Clear();
direcciones.ToList().ForEach((String direccion) => this.Direcciones.Add(direccion));
}
示例7: SortLength
public static BindingList<Song> SortLength(SortOrder sortOrder, BindingList<Song> sortList)
{
List<Song> sortedList = sortList.ToList();
sortedList.Sort(delegate(Song song1, Song song2)
{
return song1.Length.CompareTo(song2.Length);
});
if (sortOrder == SortOrder.Descending)
sortedList.Reverse();
return new BindingList<Song>(sortedList);
}
示例8: SortBindingList
public static BindingList<Song> SortBindingList(BindingList<Song> sortList, SortOrder sortOrder, string field)
{
List<Song> sortedList = sortList.ToList();
sortedList.Sort(delegate(Song song1, Song song2)
{
return song1.Title.CompareTo(song2.Title);
});
if (sortOrder == SortOrder.Descending)
sortedList.Reverse();
return new BindingList<Song>(sortedList);
}