using System; using System.ComponentModel; namespace umbraco.editorControls.XPathCheckBoxList { /// /// DataType configuration options for the XPath CheckBoxList /// [Obsolete("IDataType and all other references to the legacy property editors are no longer used this will be removed from the codebase in future versions")] public class XPathCheckBoxListOptions : AbstractOptions { /// /// string guid for either a node, media or member /// private string type = null; /// /// Initializes a new instance of the class. /// public XPathCheckBoxListOptions() : base(true) { } /// /// Gets or sets the guid as a string representing either a Document, Media or Member /// public string Type { get { // null check for the type, as older versions of this data type won't have this value stored if (this.type == null) { return uQuery.UmbracoObjectType.Document.GetGuid().ToString(); } return this.type; } set { this.type = value; } } /// /// Gets or sets the XPath string used to get the Nodes, Media or Members /// [DefaultValue("//*")] public string XPath { get; set; } /// /// Defaults to true, where the property value will be stored as an Xml Fragment, else if false, a Csv will be stored /// [DefaultValue(true)] public bool UseXml { get; set; } /// /// Defaults to true, where property value stored is NodeIds, else if false, then value stored is the Node Names /// [DefaultValue(true)] public bool UseIds { get; set; } /// /// Gets the UmbracoObjectType from the stored string guid /// /// a Document, Media or Member public uQuery.UmbracoObjectType UmbracoObjectType { get { return uQuery.GetUmbracoObjectType(new Guid(this.Type)); } } } }