예제 #1
0
파일: DNManager.cs 프로젝트: rinavin/RCJS
        /// <summary>
        /// creates a DNMemberInfo for object at key 'obj', add into DNMemberInfoTable and returns key
        /// </summary>
        /// <param name="key">key to DNObjectsCollection</param>
        /// <returns></returns>
        public DNMemberInfo CreateDNMemberInfo(int key)
        {
            Type dnObjType = null;

            // get the dotnet object
            object dnObj = DNObjectsCollection.GetDNObj(key);

            // get the type
            if (dnObj != null)
            {
                dnObjType = ReflectionServices.GetType(dnObj);
            }

            // create a DNMemberInfo
            var dnMemberInfo = new DNMemberInfo(dnObjType, dnObj, null, key, null);

            return(dnMemberInfo);
        }
예제 #2
0
        public DNMemberInfo parent;       // reference to the parent

        /// <summary>
        /// inits an DNMemberInfo object
        /// </summary>
        /// <param name="memberInfo">MemberInfo of 'value'</param>
        /// <param name="value">the actual object</param>
        /// <param name="indexes">of an array object</param>
        /// <param name="dnObjectCollectionIsn">key of DNObjectCollection</param>
        /// <param name="parent">parent object</param>
        private void init(MemberInfo memberInfo, Object value, Object[] indexes, int dnObjectCollectionIsn, DNMemberInfo parent)
        {
            if (memberInfo != null)
            {
                this.memberInfo = memberInfo;
            }
            else if (value != null)
            {
                this.memberInfo = value.GetType();
            }
            else
            {
                this.memberInfo = null;
            }

            this.value   = value;
            this.indexes = indexes;
            this.dnObjectCollectionIsn = dnObjectCollectionIsn;
            this.parent = parent;
        }
예제 #3
0
 /// <summary>
 /// CTOR
 /// </summary>
 /// <param name="memberInfo">MemberInfo of 'value'</param>
 /// <param name="value">the actual object</param>
 /// <param name="indexes">of an array object</param>
 /// <param name="dnObjectCollectionIsn">key of DNObjectCollection</param>
 /// <param name="parent">parent object</param>
 public DNMemberInfo(MemberInfo memberInfo, Object value, Object[] indexes, int dnObjectCollectionIsn, DNMemberInfo parent)
 {
     init(memberInfo, value, indexes, dnObjectCollectionIsn, parent);
 }