public void Initialize(JSONValue json)
			{
				if (json.ContainsKey("label"))
				{
					this.label = json["label"].AsString();
				}
				if (json.ContainsKey("id"))
				{
					this.id = json["id"].AsString();
				}
			}
			public void Initialize(JSONValue json)
			{
				if (json.ContainsKey("type"))
				{
					this.type = json["type"].AsString();
				}
				if (json.ContainsKey("id"))
				{
					this.id = json["id"].AsString();
				}
			}
 protected override JSONValue HandlePost(Request request, JSONValue payload)
 {
   ScriptEditorSettings.ServerURL = payload["url"].AsString();
   ScriptEditorSettings.Name = !payload.ContainsKey("name") ? (string) null : payload["name"].AsString();
   ScriptEditorSettings.ProcessId = !payload.ContainsKey("processid") ? -1 : (int) payload["processid"].AsFloat();
   Logger.Log("[Pair] Name: " + (ScriptEditorSettings.Name ?? "<null>") + " ServerURL " + ScriptEditorSettings.ServerURL + " Process id: " + (object) ScriptEditorSettings.ProcessId);
   JSONValue jsonValue = new JSONValue();
   jsonValue["unityprocessid"] = (JSONValue) Process.GetCurrentProcess().Id;
   jsonValue["unityproject"] = (JSONValue) Application.dataPath;
   return jsonValue;
 }
			public void Initialize(JSONValue json)
			{
				if (json.ContainsKey("title"))
				{
					this.title = json["title"].AsString();
				}
				if (json.ContainsKey("id"))
				{
					this.id = json["id"].AsString();
				}
				if (json.ContainsKey("version"))
				{
					this.version = json["version"].AsString();
				}
				if (json.ContainsKey("version_id"))
				{
					this.version_id = json["version_id"].AsString();
				}
				if (json.ContainsKey("local_icon"))
				{
					this.local_icon = json["local_icon"].AsString();
				}
				if (json.ContainsKey("local_path"))
				{
					this.local_path = json["local_path"].AsString();
				}
				if (json.ContainsKey("pubdate"))
				{
					this.pubdate = json["pubdate"].AsString();
				}
				if (json.ContainsKey("description"))
				{
					this.description = json["description"].AsString();
				}
				if (json.ContainsKey("publisher"))
				{
					this.publisher = new AssetStoreContext.LabelAndId();
					this.publisher.Initialize(json["publisher"]);
				}
				if (json.ContainsKey("category"))
				{
					this.category = new AssetStoreContext.LabelAndId();
					this.category.Initialize(json["category"]);
				}
				if (json.ContainsKey("link"))
				{
					this.link = new AssetStoreContext.Link();
					this.link.Initialize(json["link"]);
				}
			}
Esempio n. 5
0
        public JSONValue Get(string key)
        {
            JSONValue result;

            if (!this.IsDict())
            {
                result = new JSONValue(null);
            }
            else
            {
                JSONValue jSONValue = this;
                string[]  array     = key.Split(new char[]
                {
                    '.'
                });
                for (int i = 0; i < array.Length; i++)
                {
                    string index = array[i];
                    if (!jSONValue.ContainsKey(index))
                    {
                        result = new JSONValue(null);
                        return(result);
                    }
                    jSONValue = jSONValue[index];
                }
                result = jSONValue;
            }
            return(result);
        }
 protected override JSONValue HandlePost(Request request, JSONValue payload)
 {
     JSONValue value2;
     if (payload.ContainsKey("documents"))
     {
         value2 = payload["documents"];
     }
     ScriptEditorSettings.OpenDocuments = (<>f__am$cache0 != null) ? new List<string>() : Enumerable.ToList<string>(Enumerable.Select<JSONValue, string>(value2.AsList(), <>f__am$cache0));
     ScriptEditorSettings.Save();
     return new JSONValue();
 }
 protected override JSONValue HandlePost(Request request, JSONValue payload)
 {
     ScriptEditorSettings.ServerURL = payload["url"].AsString();
     ScriptEditorSettings.Name = !payload.ContainsKey("name") ? null : payload["name"].AsString();
     ScriptEditorSettings.ProcessId = !payload.ContainsKey("processid") ? -1 : ((int) payload["processid"].AsFloat());
     object[] objArray1 = new object[6];
     objArray1[0] = "[Pair] Name: ";
     if (ScriptEditorSettings.Name == null)
     {
     }
     objArray1[1] = "<null>";
     objArray1[2] = " ServerURL ";
     objArray1[3] = ScriptEditorSettings.ServerURL;
     objArray1[4] = " Process id: ";
     objArray1[5] = ScriptEditorSettings.ProcessId;
     Logger.Log(string.Concat(objArray1));
     JSONValue value5 = new JSONValue();
     value5["unityprocessid"] = Process.GetCurrentProcess().Id;
     value5["unityproject"] = Application.dataPath;
     return value5;
 }
Esempio n. 8
0
        // Get the specified field in a dict or null json value if
        // no such field exists. The key can point to a nested structure
        // e.g. key1.key2 in  { key1 : { key2 : 32 } }
        public JSONValue Get(string key)
        {
            if (!IsDict())
            {
                return(new JSONValue(null));
            }
            JSONValue value = this;

            foreach (string part in key.Split('.'))
            {
                if (!value.ContainsKey(part))
                {
                    return(new JSONValue(null));
                }
                value = value[part];
            }
            return(value);
        }
Esempio n. 9
0
        public JSONValue Get(string key)
        {
            if (!this.IsDict())
            {
                return(new JSONValue(null));
            }
            JSONValue value2 = this;

            char[] separator = new char[] { '.' };
            foreach (string str in key.Split(separator))
            {
                if (!value2.ContainsKey(str))
                {
                    return(new JSONValue(null));
                }
                value2 = value2[str];
            }
            return(value2);
        }
Esempio n. 10
0
        public JSONValue Get(string key)
        {
            if (!this.IsDict())
            {
                return(new JSONValue((object)null));
            }
            JSONValue jsonValue = this;
            string    str       = key;

            char[] chArray = new char[1] {
                '.'
            };
            foreach (string index in str.Split(chArray))
            {
                if (!jsonValue.ContainsKey(index))
                {
                    return(new JSONValue((object)null));
                }
                jsonValue = jsonValue[index];
            }
            return(jsonValue);
        }
Esempio n. 11
0
        public JSONValue Get(string key)
        {
            if (!this.IsDict())
            {
                return(new JSONValue(null));
            }
            JSONValue result = this;

            string[] array = key.Split(new char[]
            {
                '.'
            });
            for (int i = 0; i < array.Length; i++)
            {
                string index = array[i];
                if (!result.ContainsKey(index))
                {
                    return(new JSONValue(null));
                }
                result = result[index];
            }
            return(result);
        }
 protected override JSONValue HandlePost(Request request, JSONValue payload)
 {
   ScriptEditorSettings.OpenDocuments = !payload.ContainsKey("documents") ? new List<string>() : payload["documents"].AsList().Select<JSONValue, string>((Func<JSONValue, string>) (d => d.AsString())).ToList<string>();
   ScriptEditorSettings.Save();
   return new JSONValue();
 }