本文整理汇总了C#中NSTableColumn.DataCellForRow方法的典型用法代码示例。如果您正苦于以下问题:C# NSTableColumn.DataCellForRow方法的具体用法?C# NSTableColumn.DataCellForRow怎么用?C# NSTableColumn.DataCellForRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NSTableColumn
的用法示例。
在下文中一共展示了NSTableColumn.DataCellForRow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetCell
/// <summary>
/// Gets the cell.
/// </summary>
/// <returns>The cell.</returns>
/// <param name="outlineView">Outline view.</param>
/// <param name="tableColumn">Table column.</param>
/// <param name="item">Item.</param>
public override NSCell GetCell (NSOutlineView outlineView, NSTableColumn tableColumn, Foundation.NSObject item)
{
nint row = outlineView.RowForItem (item);
return tableColumn.DataCellForRow (row);
}
示例2: GetObjectValue
public NSObject GetObjectValue(NSTableView tableView, NSTableColumn tableColumn, nint row)
{
if (IsViewReady) {
Employee emp = DataStore.Employees[(int)row];
switch (tableColumn.Identifier)
{
case "FirstName":
return new NSString(emp.FirstName);
case "LastName":
return new NSString(emp.LastName);
case "DepartmentName":
NSPopUpButtonCell button = tableColumn.DataCellForRow(row) as NSPopUpButtonCell;
button.RemoveAllItems();
foreach(Department dep in DataStore.Departments) {
button.Menu.AddItem(dep.Name, new ObjCRuntime.Selector("departmentSelected:"), "");
}
return button;
default:
return new NSString("");
}
}
else return new NSString("");
}