/// <summary>Initializes a new instance of the <see cref="CSharpGeneratorSettings"/> class.</summary>
        public CSharpGeneratorSettings()
        {
            Namespace = "MyNamespace";

            DateType     = "System.DateTime";
            DateTimeType = "System.DateTime";
            TimeType     = "System.TimeSpan";
            TimeSpanType = "System.TimeSpan";

            ArrayType      = "System.Collections.ObjectModel.ObservableCollection";
            DictionaryType = "System.Collections.Generic.Dictionary";

            ArrayBaseType      = "System.Collections.ObjectModel.ObservableCollection";
            DictionaryBaseType = "System.Collections.Generic.Dictionary";

            RequiredPropertiesMustBeDefined = true;
            GenerateDataAnnotations         = true;
            ClassStyle                   = CSharpClassStyle.Inpc;
            TypeAccessModifier           = "public";
            PropertySetterAccessModifier = string.Empty;
            GenerateJsonMethods          = true;
            EnforceFlagEnums             = false;

            ValueGenerator        = new CSharpValueGenerator(this);
            PropertyNameGenerator = new CSharpPropertyNameGenerator();
            TemplateFactory       = new DefaultTemplateFactory(this, new Assembly[]
            {
                typeof(CSharpGeneratorSettings).GetTypeInfo().Assembly
            });
        }
Esempio n. 2
0
        /// <summary>Initializes a new instance of the <see cref="CSharpGeneratorSettings"/> class.</summary>
        public CSharpGeneratorSettings()
        {
            AnyType   = "object";
            Namespace = "MyNamespace";

            DateType     = "System.DateTimeOffset";
            DateTimeType = "System.DateTimeOffset";
            TimeType     = "System.TimeSpan";
            TimeSpanType = "System.TimeSpan";

            ArrayType         = "System.Collections.Generic.ICollection";
            ArrayInstanceType = "System.Collections.ObjectModel.Collection";
            ArrayBaseType     = "System.Collections.ObjectModel.Collection";

            DictionaryType         = "System.Collections.Generic.IDictionary";
            DictionaryInstanceType = "System.Collections.Generic.Dictionary";
            DictionaryBaseType     = "System.Collections.Generic.Dictionary";

            ClassStyle = CSharpClassStyle.Poco;

            RequiredPropertiesMustBeDefined = true;
            GenerateDataAnnotations         = true;
            TypeAccessModifier           = "public";
            PropertySetterAccessModifier = string.Empty;
            GenerateJsonMethods          = false;
            EnforceFlagEnums             = false;

            ValueGenerator        = new CSharpValueGenerator(this);
            PropertyNameGenerator = new CSharpPropertyNameGenerator();
            TemplateFactory       = new DefaultTemplateFactory(this, new Assembly[]
            {
                typeof(CSharpGeneratorSettings).GetTypeInfo().Assembly
            });

            InlineNamedArrays       = false;
            InlineNamedDictionaries = false;
            InlineNamedTuples       = true;

            this.EnumNameGenerator     = new Naming.NonCasingEnumNameGenerator();
            this.PropertyNameGenerator = new Naming.NonCasingPropertyNameGenerator();
            this.TypeNameGenerator     = new Naming.NonCasingTypeNameGenerator();
        }