Пример #1
0
        private void InitializeSloServices()
        {
            foreach (NSTableColumn column in SloTableView.TableColumns())
            {
                SloTableView.RemoveColumn(column);
            }
            SloTableView.Delegate = new TableDelegate();
            var listView = new AssertionConsumerServiceDataSource {
                Entries = RelyingPartyDto.AssertionConsumerServices
            };
            var columnNames = new List <ColumnOptions> {
                new ColumnOptions {
                    Id = "Name", DisplayName = "Name", DisplayOrder = 1, Width = 80
                },
                new ColumnOptions {
                    Id = "Endpoint", DisplayName = "Endpoint", DisplayOrder = 4, Width = 150
                },
                new ColumnOptions {
                    Id = "Binding", DisplayName = "Binding", DisplayOrder = 5, Width = 150
                }
            };
            var columns = ListViewHelper.ToNSTableColumns(columnNames);

            foreach (var column in columns)
            {
                SloTableView.AddColumn(column);
            }
            SloTableView.DataSource = listView;
            SloTableView.ReloadData();
        }
 public void OnAssertUpdate(object sender, EventArgs e)
 {
     if (AssertTableView.SelectedRows != null && (int)AssertTableView.SelectedRows.Count > 0)
     {
         var row = (int)AssertTableView.SelectedRows.FirstIndex;
         var dto = RelyingPartyDto.AssertionConsumerServices [row];
         NSApplication.SharedApplication.StopModal();
         var defaultExists = RelyingPartyDto.AssertionConsumerServices.Exists(x => x.IsDefault);
         var form          = new AddNewAssertionConsumerServiceController()
         {
             DefaultSet = defaultExists, AssertionConsumerServiceDto = dto
         };
         NSApplication.SharedApplication.RunModalForWindow(form.Window);
         if (form.IsUpdated != null)
         {
             RelyingPartyDto.AssertionConsumerServices.RemoveAt(row);
             RelyingPartyDto.AssertionConsumerServices.Add(form.AssertionConsumerServiceDto);
             var datasource = new AssertionConsumerServiceDataSource {
                 Entries = RelyingPartyDto.AssertionConsumerServices
             };
             AssertTableView.DataSource = datasource;
             AssertTableView.ReloadData();
         }
     }
 }
Пример #3
0
 public void OnRemoveAssertServices(object sender, EventArgs e)
 {
     if (AssertionTableView.SelectedRows != null && AssertionTableView.SelectedRows.Count > 0)
     {
         foreach (var row in AssertionTableView.SelectedRows)
         {
             RelyingPartyDto.AssertionConsumerServices.RemoveAt((int)row);
         }
         var datasource = new AssertionConsumerServiceDataSource {
             Entries = RelyingPartyDto.AssertionConsumerServices
         };
         AssertionTableView.DataSource = datasource;
         AssertionTableView.ReloadData();
     }
 }
        public void OnAddAssertServices(object sender, EventArgs e)
        {
            NSApplication.SharedApplication.StopModal();
            var defaultExists = RelyingPartyDto.AssertionConsumerServices.Exists(x => x.IsDefault);
            var form          = new AddNewAssertionConsumerServiceController()
            {
                DefaultSet = defaultExists
            };

            NSApplication.SharedApplication.RunModalForWindow(form.Window);
            if (form.AssertionConsumerServiceDto != null)
            {
                RelyingPartyDto.AssertionConsumerServices.Add(form.AssertionConsumerServiceDto);
                var datasource = new AssertionConsumerServiceDataSource {
                    Entries = RelyingPartyDto.AssertionConsumerServices
                };
                AssertTableView.DataSource = datasource;
                AssertTableView.ReloadData();
            }
        }