private void CheckUpdate() { using (CIV.CentralCenterClient.CentralCenterServiceReference.CentralCenterSoapClient client = new CIV.CentralCenterClient.CentralCenterServiceReference.CentralCenterSoapClient()) { if (client.IsCompatibleClient(App.VersionStr())) { if (client.IsLastVersion("CIV", CurrentVersion.ToString())) DoUpdateNotAvailable(); else { CIV.CentralCenterClient.CentralCenterServiceReference.ReleaseBO lastReleaseBO = client.GetLastVersion("CIV"); _lastVersion = new CIVVersion(lastReleaseBO.Number); if (LastVersion.CompareTo(CurrentVersion) > 0) { FileRelease release = new FileRelease() { Number = new CIVVersion(lastReleaseBO.Number), Release = lastReleaseBO.Release, Size = lastReleaseBO.Size, Url = lastReleaseBO.Url, History = lastReleaseBO.History, CRC = lastReleaseBO.CRC }; DoUpdateAvailable(new UpdateAvailabledEventArgs(release)); } else DoUpdateNotAvailable(); } } else if (IsNotCompatibleClient != null) IsNotCompatibleClient(this, null); } }
public About() { InitializeComponent(); this.DataContext = this; Components = new ObservableCollection <Component>(); this.Title = CIV.strings.About_Title; if (Environment.Is64BitProcess) { lblVersion.Text = String.Format("{0} (64 Bits)", App.VersionLongStr()); } else { lblVersion.Text = String.Format("{0} (32 Bits)", App.VersionLongStr()); } string[] assemblyList = new string[] { System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Hardcodet.Wpf.TaskbarNotification.dll"), System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ZedGraph.dll"), System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ICSharpCode.SharpZipLib.dll") }; AssemblyName assemblyName; foreach (string item in assemblyList) { assemblyName = AssemblyName.GetAssemblyName(item); Components.Add(new Component() { Name = assemblyName.Name, Version = assemblyName.Version.ToString() }); } Assembly sqlAssembly = AppDomain.CurrentDomain.GetAssemblies().SingleOrDefault(p => p.FullName.Substring(0, 23) == "System.Data.SqlServerCe"); if (sqlAssembly != null) { assemblyName = new AssemblyName(sqlAssembly.FullName); Components.Add(new Component() { Name = assemblyName.Name, Version = assemblyName.Version.ToString() }); } ThreadStart start = delegate() { try { CIV.CentralCenterClient.CentralCenterServiceReference.CentralCenterSoapClient client = new CIV.CentralCenterClient.CentralCenterServiceReference.CentralCenterSoapClient(); string version = client.RunningVersion(); this.Dispatch(p => p.lblCentralCenter.Text = version); } catch { } }; new Thread(start).Start(); }
private void CheckUpdate() { using (CIV.CentralCenterClient.CentralCenterServiceReference.CentralCenterSoapClient client = new CIV.CentralCenterClient.CentralCenterServiceReference.CentralCenterSoapClient()) { if (client.IsCompatibleClient(App.VersionStr())) { if (client.IsLastVersion("CIV", CurrentVersion.ToString())) { DoUpdateNotAvailable(); } else { CIV.CentralCenterClient.CentralCenterServiceReference.ReleaseBO lastReleaseBO = client.GetLastVersion("CIV"); _lastVersion = new CIVVersion(lastReleaseBO.Number); if (LastVersion.CompareTo(CurrentVersion) > 0) { FileRelease release = new FileRelease() { Number = new CIVVersion(lastReleaseBO.Number), Release = lastReleaseBO.Release, Size = lastReleaseBO.Size, Url = lastReleaseBO.Url, History = lastReleaseBO.History, CRC = lastReleaseBO.CRC }; DoUpdateAvailable(new UpdateAvailabledEventArgs(release)); } else { DoUpdateNotAvailable(); } } } else if (IsNotCompatibleClient != null) { IsNotCompatibleClient(this, null); } } }