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();
         }
     }
 }
        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();
            }
        }
 public void OnRemoveAssertServices(object sender, EventArgs e)
 {
     if (RelyingPartyDto.AssertionConsumerServices != null &&
         RelyingPartyDto.AssertionConsumerServices.Count > 0)
     {
         if (AssertTableView.SelectedRows != null && AssertTableView.SelectedRows.Count > 0)
         {
             foreach (var row in AssertTableView.SelectedRows)
             {
                 if (row > 0 && (int)row < RelyingPartyDto.AssertionConsumerServices.Count)
                 {
                     RelyingPartyDto.AssertionConsumerServices.RemoveAt((int)row);
                 }
             }
             var datasource = new AssertionConsumerServiceDataSource {
                 Entries = RelyingPartyDto.AssertionConsumerServices
             };
             AssertTableView.DataSource = datasource;
             AssertTableView.ReloadData();
         }
     }
 }
        private void InitializeAssertionConsumerServices()
        {
            foreach (NSTableColumn column in AssertTableView.TableColumns())
            {
                AssertTableView.RemoveColumn(column);
            }
            AssertTableView.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 = "Index", DisplayName = "Index", DisplayOrder = 2, Width = 80
                },
                new ColumnOptions {
                    Id = "IsDefault", DisplayName = "Default", DisplayOrder = 3, 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)
            {
                AssertTableView.AddColumn(column);
            }
            AssertTableView.DataSource = listView;
            AssertTableView.ReloadData();
        }
        void ReleaseDesignerOutlets()
        {
            if (AssertTableView != null)
            {
                AssertTableView.Dispose();
                AssertTableView = null;
            }

            if (AttributeTableView != null)
            {
                AttributeTableView.Dispose();
                AttributeTableView = null;
            }

            if (BtnAddAssertServices != null)
            {
                BtnAddAssertServices.Dispose();
                BtnAddAssertServices = null;
            }

            if (BtnAddAttributeService != null)
            {
                BtnAddAttributeService.Dispose();
                BtnAddAttributeService = null;
            }

            if (BtnAddSignAlgo != null)
            {
                BtnAddSignAlgo.Dispose();
                BtnAddSignAlgo = null;
            }

            if (BtnApply != null)
            {
                BtnApply.Dispose();
                BtnApply = null;
            }

            if (BtnAddSloService != null)
            {
                BtnAddSloService.Dispose();
                BtnAddSloService = null;
            }

            if (BtnRemoveSloService != null)
            {
                BtnRemoveSloService.Dispose();
                BtnRemoveSloService = null;
            }

            if (BtnBrowseCertificate != null)
            {
                BtnBrowseCertificate.Dispose();
                BtnBrowseCertificate = null;
            }

            if (BtnRemoveAssertService != null)
            {
                BtnRemoveAssertService.Dispose();
                BtnRemoveAssertService = null;
            }

            if (BtnRemoveAttributeService != null)
            {
                BtnRemoveAttributeService.Dispose();
                BtnRemoveAttributeService = null;
            }

            if (BtnRemoveSignAlgo != null)
            {
                BtnRemoveSignAlgo.Dispose();
                BtnRemoveSignAlgo = null;
            }

            if (BtnViewCertificate != null)
            {
                BtnViewCertificate.Dispose();
                BtnViewCertificate = null;
            }

            if (ChkSign != null)
            {
                ChkSign.Dispose();
                ChkSign = null;
            }

            if (SignAlgorithmTableView != null)
            {
                SignAlgorithmTableView.Dispose();
                SignAlgorithmTableView = null;
            }

            if (SloServicesTableView != null)
            {
                SloServicesTableView.Dispose();
                SloServicesTableView = null;
            }

            if (TxtCertificate != null)
            {
                TxtCertificate.Dispose();
                TxtCertificate = null;
            }

            if (TxtRpName != null)
            {
                TxtRpName.Dispose();
                TxtRpName = null;
            }

            if (TxtUrl != null)
            {
                TxtUrl.Dispose();
                TxtUrl = null;
            }
        }