示例#1
0
        public SectionTemplate(XNode sectionNode, int languageCode, EntityMetadata entityMetadata, ICellTemplateFactory cellTemplateFactory, RowTemplateFactory rowTemplateFactory)
            : base(sectionNode, languageCode, entityMetadata, cellTemplateFactory)
        {
            rowTemplateFactory.ThrowOnNull("rowTemplateFactory");

            RowTemplateFactory = rowTemplateFactory;

            string description;

            if (XNodeUtility.TryGetAttributeValue(sectionNode, "labels/label[@languagecode='{0}']".FormatWith(LanguageCode), "description", out description))
            {
                Label = description;
            }

            bool showLabel;

            if (XNodeUtility.TryGetBooleanAttributeValue(sectionNode, ".", "showlabel", out showLabel))
            {
                ShowLabel = showLabel;
            }

            bool showBar;

            if (XNodeUtility.TryGetBooleanAttributeValue(sectionNode, ".", "showbar", out showBar))
            {
                ShowBar = showBar;
            }
        }
示例#2
0
        public FormXmlCellMetadata(XNode cellNode, EntityMetadata entityMetadata, int languageCode)
            : base(cellNode, entityMetadata, languageCode, GetDataFieldName)
        {
            bool disabled;

            if (XNodeUtility.TryGetBooleanAttributeValue(cellNode, "control", "disabled", out disabled))
            {
                // Preserve any existing true value of Disabled.
                Disabled = Disabled || disabled;
            }

            XNodeUtility.TryGetAttributeValue(cellNode, "labels/label[@languagecode='{0}']".FormatWith(LanguageCode), "description", out _label);

            if (!XNodeUtility.TryGetBooleanAttributeValue(cellNode, ".", "showlabel", out _showLabel))
            {
                // The CRM defaults to true if the showlabel attribute does not exist, so we will do the same.
                _showLabel = true;
            }
        }