Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
RoomInvitationReceivedForm.xaml.cs
1using System;
2using System.Windows;
3
5{
9 public partial class RoomInvitationReceivedForm : Window
10 {
11 public string RoomName
12 {
13 get => this.lblRoomName.Text;
14 set => this.lblRoomName.Text = value;
15 }
16
17 public string InviteTo { set => this.lblInviteTo.Text = value; }
18 public string InviteFrom { set => this.lblInviteFrom.Text = value; }
19 public string InvitationReason { set => this.lblInvitationReason.Text = value; }
20 public string RoomJid { set => this.lblRoomJid.Text = value; }
21 public bool MembersOnly { set => this.lblMembersOnly.Text = ToStr(value); }
22 public bool Moderated { set => this.lblModerated.Text = ToStr(value); }
23 public bool NonAnonymous { set => this.lblNonAnonymous.Text = ToStr(value); }
24 public bool Open { set => this.lblOpen.Text = ToStr(value); }
25 public bool PasswordProtected { set => this.lblPasswordProtected.Text = ToStr(value); }
26 public bool Persistent { set => this.lblPersistent.Text = ToStr(value); }
27 public bool Public { set => this.lblPublic.Text = ToStr(value); }
28 public bool SemiAnonymous { set => this.lblSemiAnonymous.Text = ToStr(value); }
29 public bool Temporary { set => this.lblTemporary.Text = ToStr(value); }
30 public bool Unmoderated { set => this.lblUnmoderated.Text = ToStr(value); }
31 public bool Unsecured { set => this.lblUnsecured.Text = ToStr(value); }
32
34 {
36 }
37
38 private static string ToStr(bool b)
39 {
40 return b ? "✓" : string.Empty;
41 }
42
43 private void CancelButton_Click(object Sender, RoutedEventArgs e)
44 {
45 this.DialogResult = false;
46 }
47
48 private void NickName_TextChanged(object Sender, System.Windows.Controls.TextChangedEventArgs e)
49 {
50 this.AcceptButton.IsEnabled = !string.IsNullOrEmpty(this.NickName.Text) && AllLetters(this.NickName.Text);
51 }
52
53 private static bool AllLetters(string s)
54 {
55 foreach (char ch in s)
56 {
57 if (!char.IsLetterOrDigit(ch))
58 return false;
59 }
60
61 return true;
62 }
63
64 private void AcceptButton_Click(object Sender, RoutedEventArgs e)
65 {
66 this.DialogResult = true;
67 }
68
69 private void DeclineButton_Click(object Sender, RoutedEventArgs e)
70 {
71 this.DialogResult = false;
72 }
73 }
74}
Interaction logic for RoomInvitationReceivedForm.xaml