Esempio n. 1
0
 public T this[string name]
 {
     get {
         if (__dynamicProps != null)
         {
             return(default(T));                                                 // default(T) as we can't return Undefined
         }
         else
         {
             dynamic result = __dynamicProps.__GetDynamicValue(name);                            // The instance that was set was only of T type (or undefined)
             if (result == PlayScript.Undefined._undefined)
             {
                 return(default(T));                                                     // default(T) as we can't return Undefined
             }
             return((T)result);
         }
     }
     set {
         if (__dynamicProps == null)
         {
             __dynamicProps = new PlayScript.DynamicProperties();                        // Create the dynamic propertties only on the first set usage
         }
         __dynamicProps.__SetDynamicValue(name, value);                                  // This will only inject T type instances.
     }
 }
Esempio n. 2
0
 void PlayScript.IDynamicClass.__SetDynamicValue(string name, object value)
 {
     if (__dynamicProps == null)
     {
         __dynamicProps = new PlayScript.DynamicProperties(this);
     }
     __dynamicProps.__SetDynamicValue(name, value);
 }