예제 #1
0
        private PropertyChildInfo GetMirrorInfo()
        {
            PropertyChildInfo childInfo = null;
            var methodMirror            = childMirror as MethodMirror;
            var propertyMirror          = childMirror as PropertyInfoMirror;
            var fieldMirror             = childMirror as FieldInfoMirror;

            //if (methodMirror != null)
            //{
            //    childInfo = new PropertyChildInfo();
            //    childInfo.Name = methodMirror.Name;
            //    childInfo.FullName = methodMirror.FullName;
            //}
            //else

            if (propertyMirror != null)
            {
                childInfo              = new PropertyChildInfo();
                childInfo.Name         = propertyMirror.Name;
                childInfo.FullName     = propertyMirror.PropertyType.FullName;
                childInfo.PropertyType = propertyMirror.PropertyType;
            }
            else if (fieldMirror != null)
            {
                childInfo              = new PropertyChildInfo();
                childInfo.Name         = fieldMirror.Name;
                childInfo.FullName     = fieldMirror.FieldType.FullName;
                childInfo.PropertyType = fieldMirror.FieldType;
            }

            return(childInfo);
        }
예제 #2
0
        private PropertyChildInfo GetMirrorInfo()
        {
            PropertyChildInfo childInfo = null;
            var methodMirror = childMirror as MethodMirror;
            var propertyMirror = childMirror as PropertyInfoMirror;
            var fieldMirror = childMirror as FieldInfoMirror;
            //if (methodMirror != null)
            //{
            //    childInfo = new PropertyChildInfo();
            //    childInfo.Name = methodMirror.Name;
            //    childInfo.FullName = methodMirror.FullName;
            //}
            //else

            if (propertyMirror != null)
            {
                childInfo = new PropertyChildInfo();
                childInfo.Name = propertyMirror.Name;
                childInfo.FullName = propertyMirror.PropertyType.FullName;
                childInfo.PropertyType = propertyMirror.PropertyType;
            }
            else if (fieldMirror != null)
            {
                childInfo = new PropertyChildInfo();
                childInfo.Name = fieldMirror.Name;
                childInfo.FullName = fieldMirror.FieldType.FullName;
                childInfo.PropertyType = fieldMirror.FieldType;
            }

            return childInfo;
        }