Ejemplo n.º 1
0
        private void CreateQuestion(IList <DataRow> responses, Control parent)
        {
            var row     = responses.First();
            var monitor = _MonitorFactory.GetMonitorInstance(row.QuestionKey());

            // create the accordion header
            var accordionHeader = AddAccordionHeader(parent, row.Question());

            // create the accordion panel
            var panel = AddContainer(parent, "tab-answer-" + row.QuestionKey(),
                                     "content-panel accordion-panel");

            AddAsteriskIndicator(accordionHeader, "Ast" + row.QuestionKey(),
                                 monitor.GetAsteriskClass(null), $"There are unsaved changes to \"{row.Question()}\"");

            AddStarIndicator(accordionHeader, "Star" + row.QuestionKey(),
                             monitor.GetStarClass(null, "hasvalue"),
                             $"We have a response from you for \"{row.Question()}\"");

            _UpdateAnswer.CreateControls(panel, responses, monitor);
        }
Ejemplo n.º 2
0
        private void CreateQuestion(Control parent, IList <AnswersViewRow> responses,
                                    Control tabs, string tabName, UpdateAnswer updateAnswer,
                                    IDictionary <string, string> alternateTabLabels = null,
                                    Dictionary <string, string> alternateHeadings   = null)
        {
            var row = responses.First();

            if (_QuestionTabFont == null)
            {
                _QuestionTabFont = new Font(QuestionTabFontFamily, QuestionTabFontSize,
                                            FontStyle.Bold);
            }

            var monitor = MonitorFactory.GetMonitorInstance(row.QuestionKey);

            var panel = AddContainer(parent, "tab-" + tabName + "-" + row.QuestionKey.ToLowerInvariant(),
                                     "content-panel tab-panel vtab-panel");

            panel.ClientIDMode = ClientIDMode.Static;

            // create vertical tab
            var tabLabel = alternateTabLabels?.ContainsKey(row.QuestionKey) == true
        ? alternateTabLabels[row.QuestionKey]
        : BreakForTab(row.Question, _QuestionTabFont, QuestionTabMaxWidth);
            var verticalTab = AddVertTab(tabs, "#" + panel.ClientID, tabLabel, " vcentered-tab");

            // center the a tag -- the first child of the tab always
            Center(verticalTab.Controls[0], false, true);

            AddAsteriskIndicator(verticalTab, "Ast" + row.QuestionKey,
                                 monitor.GetAsteriskClass(null),
                                 $"There are unsaved changes to \"{row.Question}\"");

            AddStarIndicator(verticalTab, "Star" + row.QuestionKey,
                             monitor.GetStarClass(null, "hasvalue"),
                             $"We have a response from you for \"{row.Question}\"");

            updateAnswer.CreateControls(panel, responses, monitor, alternateHeadings);
        }