Esempio n. 1
0
 public MainWindowVmBase()
 {
     _exeVer     = CurrentExe.GetVersion();
     ExitCmd     = R2Command.Async(_ => ExitApp(false));
     RelaunchCmd = R2Command.Async(_ => ExitApp(true));
     AppendToCaption("...");
 }
Esempio n. 2
0
        private static string ComposeSessionJson(IHubClientSettings cfg)
        {
            var sess = new HubClientSession
            {
                UserAgent    = cfg.UserAgent,
                AgentVersion = CurrentExe.GetVersion(),
                ComputerName = Environment.MachineName,
                //JsonConfig   = JsonConvert.SerializeObject(cfg),
                JsonConfig = cfg.ReadSavedFile(),
            };

            return(JsonConvert.SerializeObject(sess));
        }
Esempio n. 3
0
        private void GatherDetails()
        {
            _sessionKey = Guid.NewGuid().ToString();
            _userName   = Environment.UserName;
            _osName     = GetWindowsFriendlyName();

            _version      = CurrentExe.GetVersion();
            _application  = $"{ Assembly.GetEntryAssembly().GetName().Name} {_version}";
            _manufacturer = (from x in
                             new ManagementObjectSearcher("SELECT Manufacturer FROM Win32_ComputerSystem").Get()
                             .OfType <ManagementObject>()
                             select x.GetPropertyValue("Manufacturer")).FirstOrDefault()?.ToString() ?? "Unknown";
            _model = (from x in
                      new ManagementObjectSearcher("SELECT Model FROM Win32_ComputerSystem").Get()
                      .OfType <ManagementObject>()
                      select x.GetPropertyValue("Model")).FirstOrDefault()?.ToString() ?? "Unknown";
        }
Esempio n. 4
0
 public MainWindowVmBase()
 {
     _exeVer = CurrentExe.GetVersion();
     ExitCmd = R2Command.Async(ExitApp);
     AppendToCaption("...");
 }
Esempio n. 5
0
 private static string GetExeInfo()
 {
     try   { return($"{CurrentExe.GetShortName()} v.{CurrentExe.GetVersion()}"); }
     catch { return(""); }
 }
Esempio n. 6
0
 public Task SetExeVersion()
 => _conn.UpdateNode(CurrentExe.GetVersion(),
                     NodePath,
                     nameof(AgentState.ExeVersion));
Esempio n. 7
0
 public static void Show(string caption,
                         string message,
                         MessageBoxImage messageBoxImage   = MessageBoxImage.Information,
                         MessageBoxButton messageBoxButton = MessageBoxButton.OK)
 => new Thread(new ThreadStart(delegate
 {
     var longCap = $"   {caption}  [{DateTime.Now.ToShortTimeString()}]  -  {CurrentExe.GetShortName()} v.{CurrentExe.GetVersion()}";
     MessageBox.Show(message, longCap, messageBoxButton, messageBoxImage);
 }
                               )).Start();
Esempio n. 8
0
 protected override void OnInitialized(EventArgs e)
 {
     base.OnInitialized(e);
     this.Title += $"  {CurrentExe.GetVersion()}";
 }