Ejemplo n.º 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);
     }
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Load"/> event.
        /// </summary>
        /// <param name="e">The <see cref="T:System.EventArgs"/> object that contains the event data.</param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            //add the js/css required
            this.AddAllMultiUrlPickerClientDependencies();

            // If this.State was not set, create a default state
            if (State == null)
            {
                State = new MultiUrlPickerState();
            }
        }
Ejemplo n.º 6
0
 protected override IEnumerable <UrlPickerState> ConstructItem(string raw)
 {
     return(MultiUrlPickerState.Deserialize(raw).Items);
 }