예제 #1
0
        private RootNode Generate(RootType type)
        {
            if (type.Type == null)
            {
                return(null);
            }

            if (registeredTypes.ContainsKey(type))
            {
                return(registeredTypes[type]);
            }

            RootType[] referencedTypes;

            RootNode root = registeredTypes[type] = Generate(type, out referencedTypes);

            if (referencedTypes != null)
            {
                for (int i = 0; i < referencedTypes.Length; i++)
                {
                    Generate(referencedTypes[i]);
                }
            }

            return(root);
        }
예제 #2
0
        private RootNode Generate(RootType type, out RootType[] referencedTypes)
        {
            registeredTypes.Add(type, null);

            HashSet <RootType> referTypes = new HashSet <RootType>();
            RootNode           root       = new RootNode(type);

            root.Generate(referTypes);
            referencedTypes = referTypes.ToArray();
            return(root);
        }
예제 #3
0
 public RootNode(RootType type) : base(type.Type)
 {
     Root = type;
 }
예제 #4
0
 public RootNode(Type type) : base(type)
 {
     Root = new RootType(type);
 }
예제 #5
0
 public WritePartNode(RootType type, List <FieldInfo> fields) : base(type.Type)
 {
     this.fields = fields;
     rootType    = type;
 }
예제 #6
0
 public ReadPartNode(RootType type, List <FieldInfo> fields) : base(type.Type)
 {
     this.fields = fields;
     rootType    = type;
     CreateNew   = type.Type.IsClass && type.Type.GetConstructor(new Type[0]) != null;
 }
예제 #7
0
 public TypeNode(RootType type) : base(type.Type)
 {
     rootType        = type;
     customAttribute = TypeUtil.GetCustomAttribute <CustomSerialierAttribute>(type.Type, true);
 }
예제 #8
0
 public TypeNode(Type type, CustomSerialierAttribute customAttr = null) : base(type)
 {
     rootType        = new RootType(type, XmlUtil.IsPolymorphicClass(type));
     customAttribute = customAttr ?? TypeUtil.GetCustomAttribute <CustomSerialierAttribute>(type, true);
 }