using System.Collections.Generic; namespace ImaginationOverflow.UniversalDeepLinking.Editor.External { /// /// Represents a dictionary element in plist document. /// public class PlistElementDict : PlistElement { private SortedDictionary m_PrivateValue = new SortedDictionary(); /// /// The values stored in the dictionary element. /// public IDictionary values { get { return (IDictionary)this.m_PrivateValue; } } public new PlistElement this[string key] { get { if (this.values.ContainsKey(key)) return this.values[key]; return (PlistElement)null; } set { this.values[key] = value; } } /// /// Convenience method to set an integer property. /// /// The key of the property. /// The value of the property. public void SetInteger(string key, int val) { this.values[key] = (PlistElement)new PlistElementInteger(val); } /// /// Convenience method to set a string property. /// /// The key of the property. /// The value of the property. public void SetString(string key, string val) { this.values[key] = (PlistElement)new PlistElementString(val); } /// /// Convenience method to set a boolean property. /// /// The key of the property. /// The value of the property. public void SetBoolean(string key, bool val) { this.values[key] = (PlistElement)new PlistElementBoolean(val); } /// /// Convenience method to set a property to a new array element. /// /// The key of the property. /// /// The new array element. /// public PlistElementArray CreateArray(string key) { PlistElementArray plistElementArray = new PlistElementArray(); this.values[key] = (PlistElement)plistElementArray; return plistElementArray; } /// /// Convenience method to set a property to a new dictionary element. /// /// The key of the property. /// /// The new dictionary element. /// public PlistElementDict CreateDict(string key) { PlistElementDict plistElementDict = new PlistElementDict(); this.values[key] = (PlistElement)plistElementDict; return plistElementDict; } } }