Ejemplo n.º 1
0
 public virtual TArg WaitForProperty <TArg>(Partial <TArg> property)
 {
     if (!Object.ReferenceEquals(property, this))
     {
         throw Completable.InvalidProperty();
     }
     return(To <TArg> .Cast(Value));
 }
Ejemplo n.º 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])));
        }
Ejemplo n.º 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));
     }
 }
Ejemplo n.º 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]));
            }
        }