예제 #1
0
        /// <summary>
        /// Static mechanism to render a survey.
        /// </summary>
        /// <param name="survey">The survey.</param>
        /// <param name="placeHolder">The place holder.</param>
        /// <param name="readOnly">if set to <c>true</c> [read only].</param>
        /// <param name="showRequiredNotation">if set to <c>true</c> [show required notation].</param>
        /// <param name="validationProvider">The validation provider.</param>
        /// <param name="localizer">Localizes text.</param>
        public static void RenderSurvey(ISurvey survey, PlaceHolder placeHolder, bool readOnly, bool showRequiredNotation, ValidationProviderBase validationProvider, ILocalizer localizer)
        {
            Debug.Assert(placeHolder != null, "placeHolder cannot be null");
            Debug.Assert(validationProvider != null, "validationProvider cannot be null");

            // add the survey title
            if (survey.ShowText)
            {
                var titleDiv = new HtmlGenericControl("DIV");
                titleDiv.Attributes["class"] = Utility.CssClassSurveyTitle;
                titleDiv.InnerText           = survey.Text;
                placeHolder.Controls.Add(titleDiv);
            }

            List <ISection> sections = survey.GetSections();

            foreach (ISection s in sections)
            {
                s.Render(placeHolder, readOnly, showRequiredNotation, validationProvider, localizer);
            }
        }
예제 #2
0
        /// <summary>
        /// Static mechanism to render a survey.
        /// </summary>
        /// <param name="survey">The survey.</param>
        /// <param name="placeHolder">The place holder.</param>
        /// <param name="readOnly">if set to <c>true</c> [read only].</param>
        /// <param name="showRequiredNotation">if set to <c>true</c> [show required notation].</param>
        /// <param name="validationProvider">The validation provider.</param>
        /// <param name="localizer">Localizes text.</param>
        public static void RenderSurvey(ISurvey survey, PlaceHolder placeHolder, bool readOnly, bool showRequiredNotation, ValidationProviderBase validationProvider, ILocalizer localizer)
        {
            Debug.Assert(placeHolder != null, "placeHolder cannot be null");
            Debug.Assert(validationProvider != null, "validationProvider cannot be null");

            // add the survey title
            if (survey.ShowText)
            {
                var titleDiv = new HtmlGenericControl("DIV");
                titleDiv.Attributes["class"] = Utility.CssClassSurveyTitle;
                titleDiv.InnerText = survey.Text;
                placeHolder.Controls.Add(titleDiv);
            }

            List<ISection> sections = survey.GetSections();
            foreach (ISection s in sections)
            {
                s.Render(placeHolder, readOnly, showRequiredNotation, validationProvider, localizer);
            }
        }