wyDay.Controls.AutomaticUpdaterBackend.ForceCheckForUpdate C# (CSharp) Method

ForceCheckForUpdate() public method

Check for updates forcefully -- returns true if the updating has begun. Use the "CheckingFailed", "UpdateAvailable", or "UpToDate" events for the result.
public ForceCheckForUpdate ( bool recheck ) : bool
recheck bool Recheck with the servers regardless of cached updates, etc.
return bool
        public bool ForceCheckForUpdate(bool recheck)
        {
            if (AutoUpdaterInfo == null)
                throw new FailedToInitializeException();

            // if not already checking for updates then begin checking.
            if (UpdateStepOn == UpdateStepOn.Nothing || (recheck && UpdateStepOn == UpdateStepOn.UpdateAvailable))
            {
                BeforeArgs bArgs = new BeforeArgs();

                if (BeforeChecking != null)
                    BeforeChecking(this, bArgs);

                if (bArgs.Cancel)
                {
                    // close wyUpdate
                    updateHelper.Cancel();
                    return false;
                }

                // show the working animation
                UpdateStepOn = UpdateStepOn.Checking;

                if (recheck)
                    updateHelper.ForceRecheckForUpdate();
                else
                    updateHelper.CheckForUpdate();

                return true;
            }

            return false;
        }

Same methods

AutomaticUpdaterBackend::ForceCheckForUpdate ( ) : bool

Usage Example

Exemplo n.º 1
0
        AutomaticUpdaterBackend updater; //this is what we are adding

        public MainWindow() // remember to change this to UpdateWindow if above changed
        {
            System.Threading.Thread.Sleep(3000); //We are telling program to pause here 

            InitializeComponent(); // now lets start

            updater = new AutomaticUpdaterBackend() // we still have to properly define AutoUpBackend
            {
                GUID = "06AF8C3C-BA10-4938-9D4C-5CAC43A006A7", // have to define this thing as well :/
                UpdateType = UpdateType.CheckAndDownload, // What type of update is you doing?
            }; // f*****g semicolon

            // we define the updater things

            updater.CheckingFailed += Updater_CheckingFailed;
            
            updater.UpdateAvailable += OnUpdateAvailable;
            updater.DownloadingFailed += OnDownloadingFailed;
            updater.ExtractingFailed += OnExtractingFailed;
            //alot of things fail
            updater.ReadyToBeInstalled += OnReadyToBeInstalled;
            updater.UpdateSuccessful += OnUpdateSuccessful;
            updater.UpdateFailed += OnFailed;
            updater.UpToDate += OnUpToDate;

            // telling the updater we are good to go
            updater.Initialize();
            updater.AppLoaded();

            updater.ForceCheckForUpdate(); // the most controversial command

            // Console.WriteLine("legggo b0$$");

        }
All Usage Examples Of wyDay.Controls.AutomaticUpdaterBackend::ForceCheckForUpdate