BuildClassTranslationUnit() public static method

public static BuildClassTranslationUnit ( VisibilityToken visibility, string name, string baseClassName ) : ITranslationUnit
visibility VisibilityToken
name string
baseClassName string
return ITranslationUnit
Example #1
0
        public string RenderEmptyClassWithInheritance()
        {
            ITranslationUnit translationUnit = TranslationUnitBuilder.BuildClassTranslationUnit(
                ModifierTokens.Public, "EmptyClassWithInheritance", "BaseClass");

            return(translationUnit.Translate());
        }
Example #2
0
        public string RenderSimpleEmptyClass()
        {
            ITranslationUnit translationUnit = TranslationUnitBuilder.BuildClassTranslationUnit(
                ModifierTokens.Public, "SimpleEmptyClass", null);

            return(translationUnit.Translate());
        }
Example #3
0
        public string RenderSimpleEmptyClass()
        {
            ITranslationUnit translationUnit = TranslationUnitBuilder.BuildClassTranslationUnit(
                VisibilityToken.Public, "SimpleEmptyClass", null);

            return(translationUnit.Translate());
        }
Example #4
0
        public string RenderEmptyClassWithOneInterface()
        {
            var translationUnit = TranslationUnitBuilder.BuildClassTranslationUnit(
                ModifierTokens.Public, "EmptyClassWithOneInterface", null)
                                  as ClassDeclarationTranslationUnit;

            translationUnit.AddInterface("Interface1");

            return(translationUnit.Translate());
        }
Example #5
0
        public string RenderClassWithEmptyMethods()
        {
            var translationUnit = TranslationUnitBuilder.BuildClassTranslationUnit(
                ModifierTokens.Public, "ClassWithEmptyMethods", null)
                                  as ClassDeclarationTranslationUnit;

            translationUnit.AddEmptyMethod("Method1");
            translationUnit.AddEmptyMethod("Method2");
            translationUnit.AddEmptyMethod("Method3");

            return(translationUnit.Translate());
        }
Example #6
0
        public string RenderEmptyClassWithInheritanceAndManyInterface()
        {
            var translationUnit = TranslationUnitBuilder.BuildClassTranslationUnit(
                ModifierTokens.Public, "EmptyClassWithInheritanceAndManyInterface", "BaseClass")
                                  as ClassDeclarationTranslationUnit;

            translationUnit.AddInterface("Interface1");
            translationUnit.AddInterface("Interface2");
            translationUnit.AddInterface("Interface3");

            return(translationUnit.Translate());
        }
Example #7
0
        public string RenderEmptyClassWithManyInterface()
        {
            var translationUnit = TranslationUnitBuilder.BuildClassTranslationUnit(
                VisibilityToken.Public, "EmptyClassWithManyInterface", null)
                                  as ClassDeclarationTranslationUnit;

            translationUnit.AddInterface("Interface1");
            translationUnit.AddInterface("Interface2");
            translationUnit.AddInterface("Interface3");

            return(translationUnit.Translate());
        }
Example #8
0
        public string ClassWithSimpleMethods()
        {
            var translationUnit = TranslationUnitBuilder.BuildClassTranslationUnit(
                ModifierTokens.Public, "ClassWithSimpleMethods", null)
                                  as ClassDeclarationTranslationUnit;

            var method1 = translationUnit.AddEmptyMethod("Method1");
            var method2 = translationUnit.AddEmptyMethod("Method2");
            var method3 = translationUnit.AddEmptyMethod("Method3");

            method1.AddVariable("int", "var1");
            method1.AddVariable("int", "var2");
            method2.AddVariable("string", "var1");
            method3.AddVariable("string", "var1");
            method3.AddVariable("int", "var2");
            method3.AddVariable("string", "var3");

            return(translationUnit.Translate());
        }