本文整理汇总了C#中NSTableView.ReloadData方法的典型用法代码示例。如果您正苦于以下问题:C# NSTableView.ReloadData方法的具体用法?C# NSTableView.ReloadData怎么用?C# NSTableView.ReloadData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NSTableView
的用法示例。
在下文中一共展示了NSTableView.ReloadData方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SortDescriptorsChanged
public override void SortDescriptorsChanged (NSTableView tableView, NSSortDescriptor[] oldDescriptors)
{
// Any sort direction given?
if (oldDescriptors.Length <= 0)
return;
// Sort the data
Sort (oldDescriptors [0].Key, oldDescriptors [0].Ascending);
tableView.ReloadData ();
}
示例2: SortDescriptorsChanged
public override void SortDescriptorsChanged (NSTableView tableView, NSSortDescriptor[] oldDescriptors)
{
// Sort the data
if (oldDescriptors.Length > 0) {
// Update sort
Sort (oldDescriptors [0].Key, oldDescriptors [0].Ascending);
} else {
// Grab current descriptors and update sort
NSSortDescriptor[] tbSort = tableView.SortDescriptors;
Sort (tbSort[0].Key, tbSort[0].Ascending);
}
// Refresh table
tableView.ReloadData ();
}
示例3: ReloadTableView
public void ReloadTableView(NSTableView tableView, List<HttpTransportViewData> datasource, HttpTransportCollection collection)
{
// tableView.Delegate = new TableDelegate (this);
// var listView = new HttpTransportDataSource { Entries = datasource };
// tableView.DataSource = listView;
// tableView.ReloadData ();
foreach(NSTableColumn column in tableView.TableColumns())
{
tableView.RemoveColumn (column);
}
tableView.Delegate = new TableDelegate (this);
var listView = new HttpTransportDataSource { Entries = datasource, HttpTransportCollection = collection };
var columnNames = new List<ColumnOptions> {
new ColumnOptions{ Id = "Method", DisplayName = "", DisplayOrder = 1, Width = 60, Type = ColumnType.Text },
new ColumnOptions{ Id = "Name", DisplayName = "Name", DisplayOrder = 2, Width = 400, Type = ColumnType.Text }
};
var columns = ListViewHelper.ToNSTableColumns (columnNames);
foreach (var column in columns) {
tableView.AddColumn (column);
}
tableView.DataSource = listView;
tableView.ReloadData ();
}
示例4: ReloadTableView
public void ReloadTableView(NSTableView tableView, List<string> datasource)
{
tableView.Delegate = new TableDelegate ();
var listView = new DefaultDataSource { Entries = datasource };
tableView.DataSource = listView;
tableView.ReloadData ();
}
示例5: ReloadTableView
private void ReloadTableView(NSTableView tableView, Dictionary<string,string> datasource)
{
foreach(NSTableColumn column in tableView.TableColumns())
{
tableView.RemoveColumn (column);
}
tableView.Delegate = new TableDelegate ();
var columnNames = new List<ColumnOptions> {
new ColumnOptions{ Id = "Name", DisplayName = "Name", DisplayOrder = 1, Width = 80 },
new ColumnOptions{ Id = "Value", DisplayName = "Value", DisplayOrder = 2, Width = 200 }
};
var columns = ListViewHelper.ToNSTableColumns (columnNames);
foreach (var column in columns) {
tableView.AddColumn (column);
}
var listView = new DictionaryDataSource { Entries = datasource.Keys.ToList(), Datasource = datasource };
tableView.DataSource = listView;
tableView.ReloadData ();
}
示例6: SortDescriptorsChanged
public void SortDescriptorsChanged(NSTableView tableView, NSSortDescriptor[] oldDescriptors)
{
SortData(tableView.SortDescriptors);
tableView.ReloadData();
}
示例7: AwakeFromNib
public override void AwakeFromNib ()
{
base.AwakeFromNib ();
this.BtnClose.Activated += (object sender, EventArgs e) => {
this.Close ();
NSApplication.SharedApplication.StopModalWithCode (0);
};
TableView = new NSTableView ();
TableView.Delegate = new TableDelegate ();
TableView.Frame = new CoreGraphics.CGRect (20, 20, 450, 450);
this.MainTableView.AddSubview (TableView);
IList<ComputerDto> computers = new List<ComputerDto> ();
ActionHelper.Execute (delegate() {
var auth = SnapInContext.Instance.AuthTokenManager.GetAuthToken (ServerDto.ServerName);
computers = SnapInContext.Instance.ServiceGateway.Server.GetComputers (ServerDto, auth.Token);
});
var listView = new ComputersDataSource { Entries = computers };
var columnNames = new List<ColumnOptions> {
new ColumnOptions{ Id = "Name", DisplayName = "Computer Name", DisplayOrder = 1, Width = 300 },
new ColumnOptions{ Id = "DomainController", DisplayName = "Domain Controller", DisplayOrder = 2, Width = 130 }
};
var columns = ListViewHelper.ToNSTableColumns (columnNames);
foreach (var column in columns) {
TableView.AddColumn (column);
}
TableView.DataSource = listView;
TableView.ReloadData ();
}
示例8: SortDescriptorsChanged
public override void SortDescriptorsChanged (NSTableView tableView, NSSortDescriptor[] oldDescriptors)
{
// Sort the data
Sort (oldDescriptors [0].Key, oldDescriptors [0].Ascending);
tableView.ReloadData ();
}
示例9: AwakeFromNib
public override void AwakeFromNib ()
{
base.AwakeFromNib ();
UserDto = UserDtoOriginal.DeepCopy ();
Groups = new List<GroupDto> (GroupsOriginal);
TxtUsername.StringValue = UserDto.Name == null ? string.Empty : UserDto.Name;
TxtFirstName.StringValue = UserDto.PersonDetails.FirstName == null ? string.Empty : UserDto.PersonDetails.FirstName;
TxtLastName.StringValue = UserDto.PersonDetails.LastName == null ? string.Empty : UserDto.PersonDetails.LastName;
TxtEmail.StringValue = UserDto.PersonDetails.EmailAddress == null ? string.Empty : UserDto.PersonDetails.EmailAddress;
TxtDescription.StringValue = UserDto.PersonDetails.Description == null ? string.Empty : UserDto.PersonDetails.Description;
if (UserDto.PasswordDetails != null) {
TxtPasswordLastChanged.StringValue = DateTimeHelper.UnixToWindows ((long)UserDto.PasswordDetails.LastSet).ToString ("dd-MMM-yyyy hh:mm:ss");
TxtPasswordDaysUntilExpiry.StringValue = SecondsToDaysAndHours (UserDto.PasswordDetails.Lifetime);
}
ChDisabled.StringValue = UserDto.Disabled ? "0" : "1";
//Window.Title = UserDto.Name + "@" + UserDto.Domain + " Properties";
ChActAsUser.StringValue = UserDto.ActAsUsers ? "1" : "0";
ChIdpAdmin.StringValue = UserDto.IsIdpAdmin ? "1" : "0";
RdoRoleGroup.SelectCell (new NSCell (UserDto.Role.ToString ()));
lstGroups = new NSTableView ();
lstGroups.Delegate = new TableDelegate ();
this.LstGroupMembershipView.AddSubview (lstGroups);
var listView = new GroupsDataSource { Entries = Groups };
var columnNames = new List<ColumnOptions> {
new ColumnOptions{ Id = "Name", DisplayName = "Group Name", DisplayOrder = 1, Width = 300 }
};
var columns = ListViewHelper.ToNSTableColumns (columnNames);
foreach (var column in columns) {
lstGroups.AddColumn (column);
}
lstGroups.DataSource = listView;
lstGroups.ReloadData ();
//Events
this.BtnSave.Activated += OnClickSaveButton;
this.BtnAddGroup.Activated += OnClickAddGroupButton;
this.BtnRemoveGroup.Activated += OnClickRemoveGroupButton;
// this.BtnClose.Activated += (object sender, EventArgs e) => {
// this.Close ();
// NSApplication.SharedApplication.StopModalWithCode (0);
// };
}