Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ClaimDeviceForm.xaml.cs
1using System;
2using System.Windows;
3using System.Windows.Controls;
5
7{
11 public partial class ClaimDeviceForm : Window
12 {
13 private MetaDataTag[] tags = null;
14
15 public ClaimDeviceForm()
16 {
18 }
19
20 private void CancelButton_Click(object Sender, RoutedEventArgs e)
21 {
22 this.DialogResult = false;
23 }
24
25 private void ClaimButton_Click(object Sender, RoutedEventArgs e)
26 {
27 this.DialogResult = true;
28 }
29
30 private void ClaimUri_TextChanged(object Sender, TextChangedEventArgs e)
31 {
32 try
33 {
34 this.tags = ThingRegistryClient.DecodeIoTDiscoClaimURI(this.ClaimUri.Text);
35
36 this.TagsListView.Items.Clear();
37
38 foreach (MetaDataTag Tag in this.tags)
39 this.TagsListView.Items.Add(Tag);
40
41 this.ClaimButton.IsEnabled = true;
42 }
43 catch (Exception)
44 {
45 this.ClaimButton.IsEnabled = false;
46 }
47 }
48
49 public MetaDataTag[] Tags => this.tags;
50 public bool MakePublic => this.Public.IsChecked.HasValue && this.Public.IsChecked.Value;
51 }
52}
Interaction logic for ClaimDeviceForm.xaml
Abstract base class for all meta-data tags.
Definition: MetaDataTag.cs:9
abstract object Value
Meta-data tag value.
Definition: MetaDataTag.cs:38
Implements an XMPP thing registry client interface.
static MetaDataTag[] DecodeIoTDiscoClaimURI(string DiscoUri)
Decodes an IoTDisco Claim URI (subset of all possible IoTDisco URIs).