示例#1
0
        // SplitView Events

        public void OnDoubleClickedTableView(object sender, EventArgs e)
        {
            int row = (int)splitViewController.MainTableView.SelectedRow;
            INSTableViewDataSource ds = splitViewController.MainTableView.DataSource;

            if (ds is ZoneDetailsListView)
            {
                VMDNSZoneEntryNode zoneNode = (ds as ZoneDetailsListView).Entries[row];
                zoneNode.ShowProperties();
            }
            else if (ds is DnsRecordListView)
            {
                VMDNSZoneEntryNode zoneNode = (ds as DnsRecordListView).ZoneNode;
                VmDnsRecord        record   = (ds as DnsRecordListView).Entries[(int)row];
                zoneNode.ShowRecordProperties(sender, e, record);
            }
        }
        /// <summary>
        /// Gets the icon for row.
        /// </summary>
        /// <returns>The icon for row.</returns>
        /// <param name="row">Row.</param>
        /// <param name="source">Source.</param>
        private NSImage GetIconForRow(nint row, INSTableViewDataSource source)
        {
            NSImage icon = null;

            if (source is PscDataSource)
            {
                icon = GetImageOnNodeType((PscDataSource)source, row, _ob);
            }
            else if (source is NodeDataSource)
            {
                icon = GetImageOnNodeType((NodeDataSource)source, row, _ob);
            }
            else if (source is ServiceDataSource)
            {
                icon = _ob.CachedImages [(int)ImageIndex.Service];
            }
            return(icon);
        }