示例#1
0
        public override async Task <BlameFile> GetBlameAsync(BlameOptions options, IProgress <OperationProgress> progress, CancellationToken cancellationToken)
        {
            Verify.Argument.IsNotNull(options, nameof(options));

            progress?.Report(new OperationProgress(Resources.StrsFetchingBlame.AddEllipsis()));
            var parameters = GetParameters(options);
            var result     = await Repository
                             .Accessor
                             .QueryBlame
                             .InvokeAsync(parameters, progress, cancellationToken);

            progress?.Report(OperationProgress.Completed);
            return(result);

            //return Repository
            //	.Accessor
            //	.QueryBlame
            //	.InvokeAsync(parameters, progress, cancellationToken)
            //	.ContinueWith(
            //		t =>
            //		{
            //			progress?.Report(OperationProgress.Completed);
            //			return TaskUtility.UnwrapResult(t);
            //		},
            //		cancellationToken,
            //		TaskContinuationOptions.ExecuteSynchronously,
            //		TaskScheduler.Default);
        }
示例#2
0
        private static BlameOptions GetDefault()
        {
            var options = new BlameOptions();

            options.Freeze();
            return(options);
        }
示例#3
0
        public override BlameFile GetBlame(BlameOptions options)
        {
            Verify.Argument.IsNotNull(options, nameof(options));

            var parameters = GetParameters(options);

            return(Repository.Accessor.QueryBlame.Invoke(parameters));
        }
示例#4
0
        private QueryBlameParameters GetParameters(BlameOptions options)
        {
            Assert.IsNotNull(options);

            var parameters = new QueryBlameParameters()
            {
                Revision = Revision.Pointer,
                FileName = FileName,
            };

            return(parameters);
        }
示例#5
0
        public override Task <BlameFile> GetBlameAsync(BlameOptions options, IProgress <OperationProgress> progress, CancellationToken cancellationToken)
        {
            Verify.Argument.IsNotNull(options, "options");

            if (progress != null)
            {
                progress.Report(new OperationProgress(Resources.StrsFetchingBlame.AddEllipsis()));
            }
            var parameters = GetParameters(options);

            return(Repository.Accessor.QueryBlame.InvokeAsync(parameters, progress, cancellationToken)
                   .ContinueWith(
                       t =>
            {
                if (progress != null)
                {
                    progress.Report(OperationProgress.Completed);
                }
                return TaskUtility.UnwrapResult(t);
            },
                       cancellationToken,
                       TaskContinuationOptions.ExecuteSynchronously,
                       TaskScheduler.Default));
        }
示例#6
0
 public abstract Task<BlameFile> GetBlameAsync(BlameOptions options, IProgress<OperationProgress> progress, CancellationToken cancellationToken);
示例#7
0
 public abstract BlameFile GetBlame(BlameOptions options);
示例#8
0
 public abstract Task <BlameFile> GetBlameAsync(BlameOptions options, IProgress <OperationProgress> progress, CancellationToken cancellationToken);
示例#9
0
 public abstract BlameFile GetBlame(BlameOptions options);
示例#10
0
 private static BlameOptions GetDefault()
 {
     var options = new BlameOptions();
     options.Freeze();
     return options;
 }
示例#11
0
        public override Task<BlameFile> GetBlameAsync(BlameOptions options, IProgress<OperationProgress> progress, CancellationToken cancellationToken)
        {
            Verify.Argument.IsNotNull(options, "options");

            if(progress != null)
            {
                progress.Report(new OperationProgress(Resources.StrsFetchingBlame.AddEllipsis()));
            }
            var parameters = GetParameters(options);
            return Repository.Accessor.QueryBlame.InvokeAsync(parameters, progress, cancellationToken)
                                      .ContinueWith(
                                        t =>
                                        {
                                            if(progress != null)
                                            {
                                                progress.Report(OperationProgress.Completed);
                                            }
                                            return TaskUtility.UnwrapResult(t);
                                        },
                                        cancellationToken,
                                        TaskContinuationOptions.ExecuteSynchronously,
                                        TaskScheduler.Default);
        }
示例#12
0
        public override BlameFile GetBlame(BlameOptions options)
        {
            Verify.Argument.IsNotNull(options, "options");

            var parameters = GetParameters(options);
            return Repository.Accessor.QueryBlame.Invoke(parameters);
        }
示例#13
0
        private QueryBlameParameters GetParameters(BlameOptions options)
        {
            Assert.IsNotNull(options);

            var parameters = new QueryBlameParameters()
                {
                    Revision = Revision.Pointer,
                    FileName = FileName,
                };
            return parameters;
        }