示例#1
0
 private void InitDisplay()
 {
     display.Children.Clear();
     if (!app.Connection.IsLogged)
     {
         display.Children.Add(loginControl);
         tbi.ToolTipText = "Please login with SLT portal credentials";
     }
     else
     {
         ProfileManager profileManager = new ProfileManager(app.Connection);
         Profile profile = profileManager.GetProfile();
         widgetControl.lblPeakStatus.Content = profile.PeakStatus;
         widgetControl.lblTotalStatus.Content = profile.TotalStatus;
         display.Children.Add(widgetControl);
         tbi.ToolTipText = "Peak: " + profile.PeakStatus + ", Total: " + profile.TotalStatus;
     }
 }
示例#2
0
 private void FetchAndDisplayProfile(object source, ElapsedEventArgs e)
 {
     ProfileManager profileManager = new ProfileManager(app.Connection);
     Profile profile = profileManager.GetProfile();
     this.Dispatcher.Invoke((Action)(() => {
         widgetControl.lblPeakStatus.Content = profile.PeakStatus;
         widgetControl.lblTotalStatus.Content = profile.TotalStatus;
         tbi.ToolTipText = "Peak: " + profile.PeakStatus + ", Total: " + profile.TotalStatus;
     }));
 }