예제 #1
0
 /// <summary>
 /// Handles the Load event of the m_DataEditor control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 void m_DataEditor_Load(object sender, EventArgs e)
 {
     if (!m_DataEditor.Page.IsPostBack && !string.IsNullOrEmpty((string)this.Data.Value))
     {
         m_DataEditor.State = MultiUrlPickerState.Deserialize((string)this.Data.Value);
     }
 }
예제 #2
0
        /// <summary>
        /// Inits the specified current node id.
        /// </summary>
        /// <param name="CurrentNodeId">The current node id.</param>
        /// <param name="PropertyData">The property data.</param>
        /// <param name="instance">The instance.</param>
        /// <returns></returns>
        public bool Init(int CurrentNodeId, string PropertyData, out object instance)
        {
            if (!Settings.RazorModelBindingEnabled)
            {
                if (Helper.Xml.CouldItBeXml(PropertyData))
                {
#pragma warning disable 0618
                    instance = new DynamicXml(PropertyData);
#pragma warning restore 0618
                    return(true);
                }

                instance = PropertyData;
                return(true);
            }

            MultiUrlPickerState state = null;

            if (!string.IsNullOrEmpty(PropertyData))
            {
                state = MultiUrlPickerState.Deserialize(PropertyData);
            }

            instance = state;

            return(true);
        }
        /// <summary>
        /// Attempts to convert the value specified into a useable value on the front-end
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public Attempt <object> ConvertPropertyValue(object value)
        {
            if (value != null && value.ToString().Length > 0)
            {
                return(new Attempt <object>(true, MultiUrlPickerState.Deserialize(value.ToString())));
            }

            return(Attempt <object> .False);
        }
        public object ConvertValueWhenRead(object inputValue)
        {
            if (inputValue is string)
            {
                return(MultiUrlPickerState.Deserialize(inputValue.ToString()));
            }

            return(inputValue);
        }
예제 #5
0
 protected override IEnumerable <UrlPickerState> ConstructItem(string raw)
 {
     return(MultiUrlPickerState.Deserialize(raw).Items);
 }