public override NSMenu MenuForEvent(NSEvent theEvent) { NSTableViewDataSource ds = (NSTableViewDataSource)this.DataSource; NSMenu menu = new NSMenu(); if (SelectedRow >= (nint)0) { if (ds is AttributesEntryListView) { VMDirSchemaAttributeEntryNode node = (ds as AttributesEntryListView).Entries[(int)SelectedRow]; NSMenuItem properties = new NSMenuItem(VMDirSchemaConstants.VMDIRSCHEMA_PROPERTIES, node.ShowProperties); menu.AddItem(properties); } else if (ds is ObjectClassesListView) { VMDirSchemaClassEntryNode node = (ds as ObjectClassesListView).Entries[(int)SelectedRow]; NSMenuItem properties = new NSMenuItem(VMDirSchemaConstants.VMDIRSCHEMA_PROPERTIES, node.ShowProperties); menu.AddItem(properties); } else { //do nothing } } NSMenu.PopUpContextMenu(menu, theEvent, theEvent.Window.ContentView); return(base.MenuForEvent(theEvent)); }
protected override void OnInitialize(AsyncStatus status) { base.OnInitialize(status); this.Columns[0].Title = VMDirSchemaConstants.VMDIRSCHEMA_NAME; this.Columns[0].SetWidth(130); this.Columns.Add(new MmcListViewColumn(VMDirSchemaConstants.VMDIRSCHEMA_OPTIONAL_ATTR, 130)); this.Columns.Add(new MmcListViewColumn(VMDirSchemaConstants.VMDIRSCHEMA_ATTR_SYNTAX, 130)); this.Mode = MmcListViewMode.Report; ClassNode = this.ScopeNode as VMDirSchemaClassEntryNode; ClassNode.ListView = this; UIErrorHelper.CheckedExec(delegate() { Refresh(); }); }
public NSObject ObjectValueForTableColumn(NSTableView table, NSTableColumn col, int row) { NSString value = NSString.Empty; try { if (Entries != null) { VMDirSchemaClassEntryNode record = Entries[row]; switch (col.Identifier) { case VMDirSchemaConstants.VMDIRSCHEMA_NAME: value = (NSString)record.DisplayName; break; case VMDirSchemaConstants.VMDIRSCHEMA_CLASS_TYPE: value = (NSString)record.ObjectClassDto.GetObjectClassTypeAsString(); break; case VMDirSchemaConstants.VMDIRSCHEMA_DESC: value = (NSString)record.ObjectClassDto.Description; break; } } } catch (Exception) { value = NSString.Empty; } return(value); }
public ClassAttributesEntryListView(VMDirSchemaClassEntryNode node) { ClassNode = node; //fetch attributes from schema manager for this object class. if (node != null) { List <AttributeTypeDTO> required = node.ServerNode.ServerDTO.Connection.SchemaManager.GetRequiredAttributes(ClassNode.DisplayName); required.ForEach(x => x.IsOptional = false); List <AttributeTypeDTO> optional = node.ServerNode.ServerDTO.Connection.SchemaManager.GetOptionalAttributes(ClassNode.DisplayName); optional.ForEach(x => x.IsOptional = true); AttributeEntries = required; AttributeEntries.AddRange(optional); } }