Exemplo n.º 1
0
        /// <summary>
        /// Sets the value.
        /// </summary>
        /// <param name="control">The control.</param>
        /// <param name="configurationValues">The configuration values.</param>
        /// <param name="value">The value.</param>
        public override void SetEditValue(System.Web.UI.Control control, Dictionary <string, ConfigurationValue> configurationValues, string value)
        {
            DayOfWeek?dayOfWeek = null;

            if (!string.IsNullOrWhiteSpace(value))
            {
                dayOfWeek = (DayOfWeek)(value.AsInteger());
            }

            DayOfWeekPicker dayOfWeekPicker = control as DayOfWeekPicker;

            dayOfWeekPicker.SelectedDayOfWeek = dayOfWeek;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Reads new values entered by the user for the field
        /// </summary>
        /// <param name="control">Parent control that controls were added to in the CreateEditControl() method</param>
        /// <param name="configurationValues">The configuration values.</param>
        /// <returns></returns>
        public override string GetEditValue(System.Web.UI.Control control, Dictionary <string, ConfigurationValue> configurationValues)
        {
            List <string> values = new List <string>();

            DayOfWeekPicker dayOfWeekPicker = control as DayOfWeekPicker;

            if (dayOfWeekPicker != null)
            {
                var selectedDay = dayOfWeekPicker.SelectedDayOfWeek;
                if (selectedDay != null)
                {
                    return(selectedDay.ConvertToInt().ToString());
                }
            }

            return(null);
        }