BuildMethodSignatureTranslationUnit() public static method

public static BuildMethodSignatureTranslationUnit ( VisibilityToken visibility, string returnType, string name ) : ITranslationUnit
visibility VisibilityToken
returnType string
name string
return ITranslationUnit
コード例 #1
0
        public string RenderSimpleEmptyMethod()
        {
            ITranslationUnit translationUnit = TranslationUnitBuilder.BuildMethodSignatureTranslationUnit(
                ModifierTokens.Public, null, "SimpleMethodSignature");

            return(translationUnit.Translate());
        }
コード例 #2
0
        public string RenderEmptyMethodWithReturn()
        {
            ITranslationUnit translationUnit = TranslationUnitBuilder.BuildMethodSignatureTranslationUnit(
                ModifierTokens.Public, Lexems.StringType, "MethodSignatureWithReturn");

            return(translationUnit.Translate());
        }
コード例 #3
0
        public string RenderEmptyMethod1Argument()
        {
            var translationUnit = TranslationUnitBuilder.BuildMethodSignatureTranslationUnit(
                ModifierTokens.Public, null, "MethodSignature1Argument") as MethodSignatureDeclarationTranslationUnit;

            translationUnit.AddArgument(ArgumentDefinitionTranslationUnit.Create(
                                            TypeIdentifierTranslationUnit.Number, IdentifierTranslationUnit.Create("param1")));

            return(translationUnit.Translate());
        }
コード例 #4
0
ファイル: MethodSignatures.cs プロジェクト: scottyb86/Rosetta
        public string RenderEmptyMethod2Arguments()
        {
            var translationUnit = TranslationUnitBuilder.BuildMethodSignatureTranslationUnit(
                VisibilityToken.Public, null, "MethodSignature2Arguments") as MethodSignatureDeclarationTranslationUnit;

            translationUnit.AddArgument(ArgumentDefinitionTranslationUnit.Create(
                                            TypeIdentifierTranslationUnit.Number, IdentifierTranslationUnit.Create("param1")));
            translationUnit.AddArgument(ArgumentDefinitionTranslationUnit.Create(
                                            TypeIdentifierTranslationUnit.String, IdentifierTranslationUnit.Create("param2")));

            return(translationUnit.Translate());
        }
コード例 #5
0
        public string RenderEmptyMethodManyArguments()
        {
            var translationUnit = TranslationUnitBuilder.BuildMethodSignatureTranslationUnit(
                ModifierTokens.Public, null, "MethodSignatureManyArguments") as MethodSignatureDeclarationTranslationUnit;

            translationUnit.AddArgument(ArgumentDefinitionTranslationUnit.Create(
                                            TypeIdentifierTranslationUnit.Number, IdentifierTranslationUnit.Create("param1")));
            translationUnit.AddArgument(ArgumentDefinitionTranslationUnit.Create(
                                            TypeIdentifierTranslationUnit.String, IdentifierTranslationUnit.Create("param2")));
            translationUnit.AddArgument(ArgumentDefinitionTranslationUnit.Create(
                                            TypeIdentifierTranslationUnit.Boolean, IdentifierTranslationUnit.Create("param3")));
            translationUnit.AddArgument(ArgumentDefinitionTranslationUnit.Create(
                                            TypeIdentifierTranslationUnit.Any, IdentifierTranslationUnit.Create("param4")));

            return(translationUnit.Translate());
        }