private static string GetGroupVersionInfo([NotNull] List <GroupInfo> groupInfos) { return($"{groupInfos.JoinToString(GetGroupInfo, "\n")}"); string GetGroupInfo(GroupInfo groupInfo) { var info = $"{groupInfo.GroupName}: вер. {groupInfo.VersionLocal} ({groupInfo.VersionLocalDate:dd.MM.yy HH:mm})"; if (groupInfo.UpdateRequired) { info += $", на сервере {groupInfo.VersionServer} ({groupInfo.VersionServerDate:dd.MM.yy HH:mm})"; } if (CheckUpdates.NeedNotify(groupInfo.UpdateDescription, out var descResult)) { info += $" '{descResult.Truncate(75)}'"; } if (groupInfo.GroupName == Commands.GroupCommon) { info += ". Alt+стрелка, предыдущее выделение."; } return(info); } }
private static void ExecuteInternal(out string version, out string newVersion, out bool hasUpdate) { CheckUpdates svc = new CheckUpdates(); Assembly ass = Assembly.GetExecutingAssembly(); version = ass.GetName().Version.ToString(); newVersion = String.Empty; hasUpdate = svc.HasUpdate("PragmaSQL", pi.CurrentCodeName.ToString(), version, ref newVersion); }
private void checkUpdatesToolStripMenuItem_Click(object sender, EventArgs e) { var checkUpdates = new CheckUpdates { StartPosition = FormStartPosition.CenterParent }; if (checkUpdates.ShowDialog() == DialogResult.OK) { checkUpdates.Dispose(); } }
public static void Start() { _contextMenu = new ContextMenu(); var openMenuItem = new MenuItem("Show"); openMenuItem.Click += (s, e) => Show?.Invoke(null, EventArgs.Empty); _contextMenu.MenuItems.Add(openMenuItem); _contextMenu.MenuItems.Add(new MenuItem("-")); var checkUpdatesMenuItem = new MenuItem("Check Updates"); checkUpdatesMenuItem.Click += (s, e) => CheckUpdates?.Invoke(null, EventArgs.Empty); _contextMenu.MenuItems.Add(checkUpdatesMenuItem); var aboutMenuItem = new MenuItem("About RoboChat..."); aboutMenuItem.Click += (s, e) => About?.Invoke(null, EventArgs.Empty); _contextMenu.MenuItems.Add(aboutMenuItem); _contextMenu.MenuItems.Add(new MenuItem("-")); var closeMenuItem = new MenuItem("Exit"); closeMenuItem.Click += (s, e) => App.Current.Shutdown(); _contextMenu.MenuItems.Add(closeMenuItem); _notifyIcon = new NotifyIcon() { Icon = Properties.Resources.RoboChat32, ContextMenu = _contextMenu, Text = Settings.Instance.Name, Visible = true }; _notifyIcon.MouseClick += (s, e) => { if (e.Button != MouseButtons.Left) { return; } if (Toggle == null) { Message(ToolTipIcon.Warning, "Application is closing. Please wait..."); } Toggle?.Invoke(null, EventArgs.Empty); }; _notifyIcon.BalloonTipClicked += _notifyIcon_BalloonTipClicked; }
private static void _notifyIcon_BalloonTipClicked(object sender, EventArgs e) { // Если это системное сообщение if (_notifyIcon.BalloonTipTitle == Settings.TitleUpdate) { CheckUpdates?.Invoke(null, EventArgs.Empty); } string windowTitle = _notifyIcon.Tag as string; if (windowTitle != null && windowTitle.Length > 0) { OpenWindow?.Invoke(null, new WindowEventArgs(windowTitle)); } }
public Form1() { InitializeComponent(); form1 = this; this.StyleManager = mSM; ds = messageBoxCaller; mSM.Style = MetroFramework.MetroColorStyle.Purple; mSM.Theme = MetroFramework.MetroThemeStyle.Dark; comboVersion.SelectedIndex = 0; MsgDwnldUpt = messageBoxCaller; messaged = messageBoxCaller; installer = new Installer(ref form1, messaged, progressProg); CheckUpdate = new CheckUpdates("EasyVysorPro", Application.ProductVersion, Constants.vysorServerDownload, MsgDwnldUpt, progressProg, notifyIcon1, panelUpdateDownloading, labelUpdate); }
public static void Save() { var ini = new Dictionary <string, Dictionary <string, string> >(); ini["UI"] = new Dictionary <string, string>(); ini["Audio"] = new Dictionary <string, string>(); ini["MIDI"] = new Dictionary <string, string>(); ini["UI"]["DpiScaling"] = DpiScaling.ToString(); ini["UI"]["CheckUpdates"] = CheckUpdates.ToString(); ini["Audio"]["InstrumentStopTime"] = InstrumentStopTime.ToString(); ini["MIDI"]["Device"] = MidiDevice; Directory.CreateDirectory(GetConfigFilePath()); IniFile.WriteINI(GetConfigFileName(), ini); }
private void Application_Startup(object sender, StartupEventArgs e) { if (e.Args.Length > 0) { _isUpdateUpdater = Convert.ToBoolean(e.Args[0]); } #if !DEBUG var checkUpdates = CheckUpdates.Check(App.Version, _isUpdateUpdater, ScreamControl.Controller.Properties.Settings.Default.IsStealthMode); checkUpdates.Wait(); if (!checkUpdates.Result) { this.Shutdown(); } #endif Language = ScreamControl.Controller.Properties.Settings.Default.CurrentLanguage; MainWindow window = new MainWindow(); window.DataContext = new MainViewModel(); window.Show(); }
private void Application_Startup(object sender, StartupEventArgs e) { Trace.TraceInformation("Scream Control startup..."); Trace.Indent(); if (e.Args.Length > 0) { foreach (string item in e.Args) { switch (item) { case "d": _isDebugMode = true; break; default: _isUpdateUpdater = Convert.ToBoolean(item); break; } } } #if !DEBUG var checkUpdates = CheckUpdates.Check(App.Version, _isUpdateUpdater, ScreamControl.Client.Properties.Settings.Default.IsStealthMode, _isDebugMode); checkUpdates.Wait(); if (!checkUpdates.Result) { this.Shutdown(); } #endif Language = ScreamControl.Client.Properties.Settings.Default.CurrentLanguage; MainWindow window = new MainWindow(_isDebugMode); window.DataContext = new MainViewModel(); window.Show(); Trace.Unindent(); Trace.TraceInformation("... Done"); }
public void Initialize() { #if DEBUG // Отключение отладочных сообщений биндинга (тормозит сильно) PresentationTraceSources.DataBindingSource.Switch.Level = SourceLevels.Off; #endif try { AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; Logger.Log.Info("start Initialize AcadLib"); StatusBarEx.AddPaneUserGroup(); PluginStatisticsHelper.StartAutoCAD(); if (PikSettings.IsDisabledSettings) { Logger.Log.Info("Настройки отключены (PikSettings.IsDisabledSettings) - загрузка прервана."); return; } Notify.SetScreenSettings(new NotifyOptions(with: 400)); CheckUpdates.Start(); if (Settings.Default.UpgradeRequired) { Settings.Default.Upgrade(); Settings.Default.UpgradeRequired = false; Settings.Default.Save(); } PaletteSetCommands.Init(); AllCommandsCommon(); // Автослоиtest AutoLayersService.Init(); // Загрузка сборок из папки ../Script/Net - без вложенных папок LoadService.LoadFromFolder(Path.Combine(PikSettings.LocalSettingsFolder, @"Script\NET"), 1); // Обработка чертежей DocAuto.Start(); // Лента RibbonBuilder.InitRibbon(); Logger.Log.Info("end Initialize AcadLib"); AcadLibAssembly.AcadLoadInfo(); if (AutocadUserService.User == null) { Logger.Log.Warn("Настройки группы пользователя не заданы - открытие окна настроек пользователя."); UserSettingsService.Show(); } // Восстановление вкладок чCheckUpdatesNotifyертежей //Utils.Tabs.RestoreTabs.Init(); // Фаталит у Черновой ExcelPackage.LicenseContext = LicenseContext.NonCommercial; Logger.Log.Info("AcadLib Initialize end success."); } catch (Exception ex) { $"PIK. Ошибка загрузки AcadLib, версия:{AcadLibVersion} - {ex.Message}.".WriteToCommandLine(); Logger.Log.Error(ex, "AcadLib Initialize."); } }
public void PIK_CheckUpdates() { CommandStart.Start(d => CheckUpdates.CheckUpdatesNotify(false)); }
private void CheckUpdatesStartUp(object sender, EventArgs e) { try { CheckUpdates.RunWorkerAsync(); } catch { } }