예제 #1
0
        public NativeDescriptor MarshalPropertyInfo(
            PropertyInfo prop,
            JsDictionaryObject owner)
        {
            JsSetter setter = (JsSetter)null;
            JsGetter getter = !prop.CanRead || prop.GetGetMethod() == null ? (JsGetter)(that => (JsInstance)JsUndefined.Instance) : this.WrapGetProperty(prop);

            if (prop.CanWrite && prop.GetSetMethod() != null)
            {
                setter = this.WrapSetProperty(prop);
            }
            NativeDescriptor nativeDescriptor1;

            if (setter != null)
            {
                NativeDescriptor nativeDescriptor2 = new NativeDescriptor(owner, prop.Name, getter, setter);
                nativeDescriptor2.Enumerable = true;
                nativeDescriptor1            = nativeDescriptor2;
            }
            else
            {
                nativeDescriptor1            = new NativeDescriptor(owner, prop.Name, getter);
                nativeDescriptor1.Enumerable = true;
            }
            return(nativeDescriptor1);
        }
예제 #2
0
 public NativeDescriptor(JsDictionaryObject owner, NativeDescriptor src)
     : base(owner, src.Name)
 {
     this.getter       = src.getter;
     this.setter       = src.setter;
     this.Writable     = src.Writable;
     this.Configurable = src.Configurable;
     this.Enumerable   = src.Enumerable;
 }
예제 #3
0
 public NativeDescriptor(
     JsDictionaryObject owner,
     string name,
     JsGetter getter,
     JsSetter setter)
     : base(owner, name)
 {
     this.getter = getter;
     this.setter = setter;
 }
예제 #4
0
 public NativeDescriptor(JsDictionaryObject owner, string name, JsGetter getter)
     : base(owner, name)
 {
     this.getter = getter;
     Writable    = false;
 }
예제 #5
0
 public NativeDescriptor(JsDictionaryObject owner, string name, JsGetter getter, JsSetter setter)
     : base(owner, name)
 {
     this.getter = getter;
     this.setter = setter;
 }
예제 #6
0
 public NativeDescriptor(JsDictionaryObject owner, string name, JsGetter getter)
     : base(owner, name)
 {
     this.getter = getter;
     Writable = false;
 }