Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Namespace Textbox #20

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .vs/JsonUtils/v14/.suo
Binary file not shown.
1,028 changes: 1,028 additions & 0 deletions .vs/config/applicationhost.config

Large diffs are not rendered by default.

110 changes: 110 additions & 0 deletions JsonCSharpClassGeneratorLib/CodeWriters/CSharpCodeWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ public string DisplayName
get { return "C#"; }
}

public IList<string> Keywords
{
get { return _getKeywords(); }
}


private const string NoRenameAttribute = "[Obfuscation(Feature = \"renaming\", Exclude = true)]";
private const string NoPruneAttribute = "[Obfuscation(Feature = \"trigger\", Exclude = false)]";
Expand Down Expand Up @@ -222,6 +227,111 @@ private void WriteClassMembers(IJsonClassGeneratorConfig config, TextWriter sw,

}

private List<string> _getKeywords()
{
return new List<string> {"abstract"
,"add"
,"as"
,"ascending"
,"async"
,"await"
,"base"
,"bool"
,"break "
,"by "
,"byte"
,"case"
,"catch"
,"char"
,"checked"
,"class"
,"const"
,"continue"
,"decimal"
,"default"
,"delegate"
,"descending"
,"do"
,"double"
,"dynamic"
,"else"
,"enum"
,"equals"
,"explicit"
,"extern"
,"false"
,"finally"
,"fixed"
,"float"
,"for"
,"foreach"
,"from"
,"get"
,"global"
,"goto"
,"group"
,"if"
,"implicit"
,"in"
,"int"
,"interface"
,"internal"
,"into"
,"is"
,"join"
,"let"
,"lock"
,"long"
,"namespace"
,"new"
,"null"
,"object"
,"on"
,"operator"
,"orderby"
,"out"
,"override"
,"params"
,"partial"
,"private"
,"protected"
,"public"
,"readonly"
,"ref"
,"remove"
,"return"
,"sbyte"
,"sealed"
,"select"
,"set"
,"short"
,"sizeof"
,"stackalloc"
,"static"
,"string"
,"struct"
,"switch"
,"this"
,"throw"
,"true"
,"try"
,"typeof"
,"uint"
,"ulong"
,"unchecked"
,"unsafe"
,"ushort"
,"using"
,"value"
,"var"
,"virtual"
,"void"
,"volatile"
,"where"
,"while"
,"yield"};
}




Expand Down
62 changes: 62 additions & 0 deletions JsonCSharpClassGeneratorLib/CodeWriters/JavaCodeWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public string DisplayName
get { return "Java"; }
}

public IList<string> Keywords { get {return _getKeywords();} }

public string GetTypeName(JsonType type, IJsonClassGeneratorConfig config)
{
var arraysAsLists = !config.ExplicitDeserialization;
Expand Down Expand Up @@ -199,5 +201,65 @@ private static string ChangeFirstChar(string value, bool toCaptial = true)

return sb.ToString();
}

private static List<string> _getKeywords()
{
return new List<string>()
{
"abstract",
"assert" ,
"boolean",
"break",
"byte",
"case",
"catch",
"char",
"class",
"const",
"default",
"do",
"double",
"else",
"enum",
"extends",
"false",
"final",
"finally",
"float",
"for",
"goto",
"if",
"implements",
"import",
"instanceof",
"int",
"interface",
"long",
"native",
"new",
"null",
"package",
"private",
"protected",
"public",
"return",
"short",
"static",
"strictfp",
"super",
"switch",
"synchronized",
"this",
"throw",
"throws",
"transient",
"true",
"try",
"void",
"volatile",
"while",
"continue"
};
}
}
}
2 changes: 2 additions & 0 deletions JsonCSharpClassGeneratorLib/CodeWriters/PhpCodeWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public string DisplayName
get { return "PHP"; }
}

public IList<string> Keywords { get { return new List<string>(); } }

public string GetTypeName(JsonType type, IJsonClassGeneratorConfig config)
{
var arraysAsLists = !config.ExplicitDeserialization;
Expand Down
5 changes: 4 additions & 1 deletion JsonCSharpClassGeneratorLib/CodeWriters/SqlCodeWriter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.IO;
using System.Collections.Generic;
using System.IO;

namespace Xamasoft.JsonClassGenerator.CodeWriters
{
Expand All @@ -14,6 +15,8 @@ public string DisplayName
get { return "SQL"; }
}

public IList<string> Keywords { get { return new List<string>(); } }

public string GetTypeName(JsonType type, IJsonClassGeneratorConfig config)
{
var arraysAsLists = !config.ExplicitDeserialization;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public string DisplayName
get { return "TypeScript"; }
}

public IList<string> Keywords { get { return new List<string>(); } }

public string GetTypeName(JsonType type, IJsonClassGeneratorConfig config)
{
switch (type.Type)
Expand Down
Loading