public static void CheckUpdate(IRemoteConfig config, string updateDialogTitle, string updateDialogText) { var assemblyVersion = Assembly.GetExecutingAssembly().GetName().Version; int major = 0; int minor = 0; int build = 0; int revision = 0; string[] parts = config.UpdateVersion.Split(new string[] { "." }, StringSplitOptions.RemoveEmptyEntries); if (parts.Length == 4) { int.TryParse(parts[0], out major); int.TryParse(parts[1], out minor); int.TryParse(parts[2], out build); int.TryParse(parts[3], out revision); } if (IsUpdateVersionNewer(assemblyVersion, major, minor, build, revision)) { string version = string.Format("{0}.{1}.{2}.{3}", major, minor, build, revision); string text = string.Format(updateDialogText, assemblyVersion.ToString(), version); if (MessageForm.Show( text, updateDialogTitle, MessageBoxButtons.YesNo, MessageBoxIcon.Information, DialogResult.Yes) == DialogResult.Yes) { System.Diagnostics.Process.Start(config.UpdateUrl); System.Diagnostics.Process.GetCurrentProcess().Kill(); } } }
public RemoteConfig(IRemoteConfig config) : base() { SystemName = config.SystemName; WelcomeMessage = config.WelcomeMessage; Image = config.Image; Url = config.Url; UpdateVersion = config.UpdateVersion; UpdateUrl = config.UpdateUrl; }
public ListBooksViewModel(IRemoteConfig remoteConfig) { _remoteConfig = remoteConfig; _restClient = new RestClient(); LoadItemsCommand = new Command(async() => await LoadItems(SearchCriteria), () => !IsBusy); SearchBookCommand = new Command(async() => await SearchBooksAsync(SearchCriteria), () => !IsBusy); Title = "List of Books"; SearchCriteria = ""; Items = new ObservableCollection <Volume>(); MessageNotFound = "No book could be found......"; }
public FetchConfigResponse(Guid requestId, IRemoteConfig config, List<Group> groups) : base(requestId) { Config = new RemoteConfig(config); Groups = groups; }
private void GetConfigComplete(IRemoteConfig remoteConfig, IEnumerable<Group> groups, Exception exception) { Status.RemoteConfig = remoteConfig; Status.Groups = groups; this.exception = exception; this.run = false; }
public DailyMissionManager(ILocalDatabase localDatabase, IRemoteDatabase remoteDatabase, IRemoteConfig remoteConfig) { _localDatabase = localDatabase; _remoteDatabase = remoteDatabase; _remoteConfig = remoteConfig; }