コード例 #1
0
        public override string GenerateCode(int tabulatorsCount)
        {
            string content    = string.Empty;
            string tabulators = GenerateTabulations(tabulatorsCount);

            content += tabulators + CSharpFile.WriteObjects(ClassAttributes, tabulatorsCount);
            content += tabulators + string.Format(
                "{0} {1} {2} {3}",
                AccessModifier.ToString().ToLower(),
                IsAbstract ? "abstract" : string.Empty,
                Type.ToString().ToString().ToLower(),
                Name);

            if (DerivedFrom != null)
            {
                content += DerivedFrom.GenerateCode(0);
            }

            content += CSharpFile.NewLine;
            content += tabulators + CSharpFile.BeginBody;
            if (cSharpFileElements.Count > 0)
            {
                content += CSharpFile.NewLine;
                content += tabulators + CSharpFile.WriteObjects(cSharpFileElements, tabulatorsCount + 1);
            }
            content += tabulators + CSharpFile.EndBody;

            return(content);
        }
コード例 #2
0
        public override string GenerateCode(int tabulatorsCount)
        {
            string content = string.Empty;

            content += string.Format("namespace {0}", Name);
            content += CSharpFile.NewLine;
            content += CSharpFile.BeginBody;
            content += CSharpFile.WriteObjects(cSharpFileElements, tabulatorsCount + 1);
            content += CSharpFile.EndBody;

            return(content);
        }