private void OnReceivingUpdateInfo(ProductUpdateInfo _updateInfo)
        {
            // New update is not available
            if (!_updateInfo.NewUpdateAvailable)
            {
                if (!m_isAutomaticCheck)
                {
                    string _uptoDateMessage = string.Format(kAlreadyUptoDateMessage, ProductName);

                    // Show update prompt dialog
                    ShowUpdatePrompt(ProductName, _uptoDateMessage);
                }

                return;
            }

            // Cache update info
            m_productUpdateInfo = _updateInfo;

            // User has already skipped download for this version
            string _versionNO = m_productUpdateInfo.VersionNumber;

            if (m_isAutomaticCheck && EditorPrefs.GetBool(GetKeyForSkippedVersion(_versionNO), false))
            {
                return;
            }

            // New update is available
            string        _updateAvailableMessage = string.Format(kNewVersionAvailableMessage, ProductName);
            string        _releaseNote            = "Release Note:\n\n" + _updateInfo.ReleaseNote;
            List <string> _buttonNames            = new List <string>();

            // Check if download from asset store is allowed
            if (!string.IsNullOrEmpty(_updateInfo.AssetStoreLink))
            {
                _buttonNames.Add(Constants.kButtonDownloadFromAssetStore);
            }

            // Check if download from our server is allowed
            if (!string.IsNullOrEmpty(_updateInfo.DownloadLink))
            {
                _buttonNames.Add(Constants.kButtonDownloadFromOurServer);
            }

            // It will have skip button
            _buttonNames.Add(Constants.kButtonSkipVersion);

            // Show update prompt dialog
            ShowUpdatePrompt(ProductName, _updateAvailableMessage, _releaseNote, _buttonNames.ToArray());
        }
예제 #2
0
        private void RequestForUpdatesSuccess(IDictionary _responseDict)
        {
            WebResponse       _response = WebResponse.WebResponseOnSuccess(_responseDict);
            ProductUpdateInfo _updateInfo;

            if (_response.Status == 200)
            {
                _updateInfo = new ProductUpdateInfo(ProductVersion, _response.Data);
            }
            else
            {
                _updateInfo = new ProductUpdateInfo(false);
            }

            // Process update info data
            OnReceivingUpdateInfo(_updateInfo);

            ResetFieldsRelatedToUpdateCheck();
        }
예제 #3
0
        public BaseResponse UpdateProductInfo(ProductUpdateInfo info)
        {
            return Execute(_repository, r =>
            {
                var res = r.UpdateProductInfo(info);

                _cacheHelper.ClearGetProducts();

                return res;
            });
        }
		private void OnReceivingUpdateInfo (ProductUpdateInfo _updateInfo)
		{
			// New update is not available
			if (!_updateInfo.NewUpdateAvailable)
			{
				if (!m_isAutomaticCheck)
				{
					string _uptoDateMessage	= string.Format(kAlreadyUptoDateMessage, ProductName);

					// Show update prompt dialog
					ShowUpdatePrompt(ProductName, _uptoDateMessage);
				}

				return;
			}
			
			// Cache update info
			m_productUpdateInfo				= _updateInfo;

			// User has already skipped download for this version
			string _versionNO				= m_productUpdateInfo.VersionNumber;

			if (m_isAutomaticCheck && EditorPrefs.GetBool(GetKeyForSkippedVersion(_versionNO), false))
			{
				return;
			}

			// New update is available
			string _updateAvailableMessage	= string.Format(kNewVersionAvailableMessage, ProductName);
			string _releaseNote				= "Release Note:\n\n" + _updateInfo.ReleaseNote;
			List<string> _buttonNames		= new List<string>();

			// Check if download from asset store is allowed
			if (!string.IsNullOrEmpty(_updateInfo.AssetStoreLink))
			{
				_buttonNames.Add(Constants.kButtonDownloadFromAssetStore);
			}

			// Check if download from our server is allowed
			if (!string.IsNullOrEmpty(_updateInfo.DownloadLink))
			{
				_buttonNames.Add(Constants.kButtonDownloadFromOurServer);
			}
			
			// It will have skip button
			_buttonNames.Add(Constants.kButtonSkipVersion);

			// Show update prompt dialog
			ShowUpdatePrompt(ProductName, _updateAvailableMessage, _releaseNote, _buttonNames.ToArray());
		}
		private void RequestForUpdatesSuccess (IDictionary _responseDict)
		{
			WebResponse			_response	= WebResponse.WebResponseOnSuccess(_responseDict);
			ProductUpdateInfo 	_updateInfo;

			if (_response.Status == 200)
			{
				_updateInfo = new ProductUpdateInfo(ProductVersion, _response.Data);
			}
			else
			{
				_updateInfo	= new ProductUpdateInfo(false);
			}

			// Process update info data
			OnReceivingUpdateInfo(_updateInfo);

			// Reset
			ResetFieldsRelatedToUpdateCheck();
		}
예제 #6
0
        public BaseResponse UpdateProductInfo(ProductUpdateInfo info)
        {
            var response = new BaseResponse();

            using (var db = DbContext)
            {
                var entityDb = new Entity.Product { Id = info.Id };
                db.Products.Attach(entityDb);

                var changed = false;

                if (changed)
                {
                    response.Success = db.SaveChanges() > 0;
                }
            }

            return response;
        }