Пример #1
0
 /// <summary>
 /// Add an AssemblyType if it's not already added
 /// </summary>
 /// <param name="type"></param>
 public new void Add(AssemblyType type)
 {
     foreach (AssemblyType x in this)
     {
         if (x.Type == type.Type &&
             x.Assembly == type.Assembly)
         {
             return;
         }
     }
     base.Add(type);
 }
Пример #2
0
        private static Configuration CreateDefaultConfiguration()
        {
            Configuration config = new Configuration();
            config.EnableDataBinding = true;
            config.GenerateOrder= true;
            config.GenerateProperties = true;
            config.GenerateComplexTypes = true;
            config.GenerateComplexTypesSpecified = true;

            config.CodeModifiers.Add(new AssemblyType(typeof(CodeGeneration.CodeModifiers.ConvertArraysToCollections)));
            config.CodeModifiers.Add(new AssemblyType(typeof(CodeGeneration.CodeModifiers.RemoveDebuggerAttribute)));
            //config.CodeModifiers.Add(new AssemblyType(typeof(CodeGeneration.CodeModifiers.RemoveSpecifiedTypes)));
            //config.CodeModifiers.Add(new AssemblyType(typeof(CodeGeneration.CodeModifiers.ModifyImports)));
            AssemblyType importFixer = new AssemblyType(typeof(CodeGeneration.CodeModifiers.ImportFixer));
            importFixer.Any = CodeGeneration.CodeModifiers.ImportFixer.DefaultOptions;
            config.CodeModifiers.Add(importFixer);
            
            return config;
        }
Пример #3
0
        private static Configuration CreateDefaultConfiguration()
        {
            Configuration config = new Configuration();

            config.EnableDataBinding             = true;
            config.GenerateOrder                 = true;
            config.GenerateProperties            = true;
            config.GenerateComplexTypes          = true;
            config.GenerateComplexTypesSpecified = true;

            config.CodeModifiers.Add(new AssemblyType(typeof(CodeGeneration.CodeModifiers.ConvertArraysToCollections)));
            config.CodeModifiers.Add(new AssemblyType(typeof(CodeGeneration.CodeModifiers.RemoveDebuggerAttribute)));
            //config.CodeModifiers.Add(new AssemblyType(typeof(CodeGeneration.CodeModifiers.RemoveSpecifiedTypes)));
            //config.CodeModifiers.Add(new AssemblyType(typeof(CodeGeneration.CodeModifiers.ModifyImports)));
            AssemblyType importFixer = new AssemblyType(typeof(CodeGeneration.CodeModifiers.ImportFixer));

            importFixer.Any = CodeGeneration.CodeModifiers.ImportFixer.DefaultOptions;
            config.CodeModifiers.Add(importFixer);

            return(config);
        }
Пример #4
0
 /// <summary>
 /// Add an AssemblyType if it's not already added
 /// </summary>
 /// <param name="type"></param>
 public new void Add(AssemblyType type)
 {
     foreach (AssemblyType x in this)
         if (x.Type == type.Type &&
             x.Assembly == type.Assembly)
             return;
     base.Add(type);
 }