public override void SetObjectValue (NSTableView tableView, NSObject theObject, NSTableColumn tableColumn, int row) { NSString newNSValue = theObject as NSString; if (newNSValue == null) return; string newValue = newNSValue.ToString (); int columnIndex = tableView.FindColumn ((NSString)tableColumn.Identifier); BookmarkManager.Entry entry = entries[row]; switch (columnIndex) { case 0: if (!string.IsNullOrWhiteSpace (newValue)) entry.Name = newValue; break; case 1: entry.Notes = newValue; break; case 2: if (!string.IsNullOrWhiteSpace (newValue)) entry.Url = newValue; break; default: break; } manager.CommitBookmarkChange (entry); }
public override NSObject GetObjectValue (NSTableView tableView, NSTableColumn tableColumn, int row) { if (tableColumn == null) return null; int columnIndex = tableView.FindColumn ((NSString)tableColumn.Identifier); switch (columnIndex) { case 0: return new NSString (entries[row].Name); case 1: return new NSString (entries[row].Notes); case 2: return new NSString (entries[row].Url); default: return null; } }