Example #1
0
        public async Task <Dictionary <string, PropDesc> > GetObjPropDescRange(HeapPtr ptr, int start, int end)
        {
            var reply = await DoRequest(DValueTag.REQ, Request.GetObjPropDescRange, ptr, start, end);

            var props = new Dictionary <string, PropDesc>();
            int count = (reply.Length - 1) / 2;
            int i     = 1;

            while (i < reply.Length)
            {
                PropFlags flags = (PropFlags)(int)reply[i++];
                string    name  = reply[i++].ToString();
                if (flags.HasFlag(PropFlags.Accessor))
                {
                    DValue   getter    = reply[i++];
                    DValue   setter    = reply[i++];
                    PropDesc propValue = new PropDesc(getter, setter, flags);
                    if (!flags.HasFlag(PropFlags.Internal))
                    {
                        props.Add(name, propValue);
                    }
                }
                else
                {
                    DValue   value     = reply[i++];
                    PropDesc propValue = new PropDesc(value, flags);
                    if (!flags.HasFlag(PropFlags.Internal) && value.Tag != DValueTag.Unused)
                    {
                        props.Add(name, propValue);
                    }
                }
            }
            return(props);
        }
Example #2
0
        public async Task <Dictionary <string, PropDesc> > InspectObject(KiRef handle, int start, int end)
        {
            var reply = await DoRequest(KiTag.REQ, KiRequest.InspectObject, handle, start, end);

            var props = new Dictionary <string, PropDesc>();
            int i     = 1;

            while (i < reply.Length)
            {
                string    key   = reply[i++].ToString();
                PropFlags flags = (PropFlags)(int)reply[i++];
                if (flags.HasFlag(PropFlags.Accessor))
                {
                    KiAtom   getter    = reply[i++];
                    KiAtom   setter    = reply[i++];
                    PropDesc propValue = new PropDesc(getter, setter, flags);
                    if (!flags.HasFlag(PropFlags.Internal))
                    {
                        props.Add(key, propValue);
                    }
                }
                else
                {
                    KiAtom   value     = reply[i++];
                    PropDesc propValue = new PropDesc(value, flags);
                    if (!flags.HasFlag(PropFlags.Internal))
                    {
                        props.Add(key, propValue);
                    }
                }
            }
            return(props);
        }
Example #3
0
 public PropDesc(KiAtom getter, KiAtom setter, PropFlags flags)
 {
     Value  = null;
     Getter = getter;
     Setter = setter;
     Flags  = flags;
 }
Example #4
0
 public PropDesc(DValue getter, DValue setter, PropFlags flags)
 {
     Value  = null;
     Getter = getter;
     Setter = setter;
     Flags  = flags;
 }
Example #5
0
 public PropAttribute(
     PropFlags flags = (PropFlags)0,
     PropReadRestrict readRestrict     = PropReadRestrict.None,
     PropObjRefRestrict objRefRestrict = PropObjRefRestrict.None
     )
 {
     this.flags             = flags;
     this.readRestriction   = readRestrict;
     this.objRefRestriction = objRefRestrict;
 }
Example #6
0
 public UPropertyAttribute(PropFlags flags)
 {
     Flags = flags;
 }
Example #7
0
 public PropDesc(KiAtom value, PropFlags flags)
 {
     Value  = value;
     Getter = Setter = null;
     Flags  = flags;
 }