public MainWindow() { InitializeComponent(); // Load! if (KNUserDefaults.StandardUserDefaults().ObjectForKey("Keys") != null) { foreach (Dictionary <string, object> dict in (ArrayList)KNUserDefaults.StandardUserDefaults().ObjectForKey("Keys")) { keys.Add(new UpdateSigningKey(dict)); } } KNTableView keyTable = new KNTableView(); keyTable.CornerCell = new KNLeopardCornerCell(); KNCell cell = new KNTextCell(); ((KNTextCell)cell).IsEditable = true; KNTableColumnDelegate del = null; KNHeaderCell header = new KNLeopardStyleHeaderCell("Name", false, true, System.Drawing.StringAlignment.Near); KNTableColumn col = new KNTableColumn("name", ref cell, ref header, ref del); col.Width = (int)KeyListHost.Width; keyTable.AddColumn(col); keyTable.TableDelegate = this; keyTable.DataSource = this; keyTable.AlternatingRowBackgrounds = true; keyTable.CellPerformedAction += Action; keyTable.SelectionChanged += TableSelectionChanged; KeyListHost.Child = keyTable; KNLeopardStyleHeaderButton button = new KNLeopardStyleHeaderButton(); button.Enabled = false; ButtonBarHost.Child = button; SUUpdater updater = SUUpdater.SharedUpdater(); this.AddObserverToKeyPathWithOptions(this, "SelectedKey", KNKeyValueObservingOptions.KNKeyValueObservingOptionInitial, null); }
public bool ShouldSelectRow(ref KNTableView tableView, int rowIndex) { return(true); }
public object ObjectForRow(ref KNTableView tableView, ref KNTableColumn tableColumn, int rowIndex) { return(((UpdateSigningKey)keys[rowIndex]).Name); }
public SortOrder ColumnHeaderClicked(ref KNTableView tableView, ref KNTableColumn column, SortOrder suggestedNewSortOrder) { return(suggestedNewSortOrder); }
public int NumberOfItemsInTableView(ref KNTableView tableView) { return(keys.Count); }