Beispiel #1
0
 public virtual TArg WaitForProperty <TArg>(Partial <TArg> property)
 {
     if (!Object.ReferenceEquals(property, this))
     {
         throw Completable.InvalidProperty();
     }
     return(To <TArg> .Cast(Value));
 }
Beispiel #2
0
        public override void RegisterReceiver <TArg>(Partial <TArg> property, Action <TArg> valueReceiver)
        {
            if (base.ContainsProperty(property))
            {
                base.RegisterReceiver(property, valueReceiver);
                return;
            }
            if (!ContainsProperty(property))
            {
                throw Completable.InvalidProperty("property");
            }

            Container.RegisterReceiver(property, valueReceiver);
            this.RegisterReceiver(this, arr => valueReceiver(To <TArg> .Cast(arr[((PartialElement)(object)property).Index])));
        }
Beispiel #3
0
 public virtual void RegisterReceiver <TArg>(Partial <TArg> property, Action <TArg> valueReceiver)
 {
     if (!Object.ReferenceEquals(property, this))
     {
         throw Completable.InvalidProperty();
     }
     if (IsValueCreated)
     {
         To <Action <T> > .Cast(valueReceiver).Invoke(Value);
     }
     else
     {
         receivers.Add(To <Action <T> > .Cast(valueReceiver));
     }
 }
Beispiel #4
0
        public override TArg WaitForProperty <TArg>(Partial <TArg> property)
        {
            if (base.ContainsProperty(property))
            {
                return(base.WaitForProperty(property));
            }
            if (!ContainsProperty(property))
            {
                throw Completable.InvalidProperty("property");
            }

            try{
                return(Container.WaitForProperty(property));
            }catch (PropertyIncompleteException)
            {
                return(To <TArg> .Cast(Value[((PartialElement)(object)property).Index]));
            }
        }