MonoMobile.Forms.FormDialogViewController.SetValue C# (CSharp) Method

SetValue() public method

public SetValue ( string key, string value ) : void
key string
value string
return void
		public void SetValue(string key, string value){
			if (_elementValues.ContainsKey(key))
				_elementValues.Remove(key);
			_elementValues.Add(key, value);
		}
		

Usage Example

Esempio n. 1
0
        private void _parseElement(JsonObject json, Section section, JsonValue data)
        {
            string type = "Unknown";

            try {
                type = json["type"];
                if (type == "HiddenElement")
                {
                    var name = json.asString("id");
                    _controller.SetValue(name, data == null? json.asString("value") : data.CleanString());
                }
                else
                {
                    string id         = (json.ContainsKey("id") ? json["id"] : null);
                    var    newElement = ElementParsers.Parsers[type](json, _controller, data);
                    if (newElement != null)
                    {
                        if (!string.IsNullOrEmpty(id))
                        {
                            newElement.ID = new NSString(id);
                        }

                        section.Add(newElement);
                    }
                }
            } catch (Exception e) {
                Console.WriteLine("Problem parsing element. Element was skipped. Type: " + type + " = " + e.ToString());
            }
        }
All Usage Examples Of MonoMobile.Forms.FormDialogViewController::SetValue