Exemplo n.º 1
0
 public override async Task Begin(object obj, SynchronousOptions opts = null)
 {
     if (LeftSynchronizer is BinarySynchronizer && LeftSynchronizer.WillBegin(obj, opts))
     {
         await LeftSynchronizer.Begin(obj, opts);
     }
     else
     {
         await RightSynchronizer.Begin(obj, opts);
     }
 }
Exemplo n.º 2
0
 public override bool WillBegin(object obj, SynchronousOptions opts = null)
 {
     if (LeftSynchronizer is BinarySynchronizer && LeftSynchronizer.WillBegin(obj, opts))
     {
         return(true);
     }
     else
     {
         return(RightSynchronizer.WillBegin(obj, opts));
     }
 }
Exemplo n.º 3
0
        public override async Task End(object obj, SynchronousOptions opts = null)
        {
            var willLeftBegin  = LeftSynchronizer.WillBegin(obj);
            var willRightBegin = RightSynchronizer.WillBegin(obj);

            if (willLeftBegin && willRightBegin)
            {
                await Task.CompletedTask;
            }
            else if (willLeftBegin)
            {
                await RightSynchronizer.End(obj, SynchronousOptions.UpdateInternalOptions(opts, new InternalSynchronousOptions().WithHandlingCondition()));
            }
            else if (willRightBegin)
            {
                await LeftSynchronizer.End(obj, SynchronousOptions.UpdateInternalOptions(opts, new InternalSynchronousOptions().WithHandlingCondition()));
            }
            else
            {
                await LeftSynchronizer.End(obj, opts);
            }
        }
Exemplo n.º 4
0
        public override bool WillEnd(object obj, SynchronousOptions opts = null)
        {
            var willLeftBegin  = LeftSynchronizer.WillBegin(obj);
            var willRightBegin = RightSynchronizer.WillBegin(obj);

            if (willLeftBegin && willRightBegin)
            {
                return(false);
            }
            else if (willLeftBegin)
            {
                return(RightSynchronizer.WillEnd(obj, SynchronousOptions.UpdateInternalOptions(opts, new InternalSynchronousOptions().WithHandlingCondition())));
            }
            else if (willRightBegin)
            {
                return(LeftSynchronizer.WillEnd(obj, SynchronousOptions.UpdateInternalOptions(opts, new InternalSynchronousOptions().WithHandlingCondition())));
            }
            else
            {
                return(LeftSynchronizer.WillEnd(obj, opts));
            }
        }
Exemplo n.º 5
0
 public override bool WillBegin(object obj, SynchronousOptions opts = null)
 {
     return(LeftSynchronizer.WillBegin(obj, opts) && RightSynchronizer.WillBegin(obj, opts));
 }