public static CodeSnippetTypeMember CreateXRootGetter(string typeName, string fqTypeName, LocalSymbolTable lst) { string symbolName = lst.AddMember(typeName); CodeSnippetTypeMember castMember = new CodeSnippetTypeMember(); string[] strArrays = new string[] { "\r\n", " public ", fqTypeName, " ", symbolName, " { get {", "return rootObject as ", fqTypeName, "; } }" }; castMember.Text = string.Concat(strArrays); return(castMember); }
public static CodeSnippetTypeMember CreateXRootGetter(string typeName, string fqTypeName, LocalSymbolTable lst, GeneratedTypesVisibility visibility = GeneratedTypesVisibility.Public) { string symbolName = lst.AddMember(typeName); CodeSnippetTypeMember castMember = new CodeSnippetTypeMember(); castMember.Text = String.Concat("\r\n", $"\t\t{visibility.ToKeyword()} ", fqTypeName, " ", symbolName, " { get {", "return rootObject as ", fqTypeName, "; } }"); return(castMember); }
public static CodeSnippetTypeMember CreateXRootGetter(string typeName, string fqTypeName, LocalSymbolTable lst) { string symbolName = lst.AddMember(typeName); CodeSnippetTypeMember castMember = new CodeSnippetTypeMember(); castMember.Text = String.Concat("\r\n", " public ", fqTypeName, " ", symbolName, " { get {", "return rootObject as ", fqTypeName,"; } }"); return castMember; }