コード例 #1
0
 public void OnAttributeUpdate(object sender, EventArgs e)
 {
     if (AttributeTableView.SelectedRows != null && (int)AttributeTableView.SelectedRows.Count > 0)
     {
         var row = (int)AttributeTableView.SelectedRows.FirstIndex;
         var dto = RelyingPartyDto.AttributeConsumerServices [row];
         NSApplication.SharedApplication.StopModal();
         var defaultExists = RelyingPartyDto.AttributeConsumerServices.Exists(x => x.IsDefault);
         var form          = new AddNewAttributeConsumerServiceController()
         {
             DefaultSet = defaultExists, AttributeConsumerServiceDto = dto
         };
         NSApplication.SharedApplication.RunModalForWindow(form.Window);
         if (form.IsUpdated != null)
         {
             RelyingPartyDto.AttributeConsumerServices.RemoveAt(row);
             RelyingPartyDto.AttributeConsumerServices.Add(form.AttributeConsumerServiceDto);
             var datasource = new AttributeConsumerServiceDataSource {
                 Entries = RelyingPartyDto.AttributeConsumerServices
             };
             AttributeTableView.DataSource = datasource;
             AttributeTableView.ReloadData();
         }
     }
 }
コード例 #2
0
        public void OnAddAttributeServices(object sender, EventArgs e)
        {
            NSApplication.SharedApplication.StopModal();
            var defaultExists = RelyingPartyDto.AttributeConsumerServices.Exists(x => x.IsDefault);
            var form          = new AddNewAttributeConsumerServiceController()
            {
                DefaultSet = defaultExists
            };

            NSApplication.SharedApplication.RunModalForWindow(form.Window);
            if (form.AttributeConsumerServiceDto != null)
            {
                RelyingPartyDto.AttributeConsumerServices.Add(form.AttributeConsumerServiceDto);
                var datasource = new AttributeConsumerServiceDataSource {
                    Entries = RelyingPartyDto.AttributeConsumerServices
                };
                AttributeTableView.DataSource = datasource;
                AttributeTableView.ReloadData();
            }
        }
コード例 #3
0
		public void OnAddAttributeServices (object sender, EventArgs e)
		{
			NSApplication.SharedApplication.StopModal ();
			var defaultExists = RelyingPartyDto.AttributeConsumerServices.Exists (x => x.IsDefault);
			var form = new AddNewAttributeConsumerServiceController (){ DefaultSet = defaultExists };
			NSApplication.SharedApplication.RunModalForWindow (form.Window);
			if (form.AttributeConsumerServiceDto != null) {
				RelyingPartyDto.AttributeConsumerServices.Add (form.AttributeConsumerServiceDto);
				var datasource = new AttributeConsumerServiceDataSource { Entries = RelyingPartyDto.AttributeConsumerServices };
				AttributeTableView.DataSource = datasource;
				AttributeTableView.ReloadData ();
			}
		}
コード例 #4
0
		public void OnAttributeUpdate (object sender, EventArgs e)
		{
			if (AttributeTableView.SelectedRows != null && (int)AttributeTableView.SelectedRows.Count > 0) {
				var row = (int)AttributeTableView.SelectedRows.FirstIndex;
				var dto = RelyingPartyDto.AttributeConsumerServices [row];
				NSApplication.SharedApplication.StopModal ();
				var defaultExists = RelyingPartyDto.AttributeConsumerServices.Exists (x => x.IsDefault);
				var form = new AddNewAttributeConsumerServiceController (){ DefaultSet = defaultExists, AttributeConsumerServiceDto = dto };
				NSApplication.SharedApplication.RunModalForWindow (form.Window);
				if (form.IsUpdated != null) {
					RelyingPartyDto.AttributeConsumerServices.RemoveAt (row);
					RelyingPartyDto.AttributeConsumerServices.Add (form.AttributeConsumerServiceDto);
					var datasource = new AttributeConsumerServiceDataSource { Entries = RelyingPartyDto.AttributeConsumerServices };
					AttributeTableView.DataSource = datasource;
					AttributeTableView.ReloadData ();
				}
			}
		}
コード例 #5
0
 public TableDelegate(AddNewAttributeConsumerServiceController controller)
 {
     _controller = controller;
 }
			public TableDelegate (AddNewAttributeConsumerServiceController controller)
			{
				_controller = controller;
			}