Ejemplo n.º 1
0
        public async Task <Diff> GetDiffAsync(DiffOptions options, IProgress <OperationProgress> progress, CancellationToken cancellationToken)
        {
            Verify.Argument.IsNotNull(options, nameof(options));
            Verify.State.IsFalse(IsDisposed, "Object is disposed.");

            if (progress != null)
            {
                progress.Report(new OperationProgress(Resources.StrLoadingDiff.AddEllipsis()));
                var result = await GetDiffCoreAsync(options, progress, cancellationToken);

                progress.Report(OperationProgress.Completed);
                return(result);
                //return GetDiffCoreAsync(options, progress, cancellationToken)
                //	.ContinueWith(t =>
                //		{
                //			progress.Report(OperationProgress.Completed);
                //			return TaskUtility.UnwrapResult(t);
                //		},
                //		cancellationToken, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
            }
            else
            {
                return(await GetDiffCoreAsync(options, progress, cancellationToken));
            }
        }
Ejemplo n.º 2
0
        public Diff GetDiff(DiffOptions options)
        {
            Verify.Argument.IsNotNull(options, nameof(options));
            Verify.State.IsFalse(IsDisposed, "Object is disposed.");

            return(GetDiffCore(options));
        }
Ejemplo n.º 3
0
        protected override Diff GetDiffCore(DiffOptions options)
        {
            Assert.IsNotNull(options);

            var parameters = GetParameters(options);

            return(Repository.Accessor.QueryRevisionDiff.Invoke(parameters));
        }
Ejemplo n.º 4
0
        protected override Task <Diff> GetDiffCoreAsync(DiffOptions options, IProgress <OperationProgress> progress, CancellationToken cancellationToken)
        {
            Assert.IsNotNull(options);

            var parameters = GetParameters(options);

            return(Repository.Accessor.QueryRevisionDiff.InvokeAsync(parameters, progress, cancellationToken));
        }
Ejemplo n.º 5
0
        private QueryRevisionDiffParameters GetParameters(DiffOptions options)
        {
            var parameters = new QueryRevisionDiffParameters(_revision.Pointer)
            {
                Paths = _paths,
            };

            ApplyCommonDiffOptions(parameters, options);
            return(parameters);
        }
Ejemplo n.º 6
0
        private QueryRevisionDiffParameters GetParameters(DiffOptions options)
        {
            Assert.IsNotNull(options);

            var parameters = new QueryRevisionDiffParameters(_stashedState.Name)
            {
                Paths = _paths,
            };

            ApplyCommonDiffOptions(parameters, options);
            return(parameters);
        }
Ejemplo n.º 7
0
        private QueryDiffParameters GetParameters(DiffOptions options)
        {
            Assert.IsNotNull(options);

            var parameters = new QueryDiffParameters()
            {
                Cached = _cached,
                Paths  = _paths,
            };

            ApplyCommonDiffOptions(parameters, options);
            return(parameters);
        }
Ejemplo n.º 8
0
        private QueryDiffParameters GetParameters(DiffOptions options)
        {
            Assert.IsNotNull(options);

            var parameters = new QueryDiffParameters()
            {
                Revision1 = _revision1.Pointer,
                Revision2 = _revision2.Pointer,
                Paths     = _paths,
            };

            ApplyCommonDiffOptions(parameters, options);
            return(parameters);
        }
Ejemplo n.º 9
0
        protected static void ApplyCommonDiffOptions(BaseQueryDiffParameters queryParameters, DiffOptions options)
        {
            Assert.IsNotNull(queryParameters);
            Assert.IsNotNull(options);

            queryParameters.Context           = options.Context;
            queryParameters.Patience          = options.UsePatienceAlgorithm;
            queryParameters.IgnoreSpaceChange = options.IgnoreWhitespace;
            queryParameters.Binary            = options.Binary;
        }
Ejemplo n.º 10
0
        private QueryDiffParameters GetParameters(DiffOptions options)
        {
            Assert.IsNotNull(options);

            var parameters = new QueryDiffParameters()
            {
                Cached = _cached,
                Paths = _paths,
            };
            ApplyCommonDiffOptions(parameters, options);
            return parameters;
        }
Ejemplo n.º 11
0
        protected override Task<Diff> GetDiffCoreAsync(DiffOptions options, IProgress<OperationProgress> progress, CancellationToken cancellationToken)
        {
            Assert.IsNotNull(options);

            var parameters = GetParameters(options);
            return Repository.Accessor.QueryRevisionDiff.InvokeAsync(parameters, progress, cancellationToken);
        }
Ejemplo n.º 12
0
 private QueryRevisionDiffParameters GetParameters(DiffOptions options)
 {
     var parameters = new QueryRevisionDiffParameters(_revision.Pointer)
     {
         Paths = _paths,
     };
     ApplyCommonDiffOptions(parameters, options);
     return parameters;
 }
Ejemplo n.º 13
0
        public Diff GetDiff(DiffOptions options)
        {
            Verify.Argument.IsNotNull(options, "options");
            Verify.State.IsFalse(IsDisposed, "Object is disposed.");

            return GetDiffCore(options);
        }
Ejemplo n.º 14
0
        protected override Diff GetDiffCore(DiffOptions options)
        {
            Assert.IsNotNull(options);

            var parameters = GetParameters(options);
            return Repository.Accessor.QueryRevisionDiff.Invoke(parameters);
        }
Ejemplo n.º 15
0
 protected abstract Diff GetDiffCore(DiffOptions options);
Ejemplo n.º 16
0
 protected abstract Task<Diff> GetDiffCoreAsync(DiffOptions options, IProgress<OperationProgress> progress, CancellationToken cancellationToken);
Ejemplo n.º 17
0
        private QueryDiffParameters GetParameters(DiffOptions options)
        {
            Assert.IsNotNull(options);

            var parameters = new QueryDiffParameters()
            {
                Revision1 = _revision1.Pointer,
                Revision2 = _revision2.Pointer,
                Paths = _paths,
            };
            ApplyCommonDiffOptions(parameters, options);
            return parameters;
        }
Ejemplo n.º 18
0
        public Task<Diff> GetDiffAsync(DiffOptions options, IProgress<OperationProgress> progress, CancellationToken cancellationToken)
        {
            Verify.Argument.IsNotNull(options, "options");
            Verify.State.IsFalse(IsDisposed, "Object is disposed.");

            if(progress != null)
            {
                progress.Report(new OperationProgress(Resources.StrLoadingDiff.AddEllipsis()));
                return GetDiffCoreAsync(options, progress, cancellationToken)
                    .ContinueWith(t =>
                        {
                            progress.Report(OperationProgress.Completed);
                            return TaskUtility.UnwrapResult(t);
                        },
                        cancellationToken, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
            }
            else
            {
                return GetDiffCoreAsync(options, progress, cancellationToken);
            }
        }
Ejemplo n.º 19
0
        protected static void ApplyCommonDiffOptions(BaseQueryDiffParameters queryParameters, DiffOptions options)
        {
            Assert.IsNotNull(queryParameters);
            Assert.IsNotNull(options);

            queryParameters.Context           = options.Context;
            queryParameters.Patience          = options.UsePatienceAlgorithm;
            queryParameters.IgnoreSpaceChange = options.IgnoreWhitespace;
            queryParameters.Binary            = options.Binary;
        }
Ejemplo n.º 20
0
 protected abstract Diff GetDiffCore(DiffOptions options);
Ejemplo n.º 21
0
 protected abstract Task <Diff> GetDiffCoreAsync(DiffOptions options, IProgress <OperationProgress> progress, CancellationToken cancellationToken);