Ejemplo n.º 1
0
 protected IParent(TRight right)
     : this(
         new Union <TLeft, TRight>(right),
         new Functor <TLeft, TRight> .TParent <Either <TLeft, TRight> >(
             new Union <TLeft, TRight>(right)
             )
         )
 {
 }
Ejemplo n.º 2
0
            public void OnRightNext(TRight value)
            {
                this.currentlyOpenRight.Add(value);

                openSubs.Add(this.joinOperator.rightDurationSelector(value).Subscribe(new CallbackObserver <TRightDuration>(_ => { },
                                                                                                                            _ => OnFinished(), OnFinished)));

                foreach (var leftValue in this.currentlyOpenLeft)
                {
                    this.observer.OnNext(this.joinOperator.resultSelector(leftValue, value));
                }

                void OnFinished()
                {
                    this.currentlyOpenRight.Remove(value);
                }
            }
Ejemplo n.º 3
0
 private void Dequeue()
 {
     if (this.leftQ.Count != 0 && this.rightQ.Count != 0)
     {
         TLeft   arg  = this.leftQ.Dequeue();
         TRight  arg2 = this.rightQ.Dequeue();
         TResult value;
         try
         {
             value = this.parent.selector(arg, arg2);
         }
         catch (Exception error)
         {
             try
             {
                 this.observer.OnError(error);
             }
             finally
             {
                 base.Dispose();
             }
             return;
         }
         this.OnNext(value);
         return;
     }
     if (!this.leftCompleted)
     {
         if (!this.rightCompleted)
         {
             return;
         }
     }
     try
     {
         this.observer.OnCompleted();
     }
     finally
     {
         base.Dispose();
     }
 }
Ejemplo n.º 4
0
        public async Task <ApiRequestResult> AddAsync([FromBody] RightParam param)
        {
            try
            {
                var add = new TRight
                {
                    RightName   = param.RightName,
                    ParentId    = param.ParentId,
                    Description = param.Description,
                    RightIcon   = param.RightIcon,
                    RightUrl    = param.RightUrl,
                };
                await _iTRightRepository.AddAsync(add);

                return(ApiRequestResult.Success("添加成功"));
            }
            catch (Exception ex)
            {
                return(ApiRequestResult.Error(ex.Message));
            }
        }
Ejemplo n.º 5
0
 private void Dequeue()
 {
     if (leftQ.Count != 0 && rightQ.Count != 0)
     {
         TLeft   arg  = leftQ.Dequeue();
         TRight  arg2 = rightQ.Dequeue();
         TResult value;
         try
         {
             value = parent.selector(arg, arg2);
         }
         catch (Exception error)
         {
             try
             {
                 observer.OnError(error);
             }
             finally
             {
                 Dispose();
             }
             return;
         }
         OnNext(value);
     }
     else if (leftCompleted || rightCompleted)
     {
         try
         {
             observer.OnCompleted();
         }
         finally
         {
             Dispose();
         }
     }
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Creates a new instance of <see cref="DiffValue"/>
 /// </summary>
 public DiffValue(TLeft left, TRight right)
 {
     Left  = left;
     Right = right;
 }
Ejemplo n.º 7
0
 public A Prune(TRight value)
 {
     return(new Factory <A, TRight>(value).Instance());
 }
Ejemplo n.º 8
0
 public P(TRight value) : base(value)
 {
 }
Ejemplo n.º 9
0
 public void Deconstruct(out TRight right, out TLeft left)
 {
     right = Right;
     left  = Left;
 }
Ejemplo n.º 10
0
 internal Relation(TLeft left, TRight right)
 {
     Left  = left;
     Right = right;
 }