public MainWindowVmBase() { _exeVer = CurrentExe.GetVersion(); ExitCmd = R2Command.Async(_ => ExitApp(false)); RelaunchCmd = R2Command.Async(_ => ExitApp(true)); AppendToCaption("..."); }
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)); }
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"; }
public MainWindowVmBase() { _exeVer = CurrentExe.GetVersion(); ExitCmd = R2Command.Async(ExitApp); AppendToCaption("..."); }
private static string GetExeInfo() { try { return($"{CurrentExe.GetShortName()} v.{CurrentExe.GetVersion()}"); } catch { return(""); } }
public Task SetExeVersion() => _conn.UpdateNode(CurrentExe.GetVersion(), NodePath, nameof(AgentState.ExeVersion));
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();
protected override void OnInitialized(EventArgs e) { base.OnInitialized(e); this.Title += $" {CurrentExe.GetVersion()}"; }