Add and use PEPIdentity.DisplayString property in the UI.
authorDean
Thu, 08 Sep 2016 12:58:27 +0200
changeset 12514fe048bff67e
parent 1250 e219136cec9d
child 1252 25f1d6633620
Add and use PEPIdentity.DisplayString property in the UI.
PEPIdentity.cs
UI/FormControlHandshake.xaml
UI/FormControlHandshake.xaml.cs
UI/FormControlOptions.xaml
     1.1 --- a/PEPIdentity.cs	Thu Sep 08 12:31:27 2016 +0200
     1.2 +++ b/PEPIdentity.cs	Thu Sep 08 12:58:27 2016 +0200
     1.3 @@ -94,6 +94,15 @@
     1.4          }
     1.5  
     1.6          /// <summary>
     1.7 +        /// Gets the string to display for this identity (based on Username and Address).
     1.8 +        /// This internally will call .ToString().
     1.9 +        /// </summary>
    1.10 +        public string DisplayString
    1.11 +        {
    1.12 +            get { return (this.ToString()); }
    1.13 +        }
    1.14 +
    1.15 +        /// <summary>
    1.16          /// Gets or sets the pEp engine fingerprint of the identity.
    1.17          /// </summary>
    1.18          public string Fingerprint
     2.1 --- a/UI/FormControlHandshake.xaml	Thu Sep 08 12:31:27 2016 +0200
     2.2 +++ b/UI/FormControlHandshake.xaml	Thu Sep 08 12:58:27 2016 +0200
     2.3 @@ -56,7 +56,7 @@
     2.4                         HorizontalAlignment="Right" />
     2.5              <TextBlock Grid.Column="2"
     2.6                         Grid.Row="0"
     2.7 -                       Text="{Binding Path=PartnerString, FallbackValue=&lt;partner&gt;}"
     2.8 +                       Text="{Binding Path=Partner.DisplayString, FallbackValue=&lt;partner&gt;}"
     2.9                         TextWrapping="Wrap" />
    2.10              <TextBlock Grid.Column="0"
    2.11                         Grid.Row="2"
    2.12 @@ -64,7 +64,7 @@
    2.13                         HorizontalAlignment="Right" />
    2.14              <TextBlock Grid.Column="2"
    2.15                         Grid.Row="2"
    2.16 -                       Text="{Binding Path=MyselfString, FallbackValue=&lt;myself&gt;}"
    2.17 +                       Text="{Binding Path=Myself.DisplayString, FallbackValue=&lt;myself&gt;}"
    2.18                         TextWrapping="Wrap" />
    2.19          </Grid>
    2.20  
     3.1 --- a/UI/FormControlHandshake.xaml.cs	Thu Sep 08 12:31:27 2016 +0200
     3.2 +++ b/UI/FormControlHandshake.xaml.cs	Thu Sep 08 12:58:27 2016 +0200
     3.3 @@ -275,32 +275,12 @@
     3.4                  {
     3.5                      this._Myself = value;
     3.6                      this.RaisePropertyChangedEvent(nameof(this.Myself));
     3.7 -                    this.RaisePropertyChangedEvent(nameof(this.MyselfString));
     3.8  
     3.9                      this.CalcDependentProperties();
    3.10                  }
    3.11              }
    3.12  
    3.13              /// <summary>
    3.14 -            /// Gets the display string for the myself identity.
    3.15 -            /// This is directly calculated from Myself.
    3.16 -            /// </summary>
    3.17 -            public string MyselfString
    3.18 -            {
    3.19 -                get
    3.20 -                {
    3.21 -                    if (this._Myself != null)
    3.22 -                    {
    3.23 -                        return (this._Myself.ToString());
    3.24 -                    }
    3.25 -                    else
    3.26 -                    {
    3.27 -                        return ("");
    3.28 -                    }
    3.29 -                }
    3.30 -            }
    3.31 -
    3.32 -            /// <summary>
    3.33              /// Gets the text indicating myself.
    3.34              /// </summary>
    3.35              public string MyselfText
    3.36 @@ -318,32 +298,12 @@
    3.37                  {
    3.38                      this._Partner = value;
    3.39                      this.RaisePropertyChangedEvent(nameof(this.Partner));
    3.40 -                    this.RaisePropertyChangedEvent(nameof(this.PartnerString));
    3.41  
    3.42                      this.CalcDependentProperties();
    3.43                  }
    3.44              }
    3.45  
    3.46              /// <summary>
    3.47 -            /// Gets the display string for the partner identity.
    3.48 -            /// This is directly calculated from Partner.
    3.49 -            /// </summary>
    3.50 -            public string PartnerString
    3.51 -            {
    3.52 -                get
    3.53 -                {
    3.54 -                    if (this._Partner != null)
    3.55 -                    {
    3.56 -                        return (this._Partner.ToString());
    3.57 -                    }
    3.58 -                    else
    3.59 -                    {
    3.60 -                        return ("");
    3.61 -                    }
    3.62 -                }
    3.63 -            }
    3.64 -
    3.65 -            /// <summary>
    3.66              /// Gets the text indicating partner.
    3.67              /// </summary>
    3.68              public string PartnerText
    3.69 @@ -487,10 +447,8 @@
    3.70                  this.RaisePropertyChangedEvent(nameof(this.FingerprintText));
    3.71                  this.RaisePropertyChangedEvent(nameof(this.Mode));
    3.72                  this.RaisePropertyChangedEvent(nameof(this.Myself));
    3.73 -                this.RaisePropertyChangedEvent(nameof(this.MyselfString));
    3.74                  this.RaisePropertyChangedEvent(nameof(this.MyselfText));
    3.75                  this.RaisePropertyChangedEvent(nameof(this.Partner));
    3.76 -                this.RaisePropertyChangedEvent(nameof(this.PartnerString));
    3.77                  this.RaisePropertyChangedEvent(nameof(this.PartnerText));
    3.78                  this.RaisePropertyChangedEvent(nameof(this.SelectedTabItemIndex));
    3.79                  this.RaisePropertyChangedEvent(nameof(this.TrustwordsCulture));
     4.1 --- a/UI/FormControlOptions.xaml	Thu Sep 08 12:31:27 2016 +0200
     4.2 +++ b/UI/FormControlOptions.xaml	Thu Sep 08 12:58:27 2016 +0200
     4.3 @@ -459,7 +459,7 @@
     4.4                                              <TextBlock Grid.Column="0"
     4.5                                                         Grid.Row="0"
     4.6                                                         HorizontalAlignment="Left"
     4.7 -                                                       Text="{Binding Path=Key.Username, Mode=OneWay}"
     4.8 +                                                       Text="{Binding Path=Key.DisplayString, Mode=OneWay}"
     4.9                                                         TextWrapping="Wrap" />
    4.10                                              <TextBlock Grid.Column="0"
    4.11                                                         Grid.Row="1"