コード例 #1
0
        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);
        }
コード例 #2
0
 public bool ShouldSelectRow(ref KNTableView tableView, int rowIndex)
 {
     return(true);
 }
コード例 #3
0
 public object ObjectForRow(ref KNTableView tableView, ref KNTableColumn tableColumn, int rowIndex)
 {
     return(((UpdateSigningKey)keys[rowIndex]).Name);
 }
コード例 #4
0
 public SortOrder ColumnHeaderClicked(ref KNTableView tableView, ref KNTableColumn column, SortOrder suggestedNewSortOrder)
 {
     return(suggestedNewSortOrder);
 }
コード例 #5
0
 public int NumberOfItemsInTableView(ref KNTableView tableView)
 {
     return(keys.Count);
 }