SimpleJSON.JSONNode.AddElement C# (CSharp) Method

AddElement() static private method

static private AddElement ( JSONNode ctx, string token, string tokenName, bool tokenIsString ) : void
ctx JSONNode
token string
tokenName string
tokenIsString bool
return void
		static void AddElement(JSONNode ctx, string token, string tokenName, bool tokenIsString)
		{
			if (tokenIsString)
			{
				if (ctx is JSONArray)
					ctx.Add(token);
				else
					ctx.Add(tokenName, token); // assume dictionary/object
			}
			else
			{
				JSONData number = Numberize(token);
				if (ctx is JSONArray)
					ctx.Add(number);
				else
					ctx.Add(tokenName, number);

			}
		}