コード例 #1
0
 public TypeDef(QualifiedClassName name, TypeDef baseType, TypeType typeType, Type type)
 {
     _baseType = baseType;
     Name      = name;
     TypeType  = typeType;
     Type      = type;
 }
コード例 #2
0
        TypeDef CreateTypeDef(QualifiedClassName qualifiedClassName, Type type)
        {
            var typeDef = IsCommand(type)
                ? new TypeDef(qualifiedClassName, GetTypeFor(typeof(Command)), TypeType.Command, type)
                : new TypeDef(qualifiedClassName, TypeType.Other);

            _types[type] = typeDef;

            foreach (var property in GetAllProperties(type))
            {
                var propertyDef =
                    new PropertyDef(GetOrCreateTypeDef(new QualifiedClassName(property.PropertyType), property.PropertyType),
                                    property.Name);

                if (typeDef.TypeType == TypeType.Command && propertyDef.Name == "Meta")
                {
                    continue;
                }

                typeDef.AddProperty(propertyDef);
            }

            return(typeDef);
        }
コード例 #3
0
 TypeDef GetOrCreateTypeDef(QualifiedClassName qualifiedClassName, Type type)
 {
     return(GetExistingTypeDefOrNull(type)
            ?? CreateSpecialTypeDefOrNull(type)
            ?? CreateTypeDef(qualifiedClassName, type));
 }
コード例 #4
0
        public void AddTypeDefFor(Type type)
        {
            var qualifiedClassName = new QualifiedClassName(type);

            GetOrCreateTypeDef(qualifiedClassName, type);
        }
コード例 #5
0
 public TypeDef(QualifiedClassName name, TypeType typeType)
 {
     Name     = name;
     TypeType = typeType;
 }