Beispiel #1
0
 private bool Equals(RemainingCount other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(this.Min == other.Min &&
            this.Max == other.Max);
 }
Beispiel #2
0
 private bool Equals(RemainingCount other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return this.Min == other.Min
         && this.Max == other.Max;
 }
        private void Update(RemainingCount remainingCount, bool useCache)
        {
            Application.Current.Dispatcher.Invoke(() =>
            {
                if (!useCache)
                {
                    this.IsLoading = false;
                }
                this.IsSupported = remainingCount != null;
                if (!this.IsSupported)
                {
                    this.GaugeColor = red;
                    return;
                }

                this.RemainingCountMin = remainingCount.Min.ToString();
                this.RemainingCountMax = remainingCount.Max.ToString();
                this.RemainingCountTransportS = this._source.RemainingCountTransportS.ToString();
                this.IsInfinity = remainingCount == RemainingCount.MaxValue;
                this.GaugeColor = remainingCount.Min < 2 ? red : green;
            });
        }