private void InitializeSloServices()
        {
            foreach (NSTableColumn column in SloTableView.TableColumns())
            {
                SloTableView.RemoveColumn(column);
            }
            SloTableView.Delegate = new TableDelegate();
            var listView = new ServiceEndpointDataSource {
                Entries = ExternalIdentityProviderDto.SloServices
            };
            var columnNames = new List <ColumnOptions> {
                new ColumnOptions {
                    Id = "Name", DisplayName = "Name", DisplayOrder = 1, Width = 150
                },
                new ColumnOptions {
                    Id = "Endpoint", DisplayName = "Endpoint", DisplayOrder = 4, Width = 200
                },
                new ColumnOptions {
                    Id = "Binding", DisplayName = "Binding", DisplayOrder = 5, Width = 200
                }
            };
            var columns = ListViewHelper.ToNSTableColumns(columnNames);

            foreach (var column in columns)
            {
                SloTableView.AddColumn(column);
            }
            SloTableView.DataSource = listView;
            SloTableView.ReloadData();
        }
Ejemplo n.º 2
0
 public void OnRemoveSloServices(object sender, EventArgs e)
 {
     if (SloTableView.SelectedRows != null && SloTableView.SelectedRows.Count > 0)
     {
         foreach (var row in SloTableView.SelectedRows)
         {
             RelyingPartyDto.SingleLogoutServices.RemoveAt((int)row);
         }
         var datasource = new ServiceEndpointDataSource {
             Entries = RelyingPartyDto.SingleLogoutServices
         };
         SloTableView.DataSource = datasource;
         SloTableView.ReloadData();
     }
 }
 private void OnRemoveSloServices(object sender, EventArgs e)
 {
     if (LstSlo.SelectedRows.Count > 0)
     {
         foreach (var row in LstSlo.SelectedRows)
         {
             ExternalIdentityProviderDto.SloServices.RemoveAt((int)row);
         }
         var datasource = new ServiceEndpointDataSource {
             Entries = ExternalIdentityProviderDto.SloServices
         };
         LstSlo.DataSource = datasource;
         LstSlo.ReloadData();
     }
 }
        public void OnAddSloServices(object sender, EventArgs e)
        {
            NSApplication.SharedApplication.StopModal();
            var form = new AddNewServiceEndpointController();

            NSApplication.SharedApplication.RunModalForWindow(form.Window);
            if (form.ServiceEndpointDto != null)
            {
                RelyingPartyDto.SingleLogoutServices.Add(form.ServiceEndpointDto);
                var datasource = new ServiceEndpointDataSource {
                    Entries = RelyingPartyDto.SingleLogoutServices
                };
                SloServicesTableView.DataSource = datasource;
                SloServicesTableView.ReloadData();
            }
        }
 private void OnAddSloServices(object sender, EventArgs e)
 {
     if (IsSloServiceValid())
     {
         var endpointDto = new ServiceEndpointDto {
             Name     = TxtSloName.StringValue,
             Endpoint = TxtSloEndpoint.StringValue,
             Binding  = TxtSloBinding.StringValue
         };
         ExternalIdentityProviderDto.SloServices.Add(endpointDto);
         var datasource = new ServiceEndpointDataSource {
             Entries = ExternalIdentityProviderDto.SloServices
         };
         LstSlo.DataSource = datasource;
         LstSlo.ReloadData();
         TxtSloName.StringValue     = (NSString)string.Empty;
         TxtSloEndpoint.StringValue = (NSString)string.Empty;
         TxtSloBinding.StringValue  = (NSString)string.Empty;
     }
 }
 public void OnSloUpdate(object sender, EventArgs e)
 {
     if (SloServicesTableView.SelectedRows != null && (int)SloServicesTableView.SelectedRows.Count > 0)
     {
         var row = (int)SloServicesTableView.SelectedRows.FirstIndex;
         var dto = RelyingPartyDto.SingleLogoutServices [row];
         NSApplication.SharedApplication.StopModal();
         var form = new AddNewServiceEndpointController()
         {
             ServiceEndpointDto = dto
         };
         NSApplication.SharedApplication.RunModalForWindow(form.Window);
         if (form.IsUpdated != null)
         {
             RelyingPartyDto.SingleLogoutServices.RemoveAt(row);
             RelyingPartyDto.SingleLogoutServices.Add(form.ServiceEndpointDto);
             var datasource = new ServiceEndpointDataSource {
                 Entries = RelyingPartyDto.SingleLogoutServices
             };
             SloServicesTableView.DataSource = datasource;
             SloServicesTableView.ReloadData();
         }
     }
 }