/// <summary> /// ctor which needs the appcast url and a referenceassembly /// </summary> /// <param name="appcastUrl">the URL for the appcast file</param> /// <param name="referenceAssembly">the reference assembly</param> /// <param name="showDiagnostic">show the diagnostics window.</param> public Sparkle(String appcastUrl, String referenceAssembly, bool showDiagnostic) { // preconfige ssl trust TrustEverySSLConnection = false; // configure ssl cert link ServicePointManager.ServerCertificateValidationCallback += RemoteCertificateValidation; // enable visual style to ensure that we have XP style or higher // also in WPF applications System.Windows.Forms.Application.EnableVisualStyles(); // reset vars ApplicationIcon = null; _AppReferenceAssembly = null; // set var this.ShowDiagnosticWindow = showDiagnostic; _diagnostic = new NetSparkleDiagnostic(showDiagnostic); // set the reference assembly if (referenceAssembly != null) { _AppReferenceAssembly = referenceAssembly; _diagnostic.Report("Checking the following file: " + _AppReferenceAssembly); } // show if needed ShowDiagnosticWindowIfNeeded(); // adjust the delegates _worker.WorkerReportsProgress = true; _worker.DoWork += new DoWorkEventHandler(OnWorkerDoWork); _worker.ProgressChanged += new ProgressChangedEventHandler(OnWorkerProgressChanged); // build the wait handle _exitHandle = new EventWaitHandle(false, EventResetMode.AutoReset); _loopingHandle = new EventWaitHandle(false, EventResetMode.ManualReset); // set the url _AppCastUrl = appcastUrl; _diagnostic.Report("Using the following url: " + _AppCastUrl); }
/// <summary> /// ctor which needs the appcast url and a referenceassembly /// </summary> /// <param name="appcastUrl">the URL for the appcast file</param> /// <param name="referenceAssembly">the reference assembly</param> /// <param name="showDiagnostic">show the diagnostics window.</param> public Sparkle(String appcastUrl, String referenceAssembly, bool showDiagnostic) { // preconfige ssl trust TrustEverySSLConnection = false; // configure ssl cert link ServicePointManager.ServerCertificateValidationCallback += RemoteCertificateValidation; // enable visual style to ensure that we have XP style or higher // also in WPF applications System.Windows.Forms.Application.EnableVisualStyles(); // reset vars ApplicationIcon = null; _AppReferenceAssembly = null; // set var this.ShowDiagnosticWindow = showDiagnostic; _diagnostic = new NetSparkleDiagnostic(showDiagnostic); // set the reference assembly if (referenceAssembly != null) { _AppReferenceAssembly = referenceAssembly; _diagnostic.Report("Checking the following file: " + _AppReferenceAssembly); } // show if needed ShowDiagnosticWindowIfNeeded(); // adjust the delegates _worker.WorkerReportsProgress = true; _worker.DoWork += new DoWorkEventHandler(OnWorkerDoWork); _worker.ProgressChanged += new ProgressChangedEventHandler(OnWorkerProgressChanged); // build the wait handle _exitHandle = new EventWaitHandle(false, EventResetMode.AutoReset); _loopingHandle = new EventWaitHandle(false, EventResetMode.ManualReset); // set the url _AppCastUrl = appcastUrl; _diagnostic.Report("Using the following url: " + _AppCastUrl); }