Exemple #1
0
        private void InitializeSignatureAlgorithm()
        {
            //_signatureAlgorithmView = new NSTableView ();
            foreach (NSTableColumn column in SignAlgoTableView.TableColumns())
            {
                SignAlgoTableView.RemoveColumn(column);
            }
            SignAlgoTableView.Delegate = new TableDelegate();
            //this.LstSignatureAlgorithm.AddSubview (_signatureAlgorithmView);
            var listView = new SignatureAlgorithmDataSource {
                Entries = RelyingPartyDto.SignatureAlgorithms
            };
            var columnNames = new List <ColumnOptions> {
                new ColumnOptions {
                    Id = "MaxKeySize", DisplayName = "Max Key Size", DisplayOrder = 1, Width = 80
                },
                new ColumnOptions {
                    Id = "MinKeySize", DisplayName = "Min Key Size", DisplayOrder = 2, Width = 80
                },
                new ColumnOptions {
                    Id = "Priority", DisplayName = "Priority", DisplayOrder = 3, Width = 80
                }
            };
            var columns = ListViewHelper.ToNSTableColumns(columnNames);

            foreach (var column in columns)
            {
                SignAlgoTableView.AddColumn(column);
            }
            SignAlgoTableView.DataSource = listView;
            SignAlgoTableView.ReloadData();
        }
Exemple #2
0
 public void OnRemoveSignatureAlgorithm(object sender, EventArgs e)
 {
     if (SignAlgoTableView.SelectedRows != null && SignAlgoTableView.SelectedRows.Count > 0)
     {
         foreach (var row in SignAlgoTableView.SelectedRows)
         {
             RelyingPartyDto.SignatureAlgorithms.RemoveAt((int)row);
         }
         var datasource = new SignatureAlgorithmDataSource {
             Entries = RelyingPartyDto.SignatureAlgorithms
         };
         SignAlgoTableView.DataSource = datasource;
         SignAlgoTableView.ReloadData();
     }
 }
Exemple #3
0
        public void OnAddSignatureAlgorithm(object sender, EventArgs e)
        {
            NSApplication.SharedApplication.StopModal();
            var form = new AddNewSignatureAlgorithmController();

            NSApplication.SharedApplication.RunModalForWindow(form.Window);
            if (form.SignatureAlgorithmDto != null)
            {
                RelyingPartyDto.SignatureAlgorithms.Add(form.SignatureAlgorithmDto);
                var datasource = new SignatureAlgorithmDataSource {
                    Entries = RelyingPartyDto.SignatureAlgorithms
                };
                SignAlgoTableView.DataSource = datasource;
                SignAlgoTableView.ReloadData();
            }
        }
Exemple #4
0
 public void OnSignatureAlgorithmUpdate(object sender, EventArgs e)
 {
     if (SignAlgoTableView.SelectedRows != null && (int)SignAlgoTableView.SelectedRows.Count > -1)
     {
         var row = (int)SignAlgoTableView.SelectedRows.FirstIndex;
         var dto = RelyingPartyDto.SignatureAlgorithms [row];
         NSApplication.SharedApplication.StopModal();
         var form = new AddNewSignatureAlgorithmController()
         {
             SignatureAlgorithmDto = dto
         };
         NSApplication.SharedApplication.RunModalForWindow(form.Window);
         if (form.IsUpdated != null)
         {
             RelyingPartyDto.SignatureAlgorithms.RemoveAt(row);
             RelyingPartyDto.SignatureAlgorithms.Add(form.SignatureAlgorithmDto);
             var datasource = new SignatureAlgorithmDataSource {
                 Entries = RelyingPartyDto.SignatureAlgorithms
             };
             SignAlgoTableView.DataSource = datasource;
             SignAlgoTableView.ReloadData();
         }
     }
 }