System.Json.JsonValue.ContainsKey C# (CSharp) Method

ContainsKey() public method

public ContainsKey ( string key ) : bool
key string
return bool
        public virtual bool ContainsKey(string key)
        {
            throw new InvalidOperationException();
        }

Usage Example

		void Populate (JsonValue json, RootElement root, JsonValue data)
		{
			if (json.ContainsKey(Constants.Title))
				root.Caption = json[Constants.Title];
			
			JsonValue jsonRoot = null;
			try {
				jsonRoot = json[Constants.Root];
			} catch (Exception){
				Console.WriteLine("Bad JSON: could not find the root element - "+json.ToString()) ;	
				return;
			}
			
			if (json.ContainsKey(Constants.DataRoot)){
				var dataroot = json[Constants.DataRoot].CleanString();
				if (data!=null && data.ContainsKey(dataroot))
					data = data[dataroot];
			}			
			
			
			foreach (JsonObject section in jsonRoot){
				var sec = new FormSectionBuilder(this._controller).Build(section, data);
				foreach (var el in sec.Elements) {
					if (!string.IsNullOrEmpty(el.ID) && !_elements.ContainsKey(el.ID)) _elements.Add(el.ID, el);
				}
				root.Add(sec);
			}
		}
All Usage Examples Of System.Json.JsonValue::ContainsKey