Пример #1
0
 public void OnAssertUpdate(object sender, EventArgs e)
 {
     if (AssertionTableView.SelectedRows != null && (int)AssertionTableView.SelectedRows.Count > -1)
     {
         var row = (int)AssertionTableView.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
             };
             AssertionTableView.DataSource = datasource;
             AssertionTableView.ReloadData();
         }
     }
 }
Пример #2
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();
     }
 }
Пример #3
0
        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
                };
                AssertionTableView.DataSource = datasource;
                AssertionTableView.ReloadData();
            }
        }
Пример #4
0
        private void InitializeAssertionConsumerServices()
        {
            foreach (NSTableColumn column in AssertionTableView.TableColumns())
            {
                AssertionTableView.RemoveColumn(column);
            }
            AssertionTableView.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)
            {
                AssertionTableView.AddColumn(column);
            }
            AssertionTableView.DataSource = listView;
            AssertionTableView.ReloadData();
        }
Пример #5
0
        void ReleaseDesignerOutlets()
        {
            if (BtnAddAssertServices != null)
            {
                BtnAddAssertServices.Dispose();
                BtnAddAssertServices = null;
            }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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