コード例 #1
0
        /// <summary>Called by the engine to allow the user experience to change the source using <see cref="M:Engine.SetLocalSource"/> or <see cref="M:Engine.SetDownloadSource"/>.</summary>
        /// <param name="args">The arguments of the event.</param>
        protected override void OnResolveSource(Wix.ResolveSourceEventArgs args)
        {
            LogVerbose("Enter Method: OnResolveSource");
            WPFBootstrapperEventArgs <Wix.ResolveSourceEventArgs> cancelArgs = new WPFBootstrapperEventArgs <Wix.ResolveSourceEventArgs>(args);

            TryInvoke(new Action(() => { _mainWindow.OnResolveSource(cancelArgs); }));
            if (!cancelArgs.Cancel)
            {
                args.Result = !string.IsNullOrEmpty(args.DownloadSource) ? Wix.Result.Download : Wix.Result.Ok;
                base.OnResolveSource(cancelArgs.Arguments);
            }
            LogVerbose("Leaving Method: OnResolveSource");
        }
コード例 #2
0
        /// <summary>Called by the engine to allow the user experience to change the source using <see cref="M:Engine.SetLocalSource"/> or <see cref="M:Engine.SetDownloadSource"/>.</summary>
        /// <param name="args">The arguments of the event.</param>
        protected override void OnResolveSource(Wix.ResolveSourceEventArgs args)
        {
            this.LogBootstrapperEnterEvent(args, "ResolveSource");
            WPFBootstrapperEventArgs <Wix.ResolveSourceEventArgs> cancelArgs = new WPFBootstrapperEventArgs <Wix.ResolveSourceEventArgs>(args);

            this.TryInvoke(new Action(() => { this.model.OnResolveSource(cancelArgs); }));
            if (!cancelArgs.Cancel)
            {
                args.Result = !string.IsNullOrEmpty(args.DownloadSource) ? Wix.Result.Download : Wix.Result.Ok;
                base.OnResolveSource(cancelArgs.Arguments);
            }
            this.LogBootstrapperLeaveEvent(null, "ResolveSource");
        }
コード例 #3
0
		void ResolveSource(object sender, ResolveSourceEventArgs e)
		{
			int retries = 0;

			_downloadRetries.TryGetValue(e.PackageOrContainerId, out retries);
			_downloadRetries[e.PackageOrContainerId] = retries + 1;

			e.Result = retries < 3 && !String.IsNullOrEmpty(e.DownloadSource) ? Result.Download : Result.Ok;
		}
コード例 #4
0
ファイル: PagedViewModel.cs プロジェクト: jardrake03/incert
        private void ResolveSource(object sender, ResolveSourceEventArgs e)
        {
            Logger.Standard("Resolve source request received");
            Logger.Standard("download source: {0}", e.DownloadSource);
            Logger.Standard("local source: {0}", e.LocalSource);
            Logger.Standard("package id: {0}", e.PackageOrContainerId);
            Logger.Standard("payload id: {0}", e.PayloadId);

            if (!_resolvePrompt)
            {
                Logger.Standard("Attempting to find local source");
                BaseModel.SetLocalSource(e.PackageOrContainerId, e.PayloadId, FindSource(e.LocalSource));
                _resolvePrompt = true;
                e.Result = Result.Retry;
            }
            else
            {
                e.Result = Result.Error;
            }
        }
コード例 #5
0
ファイル: BootstrapperApplication.cs プロジェクト: zooba/wix3
        Result IBootstrapperApplication.OnResolveSource(string wzPackageOrContainerId, string wzPayloadId, string wzLocalSource, string wzDownloadSource)
        {
            ResolveSourceEventArgs args = new ResolveSourceEventArgs(wzPackageOrContainerId, wzPayloadId, wzLocalSource, wzDownloadSource);
            this.OnResolveSource(args);

            return args.Result;
        }
コード例 #6
0
ファイル: BootstrapperApplication.cs プロジェクト: zooba/wix3
 /// <summary>
 /// Called by the engine to allow the user experience to change the source
 /// using <see cref="M:Engine.SetLocalSource"/> or <see cref="M:Engine.SetDownloadSource"/>.
 /// </summary>
 /// <param name="args">Additional arguments for this event.</param>
 protected virtual void OnResolveSource(ResolveSourceEventArgs args)
 {
     EventHandler<ResolveSourceEventArgs> handler = this.ResolveSource;
     if (null != handler)
     {
         handler(this, args);
     }
 }
コード例 #7
0
		private void OnResolveSource(object sender, ResolveSourceEventArgs e)
		{
			e.Result = !string.IsNullOrEmpty(e.DownloadSource) ? Result.Download : Result.Ok;
		}
コード例 #8
0
        private void ResolveSource(object sender, ResolveSourceEventArgs e)
        {
            //Bootstrapper.Model.Bootstrapper.Engine.Log(LogLevel.Verbose, string.Format("Entering ResolveSource. DownloadSource: {0} LocalSource: {1}", e.DownloadSource, e.LocalSource));
            int retries;

            _downloadRetries.TryGetValue(e.PackageOrContainerId, out retries);
            _downloadRetries[e.PackageOrContainerId] = retries + 1;
            e.Result = retries < 3 && !String.IsNullOrEmpty(e.DownloadSource) ? Result.Download : Result.Ok;
            if (e.Result == Result.Download) Message = "Downloading " + e.PackageOrContainerId;
            else Message = "Caching " + e.PackageOrContainerId;
            //Bootstrapper.Model.Bootstrapper.Engine.Log(LogLevel.Verbose, string.Format("Leaving ResolveSource. DownloadSource: {0} LocalSource: {1}", e.DownloadSource, e.LocalSource));
        }