Beispiel #1
0
        /// <summary>
        /// Begins writing the class. Usings, opening namespace, class definition
        /// </summary>
        /// <returns>Always <see langword="true"/></returns>
        public override bool Begin()
        {
            if (_usingGenerator.Make())
            {
                WriteLine();
            }

            _namespaceGenerator.Begin();

            _classDefinitionGenerator.Make();

            OpenBrackets();

            foreach (CSharpField field in _class.Fields)
            {
                var fieldGenerator = new FieldGenerator(field, _writer);
                fieldGenerator.Make();
            }

            // empty newline after fields
            if (_class.Fields.Length > 0)
            {
                WriteLine();
            }

            return(true);
        }