/// <summary>
        /// Build the dynamic edit controls for this file format.
        /// </summary>
        /// <param name="fileFormat">The file format whose controls need to be built.</param>
        /// <param name="SetValues">Whether or not to set the initial values.</param>
        protected void BuildDynamicControls(ImageCashLetterFileFormat fileFormat, bool SetValues)
        {
            FileFormatEntityTypeId = fileFormat.EntityTypeId;

            fileFormat.LoadAttributes();
            phEditAttributes.Controls.Clear();
            Rock.Attribute.Helper.AddEditControls(fileFormat, phEditAttributes, SetValues, BlockValidationGroup, new List <string> {
                "Active", "Order"
            }, false, 2);
            foreach (var tb in phAttributes.ControlsOfTypeRecursive <TextBox>())
            {
                tb.AutoCompleteType           = AutoCompleteType.Disabled;
                tb.Attributes["autocomplete"] = "off";
            }
        }
示例#2
0
        /// <summary>
        /// Gets the attribute value for the file format
        /// </summary>
        /// <param name="fileFormat">The file format.</param>
        /// <param name="key">The key.</param>
        /// <returns></returns>
        public string GetAttributeValue(ImageCashLetterFileFormat fileFormat, string key)
        {
            if (fileFormat.AttributeValues == null)
            {
                fileFormat.LoadAttributes();
            }

            var values = fileFormat.AttributeValues;

            if (values != null && values.ContainsKey(key))
            {
                var keyValues = values[key];
                if (keyValues != null)
                {
                    return(keyValues.Value);
                }
            }

            return(string.Empty);
        }