Inheritance: RockDropDownList
Exemplo n.º 1
0
        /// <summary>
        /// Creates the control(s) neccessary for prompting user for a new value
        /// </summary>
        /// <param name="configurationValues">The configuration values.</param>
        /// <param name="id"></param>
        /// <returns>
        /// The control
        /// </returns>
        public override Control EditControl( Dictionary<string, ConfigurationValue> configurationValues, string id )
        {
            var control = new BinaryFilePicker { ID = id }; 

            if ( configurationValues != null && configurationValues.ContainsKey( "binaryFileType" ) )
            {
                int definedTypeId = 0;
                if ( Int32.TryParse( configurationValues["binaryFileType"].Value, out definedTypeId ) )
                {
                    control.BinaryFileTypeId = definedTypeId;
                }
            }

            return control;
        }
        /// <summary>
        /// Creates the control(s) necessary for prompting user for a new value
        /// </summary>
        /// <param name="configurationValues">The configuration values.</param>
        /// <param name="id"></param>
        /// <returns>
        /// The control
        /// </returns>
        public override Control EditControl( Dictionary<string, ConfigurationValue> configurationValues, string id )
        {
            var control = new BinaryFilePicker { ID = id };

            if ( configurationValues != null && configurationValues.ContainsKey( BINARY_FILE_TYPE ) )
            {
                control.BinaryFileTypeGuid = configurationValues[BINARY_FILE_TYPE].Value.AsGuidOrNull();
            }

            return control;
        }