示例#1
0
        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);
            }
        }
示例#2
0
        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);
                }
            }
        }