MonoTouch.Dialog.JsonDialogViewController._configureDialog C# (CSharp) 메소드

_configureDialog() 개인적인 메소드

private _configureDialog ( JsonValue json, System.Json.JsonObject valuesJson ) : void
json System.Json.JsonValue
valuesJson System.Json.JsonObject
리턴 void
		private void _configureDialog(JsonValue json, JsonObject valuesJson){
			if (json.ContainsKey("grouped")) {
				Style = bool.Parse(json["grouped"].ToString()) ? UITableViewStyle.Grouped : UITableViewStyle.Plain;
			}
			if (json.ContainsKey("title"))
				Title = json["title"];
			
			if (json.ContainsKey("dataroot")) 
				DataRootName = json["dataroot"];
			
			if (json.ContainsKey("rightbaritem")){
				var item = (JsonObject)json["rightbaritem"];
				string datavalue = null, id = null;
				id = item.s("id");
				if (valuesJson!=null && !string.IsNullOrEmpty(id)){
					datavalue = valuesJson.s(id);
				}
					
				if (item.ContainsKey("action")) {
						rightBarItem = item.ContainsKey("url") ? 
							new SubmitElement(item.s("caption"), datavalue ?? item.s("url"), null, null) :
							new ActionElement(item.s("caption"), datavalue ?? item.s("action"), null);
						rightBarItem.ID = id;
				}	
				if (item.ContainsKey("image")){
					NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIImage.FromBundle(item.s("image")), UIBarButtonItemStyle.Plain, (object o, EventArgs a)=>{
						InvokeAction(this.rightBarItem);
					});
				} else {
					NavigationItem.RightBarButtonItem = new UIBarButtonItem(item.s("caption"), UIBarButtonItemStyle.Plain, (object o, EventArgs a)=>{
					InvokeAction(this.rightBarItem);
				});
				}
			}
			if (json.ContainsKey("leftbaritem")){
				var item = (JsonObject)json["leftbaritem"];
				if (item.ContainsKey("action")) {
						leftBarItem = item.ContainsKey("url") ? 
							new SubmitElement(item.s("caption"), item.s("url"), null, null) :
							new ActionElement(item.s("caption"), item.s("action"), null);
						leftBarItem.ID = item.s("id");
				}	
				NavigationItem.LeftBarButtonItem = new UIBarButtonItem(item.s("caption"), UIBarButtonItemStyle.Plain, (object o, EventArgs a)=>{
					InvokeAction(this.leftBarItem);
				});
			}
			
		}