Esempio n. 1
0
        /// <summary>
        /// Gets the object value. Hopefully this will handle the Notes into the view.
        /// </summary>
        /// <returns>
        /// The object value.
        /// </returns>
        /// <param name='tableView'>
        /// Table view.
        /// </param>
        /// <param name='tableColumn'>
        /// Table column.
        /// </param>
        /// <param name='row'>
        /// Row.
        /// </param>
        public override MonoMac.Foundation.NSObject GetObjectValue(MonoMac.AppKit.NSTableView tableView,
                                                                   MonoMac.AppKit.NSTableColumn tableColumn,
                                                                   int row)
        {
            //noteTitle
            NSString valueKey = null;
            String   currNote = (String)notesList [row];
            Note     note     = notes [currNote];

            if (tableColumn.Identifier != null)
            {
                valueKey = (NSString)tableColumn.Identifier.ToString();
            }


            switch (valueKey)
            {
            case "noteTitle":
                return((NSString)note.Title);

            case "colNoteModifiedDate":
                return((NSString)note.ChangeDate.ToString());
            }
            throw new System.Exception(string.Format("Incorrect value requested '{0}'", valueKey));
        }
Esempio n. 2
0
            public override MonoMac.Foundation.NSObject GetObjectValue(MonoMac.AppKit.NSTableView tableView, MonoMac.AppKit.NSTableColumn tableColumn, int rowIndex)
            {
                var valueKey = (string)(NSString)tableColumn.Identifier;
                var dataRow  = _app.villains[rowIndex];

                switch ((string)valueKey)
                {
                case "name":
                    return((NSString)dataRow.Name);

                case "mugshot":
                    return(dataRow.Mugshot);

                case "lastSeenDate":
                    return((NSDate)dataRow.LastSeenDate);
                }

                throw new Exception(string.Format("Incorrect value requested '{0}'", (string)valueKey));
            }