RenderControl() public méthode

Outputs server control content to a provided T:System.Web.UI.HtmlTextWriter object and stores tracing information about the control if tracing is enabled.
public RenderControl ( System.Web.UI.HtmlTextWriter writer ) : void
writer System.Web.UI.HtmlTextWriter The object that receives the control content.
Résultat void
Exemple #1
0
        /// <summary>
        /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client.
        /// </summary>
        /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            writer.RenderBeginTag(HtmlTextWriterTag.Tr);

            writer.RenderBeginTag(HtmlTextWriterTag.Td);
            _lblActionTypeName.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderBeginTag(HtmlTextWriterTag.Td);
            _lLastProcessed.RenderControl(writer);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "grid-select-field");
            writer.RenderBeginTag(HtmlTextWriterTag.Td);
            _cbIsActionCompleted.Enabled         = CanEdit;
            _cbIsActionCompleted.ValidationGroup = ValidationGroup;
            _cbIsActionCompleted.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderBeginTag(HtmlTextWriterTag.Td);
            _lCompleted.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();
        }
Exemple #2
0
        /// <summary>
        /// Render any additional picker actions
        /// </summary>
        /// <param name="writer">The writer.</param>
        public override void RenderCustomPickerActions(HtmlTextWriter writer)
        {
            base.RenderCustomPickerActions(writer);

            if (AllowInactiveSelection)
            {
                _cbShowInactiveSchedules.RenderControl(writer);
            }
        }
Exemple #3
0
        /// <summary>
        /// Render any additional picker actions
        /// </summary>
        /// <param name="writer">The writer.</param>
        public override void RenderCustomPickerActions(HtmlTextWriter writer)
        {
            base.RenderCustomPickerActions(writer);

            if (this.AllowMultiSelect)
            {
                _btnSelectAll.RenderControl(writer);
            }

            _cbShowInactiveGroups.RenderControl(writer);
        }
Exemple #4
0
        private void RenderCellPhone(HtmlTextWriter writer)
        {
            writer.RenderBeginTag(HtmlTextWriterTag.Td);
            writer.AddAttribute("class", "form-group");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _pnbCellPhone.RenderControl(writer);
            writer.RenderEndTag();
            writer.RenderEndTag();

            if (IsMessagingVisible)
            {
                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.AddAttribute("class", "text-center");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _cbIsMessagingEnabled.RenderControl(writer);
                writer.RenderEndTag();
                writer.RenderEndTag();
            }
        }
Exemple #5
0
        /// <summary>
        /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            if (this.Visible)
            {
                writer.AddAttribute("rowid", ID);
                writer.RenderBeginTag(HtmlTextWriterTag.Tr);

                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.Write(PersonName);
                writer.RenderEndTag();

                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.AddAttribute("class", "form-group");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _pnbHomePhone.RenderControl(writer);
                writer.RenderEndTag();
                writer.RenderEndTag();

                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.AddAttribute("class", "form-group");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _pnbCellPhone.RenderControl(writer);
                writer.RenderEndTag();
                writer.RenderEndTag();

                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.AddAttribute("class", "text-center");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _cbIsMessagingEnabled.RenderControl(writer);
                writer.RenderEndTag();
                writer.RenderEndTag();

                writer.RenderBeginTag(HtmlTextWriterTag.Td);
                writer.AddAttribute("class", "form-group");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _ebEmail.RenderControl(writer);
                writer.RenderEndTag();
                writer.RenderEndTag();

                writer.RenderEndTag();  // Tr
            }
        }
        /// <summary>
        /// Render any additional picker actions
        /// </summary>
        /// <param name="writer">The writer.</param>
        public override void RenderCustomPickerActions(HtmlTextWriter writer)
        {
            if (EnhanceForLongLists && _hfSearchValue != null)
            {
                _hfSearchValue.RenderControl(writer);
            }

            if (_hfPickerShowActive != null)
            {
                _hfPickerShowActive.RenderControl(writer);
            }

            if (_hfViewMode != null)
            {
                _hfViewMode.RenderControl(writer);
            }

            if (this.AllowMultiSelect)
            {
                _btnSelectAll.RenderControl(writer);

                writer.Write("<a class='btn btn-xs btn-link picker-cancel mr-auto' id='btnCancel_{0}'>Cancel</a>", this.ClientID);

                writer.Write("<a class='btn btn-link btn-xs picker-preview' id='btnPreviewSelection_{0}' title='Preview'><i class='fa fa-list'></i></a>", this.ClientID);
                writer.Write("<a class='btn btn-link btn-xs picker-treeview' id='btnTreeView_{0}' title='Tree View'><i class='fa fa-sitemap'></i></a>", this.ClientID);
            }
            else
            {
                writer.Write("<a class='btn btn-xs btn-link picker-cancel mr-auto' id='btnCancel_{0}'>Cancel</a>", this.ClientID);
            }


            if (!DisplayActiveOnly)
            {
                _cbShowInactiveAccounts.RenderControl(writer);
            }
            else
            {
                this.Controls.Remove(_cbShowInactiveAccounts);
            }
        }
        /// <summary>
        /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client.
        /// </summary>
        /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel panel-widget workflow-action");
            writer.AddAttribute("data-key", _hfActionTypeGuid.Value);
            writer.RenderBeginTag("article");

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "clearfix clickable panel-heading");
            writer.RenderBeginTag("header");

            // Hidden Field to track expansion
            _hfExpanded.RenderControl(writer);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-left workflow-action-name");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _lblActionTypeName.Text = _tbActionTypeName.Text;
            _lblActionTypeName.RenderControl(writer);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            string criteriaExistsClass = _ddlCriteriaAttribute.SelectedValueAsGuid().HasValue ? " criteria-exists" : string.Empty;

            writer.WriteLine(string.Format("<a class='btn btn-xs btn-link js-workflow-action-criteria{0}'><i class='fa fa-filter'></i></a>", criteriaExistsClass));
            writer.WriteLine("<a class='btn btn-xs btn-link workflow-action-reorder'><i class='fa fa-bars'></i></a>");
            writer.WriteLine(string.Format("<a class='btn btn-xs btn-link'><i class='workflow-action-state fa {0}'></i></a>",
                                           Expanded ? "fa fa-chevron-up" : "fa fa-chevron-down"));

            if (IsDeleteEnabled)
            {
                _lbDeleteActionType.Visible = true;

                _lbDeleteActionType.RenderControl(writer);
            }
            else
            {
                _lbDeleteActionType.Visible = false;
            }

            // Add/ChevronUpDown/Delete div
            writer.RenderEndTag();

            // header div
            writer.RenderEndTag();

            if (!Expanded)
            {
                // hide details if the name has already been filled in
                writer.AddStyleAttribute("display", "none");
            }
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-body");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // add Criteria fields
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row conditional-run-criteria alert-warning");
            if (!_ddlCriteriaAttribute.SelectedValueAsGuid().HasValue)
            {
                writer.AddStyleAttribute("display", "none");
            }
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-lg-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-7");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _ddlCriteriaAttribute.RenderControl(writer);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-5");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _ddlCriteriaComparisonType.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();  // row

            writer.RenderEndTag();  // col-md-6

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-lg-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            var comparisonType = _ddlCriteriaComparisonType.SelectedValueAsEnum <ComparisonType>();

            _tbddlCriteriaValue.Style["display"] = (comparisonType == ComparisonType.IsBlank || comparisonType == ComparisonType.IsNotBlank) ? "none" : "block";
            _tbddlCriteriaValue.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();

            // action edit fields
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _tbActionTypeName.ValidationGroup = ValidationGroup;
            _tbActionTypeName.RenderControl(writer);
            _ddlEntityType.ValidationGroup = ValidationGroup;
            _ddlEntityType.RenderControl(writer);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _cbIsActionCompletedOnSuccess.ValidationGroup = ValidationGroup;
            _cbIsActionCompletedOnSuccess.RenderControl(writer);
            _cbIsActivityCompletedOnSuccess.ValidationGroup = ValidationGroup;
            _cbIsActivityCompletedOnSuccess.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();

            _formEditor.ValidationGroup = ValidationGroup;
            _formEditor.RenderControl(writer);

            _phActionAttributes.RenderControl(writer);

            // widget-content div
            writer.RenderEndTag();

            // article tag
            writer.RenderEndTag();
        }
Exemple #8
0
        /// <summary>
        /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client.
        /// </summary>
        /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param>
        protected override void Render(HtmlTextWriter writer)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _tbName.RenderControl(writer);
            writer.RenderEndTag();  // col-md-6

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _cbIsActive.RenderControl(writer);
            _tbUrlSlug.RenderControl(writer);
            writer.RenderEndTag();  // col-md-6

            writer.RenderEndTag();  // row

            _ceDetails.RenderControl(writer);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            _dtpStart.RenderControl(writer);
            _dtpEnd.RenderControl(writer);
            _nbMaxAttendees.RenderControl(writer);
            _wtpRegistrationWorkflow.RenderControl(writer);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-8");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _dtpSendReminder.RenderControl(writer);
            writer.RenderEndTag();              // col-xs-6

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-4");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _cbReminderSent.Visible = _cbReminderSent.Checked;
            _cbReminderSent.RenderControl(writer);
            writer.RenderEndTag();      // col-xs-6

            writer.RenderEndTag();      // row

            writer.RenderEndTag();      // col-md-6
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            _ppContact.RenderControl(writer);
            _pnContactPhone.RenderControl(writer);
            _ebContactEmail.RenderControl(writer);

            _cbCost.RenderControl(writer);
            _cbMinimumInitialPayment.RenderControl(writer);
            _cbDefaultPaymentAmount.RenderControl(writer);
            _apAccount.RenderControl(writer);

            writer.RenderEndTag();  // col-md-6
            writer.RenderEndTag();  // row

            _htmlRegistrationInstructions.RenderControl(writer);

            _htmlAdditionalReminderDetails.RenderControl(writer);

            _htmlAdditionalConfirmationDetails.RenderControl(writer);
        }
Exemple #9
0
        /// <summary>
        /// This is where you implement the simple aspects of rendering your control.  The rest
        /// will be handled by calling RenderControlHelper's RenderControl() method.
        /// </summary>
        /// <param name="writer">The writer.</param>
        public void RenderBaseControl(HtmlTextWriter writer)
        {
            if (this.Visible)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-control-group datetime-picker-container js-datetime-picker-container " + this.CssClass);
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-row");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                if (IsCurrentTimeOffset)
                {
                    _date.Attributes["disabled"]    = "true";
                    _date.Attributes["placeholder"] = "Current";
                    _date.AddCssClass("aspNetDisabled");
                    _time.Enabled         = false;
                    _nbTimeOffset.Enabled = true;
                    _nbTimeOffset.Style[HtmlTextWriterStyle.Display] = "";
                }
                else
                {
                    _date.Enabled = true;
                    _time.Enabled = true;
                    _nbTimeOffset.Style[HtmlTextWriterStyle.Display] = "none";
                }

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "input-group input-width-md date");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _date.RenderControl(writer);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "input-group-addon");
                writer.RenderBeginTag(HtmlTextWriterTag.Span);
                writer.Write("<i class='fa fa-calendar'></i>");
                writer.RenderEndTag();
                writer.RenderEndTag();

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "bootstrap-timepicker input-group input-width-md");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _time.RenderControl(writer);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "input-group-addon");
                writer.RenderBeginTag(HtmlTextWriterTag.Span);
                writer.Write("<span class='add-on'><i class='fa fa-clock-o'></i></span>");
                writer.RenderEndTag();
                writer.RenderEndTag();

                if (DisplayCurrentOption)
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "input-group");
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    _cbCurrent.RenderControl(writer);
                    writer.RenderEndTag();

                    writer.RenderEndTag(); // form-row

                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-row");
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    _nbTimeOffset.RenderControl(writer);
                    writer.RenderEndTag();
                }
                else
                {
                    writer.RenderEndTag(); // form-row
                }

                writer.RenderEndTag();   // form-control-group
            }
        }
Exemple #10
0
        /// <summary>
        /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client.
        /// </summary>
        /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            DataFilterComponent component = null;
            string clientFormatString     = string.Empty;

            if (!string.IsNullOrWhiteSpace(FilterEntityTypeName))
            {
                component = Rock.Reporting.DataFilterContainer.GetComponent(FilterEntityTypeName);
                if (component != null)
                {
                    clientFormatString =
                        string.Format("if ($(this).find('.filter-view-state').children('i').hasClass('fa-chevron-up')) {{ var $article = $(this).parents('article:first'); var $content = $article.children('div.panel-body'); $article.find('div.filter-item-description:first').html({0}); }}", component.GetClientFormatSelection(FilteredEntityType));
                }
            }

            if (component == null)
            {
                hfExpanded.Value = "True";
            }

            bool showFilterTypePicker = this.FilterMode == FilterMode.AdvancedFilter;

            if (showFilterTypePicker)
            {
                // only render this stuff if the filter type picker is shown
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel panel-widget filter-item");

                writer.RenderBeginTag("article");

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-heading clearfix");
                if (!string.IsNullOrEmpty(clientFormatString))
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Onclick, clientFormatString);
                }

                writer.RenderBeginTag("header");

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "filter-expanded");
                hfExpanded.RenderControl(writer);

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-left");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "filter-item-description");
                if (Expanded)
                {
                    writer.AddStyleAttribute(HtmlTextWriterStyle.Display, "none");
                }
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                writer.Write(component != null ? component.FormatSelection(FilteredEntityType, this.GetSelection()) : "Select Filter");
                writer.RenderEndTag();

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "filter-item-select");
                if (!Expanded)
                {
                    writer.AddStyleAttribute(HtmlTextWriterStyle.Display, "none");
                }
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                writer.RenderBeginTag(HtmlTextWriterTag.Span);
                writer.Write("Filter Type ");
                writer.RenderEndTag();

                ddlFilterType.RenderControl(writer);
                writer.RenderEndTag();

                writer.RenderEndTag();

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "btn btn-link btn-xs filter-view-state");
                writer.RenderBeginTag(HtmlTextWriterTag.A);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, Expanded ? "fa fa-chevron-up" : "fa fa-chevron-down");
                writer.RenderBeginTag(HtmlTextWriterTag.I);
                writer.RenderEndTag();
                writer.RenderEndTag();
                writer.Write(" ");
                lbDelete.Visible = (this.DeleteClick != null);
                lbDelete.RenderControl(writer);
                writer.RenderEndTag();

                writer.RenderEndTag();

                writer.AddAttribute("class", "panel-body");
                if (!Expanded)
                {
                    writer.AddStyleAttribute(HtmlTextWriterStyle.Display, "none");
                }
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
            }

            writer.AddAttribute("class", "row js-filter-row filterfield");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            writer.AddAttribute("class", "col-md-12");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            if (ShowCheckbox)
            {
                //// EntityFieldFilter renders the checkbox itself (see EntityFieldFilter.cs),
                //// so only render the checkbox if we are hiding filter criteria and it isn't an entity field filter
                if (!(component is Rock.Reporting.DataFilter.EntityFieldFilter) || HideFilterCriteria)
                {
                    cbIncludeFilter.Text = this.Label;
                    cbIncludeFilter.RenderControl(writer);
                }
            }
            else if (!string.IsNullOrWhiteSpace(this.Label))
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "control-label");
                writer.AddAttribute(HtmlTextWriterAttribute.For, this.ClientID);
                writer.RenderBeginTag(HtmlTextWriterTag.Label);
                writer.Write(Label);
                writer.RenderEndTag();  // label
            }

            if (component != null && !HideFilterCriteria)
            {
                component.RenderControls(FilteredEntityType, this, writer, filterControls, this.FilterMode);
            }

            writer.RenderEndTag(); // "col-md-12"
            writer.RenderEndTag(); // "row js-filter-row filter-row"

            if (showFilterTypePicker)
            {
                writer.RenderEndTag();

                writer.RenderEndTag();
            }
        }
Exemple #11
0
        /// <summary>
        /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client.
        /// </summary>
        /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            string inactiveCss = _cbActivityIsComplete.Checked ? string.Empty : " workflow-activity-inactive";

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel panel-widget workflow-activity" + inactiveCss);

            writer.AddAttribute("data-key", _hfActivityGuid.Value);
            writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ID + "_section");
            writer.RenderBeginTag("section");

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-heading clearfix clickable");
            writer.RenderBeginTag("header");

            // Hidden Field to track expansion
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "filter-expanded");
            _hfExpanded.RenderControl(writer);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "filter-toggle pull-left");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute("class", "panel-title");
            writer.RenderBeginTag(HtmlTextWriterTag.H3);
            _lblActivityTypeName.RenderControl(writer);

            // H3 tag
            writer.RenderEndTag();
            _lblActivityTypeDescription.RenderControl(writer);

            // Name/Description div
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right activity-controls");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.WriteLine(string.Format("<a class='btn btn-xs btn-link'><i class='workflow-activity-state fa {0}'></i></a>",
                                           Expanded ? "fa fa-chevron-up" : "fa fa-chevron-down"));

            if (CanEdit && IsDeleteEnabled)
            {
                _lbDeleteActivityType.Visible = true;
                _lbDeleteActivityType.RenderControl(writer);
            }
            else
            {
                _lbDeleteActivityType.Visible = false;
            }

            // Add/ChevronUpDown/Delete div
            writer.RenderEndTag();

            _lblStatus.RenderControl(writer);

            // header div
            writer.RenderEndTag();

            if (!Expanded)
            {
                // hide details if the activity and actions are valid
                writer.AddStyleAttribute("display", "none");
            }
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-body");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // activity edit fields
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            if (CanEdit)
            {
                _ppAssignedToPerson.ValidationGroup = ValidationGroup;
                _ppAssignedToPerson.RenderControl(writer);
                _gpAssignedToGroup.ValidationGroup = ValidationGroup;
                _gpAssignedToGroup.RenderControl(writer);
                _ddlAssignedToRole.ValidationGroup = ValidationGroup;
                _ddlAssignedToRole.RenderControl(writer);
            }
            else
            {
                if (!string.IsNullOrWhiteSpace(_lAssignedToPerson.Text))
                {
                    _lAssignedToPerson.RenderControl(writer);
                }
                if (!string.IsNullOrWhiteSpace(_lAssignedToGroup.Text))
                {
                    _lAssignedToGroup.RenderControl(writer);
                }
                if (!string.IsNullOrWhiteSpace(_lAssignedToRole.Text))
                {
                    _lAssignedToRole.RenderControl(writer);
                }
            }
            writer.RenderEndTag();  // col-md-4

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _cbActivityIsComplete.Enabled         = CanEdit;
            _cbActivityIsComplete.ValidationGroup = ValidationGroup;
            _cbActivityIsComplete.RenderControl(writer);
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "control-label");
            writer.RenderBeginTag(HtmlTextWriterTag.Label);
            writer.Write("&nbsp;");
            writer.RenderEndTag();  // control-label
            _lState.RenderControl(writer);
            writer.RenderEndTag();  // form-group
            writer.RenderEndTag();  // col-md-6

            writer.RenderEndTag();  // row

            _phAttributes.RenderControl(writer);

            // actions
            writer.RenderBeginTag("fieldset");

            writer.RenderBeginTag("legend");
            writer.WriteLine("Actions");
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "grid-table table table-condensed table-light");
            writer.RenderBeginTag(HtmlTextWriterTag.Table);

            writer.RenderBeginTag(HtmlTextWriterTag.Thead);
            writer.RenderBeginTag(HtmlTextWriterTag.Tr);

            writer.AddAttribute(HtmlTextWriterAttribute.Scope, "col");
            writer.RenderBeginTag(HtmlTextWriterTag.Th);
            writer.Write("Action");
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Scope, "col");
            writer.RenderBeginTag(HtmlTextWriterTag.Th);
            writer.Write("Last Processed");
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Scope, "col");
            writer.RenderBeginTag(HtmlTextWriterTag.Th);
            writer.Write("Completed");
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Scope, "col");
            writer.RenderBeginTag(HtmlTextWriterTag.Th);
            writer.RenderEndTag();

            writer.RenderEndTag();  // tr
            writer.RenderEndTag();  // thead

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "workflow-formfield-list");
            writer.RenderBeginTag(HtmlTextWriterTag.Tbody);

            foreach (WorkflowActionEditor workflowActionEditor in this.Controls.OfType <WorkflowActionEditor>())
            {
                workflowActionEditor.ValidationGroup = ValidationGroup;
                workflowActionEditor.RenderControl(writer);
            }

            writer.RenderEndTag();  // tbody

            writer.RenderEndTag();  // table

            // actions fieldset
            writer.RenderEndTag();

            // widget-content div
            writer.RenderEndTag();

            // section tag
            writer.RenderEndTag();
        }
        /// <summary>
        /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            if (_hfFormGuid.Value.AsGuid() != Guid.Empty)
            {
                _hfFormGuid.RenderControl(writer);

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _ddlNotificationSystemEmail.RenderControl(writer);
                writer.RenderEndTag();

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _cbIncludeActions.RenderControl(writer);
                writer.RenderEndTag();

                writer.RenderEndTag();  // row

                _cbAllowNotes.RenderControl(writer);

                _ceHeaderText.ValidationGroup = ValidationGroup;
                _ceHeaderText.RenderControl(writer);

                // Attributes
                if (AttributeRows.Any())
                {
                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group");
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);

                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "control-label");
                    writer.RenderBeginTag(HtmlTextWriterTag.Label);
                    writer.Write("Form Fields");

                    writer.AddAttribute("class", "help");
                    writer.AddAttribute("href", "#");
                    writer.RenderBeginTag(HtmlTextWriterTag.A);
                    writer.AddAttribute("class", "fa fa-question-circle");
                    writer.RenderBeginTag(HtmlTextWriterTag.I);
                    writer.RenderEndTag();
                    writer.RenderEndTag();

                    writer.AddAttribute("class", "alert alert-info");
                    writer.AddAttribute("style", "display:none");
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    writer.RenderBeginTag(HtmlTextWriterTag.Small);
                    writer.Write("The fields (attributes) to display on the entry form");
                    writer.RenderEndTag();
                    writer.RenderEndTag();

                    writer.RenderEndTag();      // Label

                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "grid-table table table-condensed table-light");
                    writer.RenderBeginTag(HtmlTextWriterTag.Table);

                    writer.RenderBeginTag(HtmlTextWriterTag.Thead);
                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);

                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "grid-columncommand");
                    writer.RenderBeginTag(HtmlTextWriterTag.Th);
                    writer.Write("&nbsp;");
                    writer.RenderEndTag();

                    writer.AddAttribute(HtmlTextWriterAttribute.Scope, "col");
                    writer.RenderBeginTag(HtmlTextWriterTag.Th);

                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);

                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-3");
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    writer.Write("Field");
                    writer.RenderEndTag();

                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-9");
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);

                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);

                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-2");
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    writer.Write("Visible");
                    writer.RenderEndTag();

                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-2");
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    writer.Write("Editable");
                    writer.RenderEndTag();

                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-2");
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    writer.Write("Required");
                    writer.RenderEndTag();

                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-2");
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    writer.Write("Hide Label");
                    writer.RenderEndTag();

                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-2");
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    writer.Write("Pre-HTML");
                    writer.RenderEndTag();

                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-2");
                    writer.RenderBeginTag(HtmlTextWriterTag.Div);
                    writer.Write("Post-HTML");
                    writer.RenderEndTag();

                    writer.RenderEndTag();      // row

                    writer.RenderEndTag();      // col-xs-9

                    writer.RenderEndTag();      // row

                    writer.RenderEndTag();      // th

                    writer.RenderEndTag();      // tr
                    writer.RenderEndTag();      // thead

                    writer.AddAttribute(HtmlTextWriterAttribute.Class, "workflow-formfield-list");
                    writer.RenderBeginTag(HtmlTextWriterTag.Tbody);

                    foreach (var row in AttributeRows)
                    {
                        row.RenderControl(writer);
                    }

                    writer.RenderEndTag();      // tbody

                    writer.RenderEndTag();      // table

                    writer.RenderEndTag();      // Div.form-group
                }

                _ceFooterText.ValidationGroup = ValidationGroup;
                _ceFooterText.RenderControl(writer);
                _falActions.RenderControl(writer);

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _ddlActionAttribute.RenderControl(writer);
                writer.RenderEndTag();

                writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                writer.RenderEndTag();

                writer.RenderEndTag();  // row
            }
        }
        /// <summary>
        /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client.
        /// </summary>
        /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            if (_cbActivityTypeIsActive.Checked)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel panel-widget workflow-activity");
            }
            else
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel workflow-activity workflow-activity-inactive");
            }

            writer.AddAttribute("data-key", _hfActivityTypeGuid.Value);
            writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ID + "_section");
            writer.RenderBeginTag("section");

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-heading clearfix clickable");
            writer.RenderBeginTag("header");

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "filter-toogle pull-left");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute("class", "panel-title");
            writer.RenderBeginTag(HtmlTextWriterTag.H3);
            _lblActivityTypeName.Text = _tbActivityTypeName.Text;
            _lblActivityTypeName.RenderControl(writer);

            // H3 tag
            writer.RenderEndTag();
            _lblActivityTypeDescription.Text = _tbActivityTypeDescription.Text;
            _lblActivityTypeDescription.RenderControl(writer);

            // Name/Description div
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.WriteLine("<a class='btn btn-xs btn-link workflow-activity-reorder'><i class='fa fa-bars'></i></a>");
            writer.WriteLine("<a class='btn btn-xs btn-link'><i class='workflow-activity-state fa fa-chevron-down'></i></a>");

            if (IsDeleteEnabled)
            {
                _lbDeleteActivityType.Visible = true;
                _lbDeleteActivityType.RenderControl(writer);
            }
            else
            {
                _lbDeleteActivityType.Visible = false;
            }

            // Add/ChevronUpDown/Delete div
            writer.RenderEndTag();

            _lblInactive.Style[HtmlTextWriterStyle.Display] = _cbActivityTypeIsActive.Checked ? "none" : string.Empty;
            _lblInactive.RenderControl(writer);

            // header div
            writer.RenderEndTag();

            bool forceContentVisible = !GetWorkflowActivityType().IsValid || ForceContentVisible;

            if (!forceContentVisible)
            {
                foreach (WorkflowActionTypeEditor workflowActionTypeEditor in this.Controls.OfType <WorkflowActionTypeEditor>().OrderBy(a => a.WorkflowActionType.Order))
                {
                    if (!workflowActionTypeEditor.WorkflowActionType.IsValid || workflowActionTypeEditor.ForceContentVisible)
                    {
                        forceContentVisible = true;
                        break;
                    }
                }
            }

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-body");

            if (!forceContentVisible)
            {
                // hide details if the activity and actions are valid
                writer.AddStyleAttribute("display", "none");
            }

            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // activity edit fields
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            _tbActivityTypeName.RenderControl(writer);
            _tbActivityTypeDescription.RenderControl(writer);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _cbActivityTypeIsActive.RenderControl(writer);
            _cbActivityTypeIsActivatedWithWorkflow.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();

            // actions
            writer.RenderBeginTag("fieldset");

            writer.RenderBeginTag("legend");
            writer.WriteLine("Actions");
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right");
            writer.RenderBeginTag(HtmlTextWriterTag.Span);
            _lbAddActionType.RenderControl(writer);
            writer.RenderEndTag();
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "workflow-action-list");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            foreach (WorkflowActionTypeEditor workflowActionTypeEditor in this.Controls.OfType <WorkflowActionTypeEditor>().OrderBy(a => a.WorkflowActionType.Order))
            {
                workflowActionTypeEditor.RenderControl(writer);
            }

            // workflow-action-list div
            writer.RenderEndTag();

            // actions fieldset
            writer.RenderEndTag();

            // widget-content div
            writer.RenderEndTag();

            // section tag
            writer.RenderEndTag();
        }
Exemple #14
0
        /// <summary>
        /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client.
        /// </summary>
        /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel panel-widget workflow-action");
            writer.AddAttribute("data-key", _hfActionTypeGuid.Value);
            writer.RenderBeginTag("article");

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "clearfix clickable panel-heading");
            writer.RenderBeginTag("header");

            // Hidden Field to track expansion
            _hfExpanded.RenderControl(writer);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-left workflow-action-name");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _lblActionTypeName.Text = _tbActionTypeName.Text;
            _lblActionTypeName.RenderControl(writer);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            string criteriaExistsClass = _ddlCriteriaAttribute.SelectedValueAsGuid().HasValue ? " criteria-exists" : string.Empty;

            writer.WriteLine(string.Format("<a class='btn btn-xs btn-link js-workflow-action-criteria{0}'><i class='fa fa-filter'></i></a>", criteriaExistsClass));
            writer.WriteLine("<a class='btn btn-xs btn-link workflow-action-reorder'><i class='fa fa-bars'></i></a>");
            writer.WriteLine(string.Format("<a class='btn btn-xs btn-link'><i class='workflow-action-state fa {0}'></i></a>",
                                           Expanded ? "fa fa-chevron-up" : "fa fa-chevron-down"));

            if (IsDeleteEnabled)
            {
                _lbDeleteActionType.Visible = true;

                _lbDeleteActionType.RenderControl(writer);
            }
            else
            {
                _lbDeleteActionType.Visible = false;
            }

            // Add/ChevronUpDown/Delete div
            writer.RenderEndTag();

            // header div
            writer.RenderEndTag();

            if (!Expanded)
            {
                // hide details if the name has already been filled in
                writer.AddStyleAttribute("display", "none");
            }
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-body");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // add Criteria fields
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row conditional-run-criteria alert-warning");
            if (!_ddlCriteriaAttribute.SelectedValueAsGuid().HasValue)
            {
                writer.AddStyleAttribute("display", "none");
            }
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-lg-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-7");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _ddlCriteriaAttribute.RenderControl(writer);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-5");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _ddlCriteriaComparisonType.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();  // row

            writer.RenderEndTag();  // col-md-6

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-lg-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            var comparisonType = _ddlCriteriaComparisonType.SelectedValueAsEnum <ComparisonType>();

            _tbddlCriteriaValue.Style["display"] = (comparisonType == ComparisonType.IsBlank || comparisonType == ComparisonType.IsNotBlank) ? "none" : "block";
            _tbddlCriteriaValue.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();

            // action edit fields
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _tbActionTypeName.ValidationGroup = ValidationGroup;
            _tbActionTypeName.RenderControl(writer);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _cbIsActionCompletedOnSuccess.ValidationGroup = ValidationGroup;
            _cbIsActionCompletedOnSuccess.RenderControl(writer);
            _cbIsActivityCompletedOnSuccess.ValidationGroup = ValidationGroup;
            _cbIsActivityCompletedOnSuccess.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();  // row

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-lg-4");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _wfatpEntityType.ValidationGroup = ValidationGroup;
            _wfatpEntityType.RenderControl(writer);
            writer.RenderEndTag();

            // Add an overview(description) of the selected action type
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-lg-8");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            EntityTypeCache entityType   = null;
            int?            entityTypeId = _wfatpEntityType.SelectedValueAsInt();

            if (entityTypeId.HasValue)
            {
                entityType = EntityTypeCache.Get(entityTypeId.Value);
                if (entityType != null)
                {
                    var component = ActionContainer.GetComponent(entityType.Name);
                    if (component != null)
                    {
                        string description   = string.Empty;
                        var    propAttribute = component.GetType().GetCustomAttributes(typeof(System.ComponentModel.DescriptionAttribute), false).FirstOrDefault();
                        if (propAttribute != null)
                        {
                            var descAttribute = propAttribute as System.ComponentModel.DescriptionAttribute;
                            if (descAttribute != null)
                            {
                                _rlEntityTypeOverview.Label = string.Format("'{0}' Overview", entityType.FriendlyName);
                                _rlEntityTypeOverview.Text  = descAttribute.Description;
                                _rlEntityTypeOverview.RenderControl(writer);
                            }
                        }
                    }
                }
            }
            writer.RenderEndTag();  // col-md-8

            writer.RenderEndTag();  // row

            if (entityType != null && entityType.Name == typeof(Rock.Workflow.Action.UserEntryForm).FullName)
            {
                _formEditor.ValidationGroup = ValidationGroup;
                _formEditor.RenderControl(writer);
            }

            _phActionAttributes.RenderControl(writer);

            // widget-content div
            writer.RenderEndTag();

            // article tag
            writer.RenderEndTag();
        }
Exemple #15
0
        /// <summary>
        /// Render any additional picker actions
        /// </summary>
        /// <param name="writer">The writer.</param>
        public override void RenderCustomPickerActions(HtmlTextWriter writer)
        {
            base.RenderCustomPickerActions(writer);

            _cbShowInactiveGroups.RenderControl(writer);
        }
Exemple #16
0
        /// <summary>
        /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client.
        /// </summary>
        /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param>
        protected override void Render(HtmlTextWriter writer)
        {
            writer.RenderBeginTag(HtmlTextWriterTag.Fieldset);

            writer.RenderBeginTag(HtmlTextWriterTag.Legend);
            _lAttributeActionTitle.RenderControl(writer);
            writer.RenderEndTag();

            _validationSummary.RenderControl(writer);

            // row 1
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _tbName.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();

            // row 2
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-12");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _tbDescription.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();

            // row 3
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // row 3 col 1
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _cpCategories.RenderControl(writer);
            _tbKey.RenderControl(writer);
            _cvKey.RenderControl(writer);
            _cbRequired.RenderControl(writer);
            _cbShowInGrid.RenderControl(writer);
            writer.RenderEndTag();

            // row 3 col 2
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _ddlFieldType.RenderControl(writer);
            _phQualifiers.RenderControl(writer);
            _phDefaultValue.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();

            // </fieldset>
            writer.RenderEndTag();

            if (ShowActions)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "actions");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _btnSave.RenderControl(writer);
                writer.Write(Environment.NewLine);
                _btnCancel.RenderControl(writer);
                writer.RenderEndTag();
            }

            RegisterClientScript();
        }
Exemple #17
0
        /// <summary>
        /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client.
        /// </summary>
        /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param>
        protected override void Render(HtmlTextWriter writer)
        {
            writer.RenderBeginTag(HtmlTextWriterTag.Fieldset);

            writer.RenderBeginTag(HtmlTextWriterTag.Legend);
            _lAttributeActionTitle.RenderControl(writer);
            writer.RenderEndTag();

            var existingKeyNames = new List <string>();

            ReservedKeyNames.ForEach(n => existingKeyNames.Add(n));
            ObjectPropertyNames.ForEach(n => existingKeyNames.Add(n));
            _hfExistingKeyNames.Value = existingKeyNames.ToJson();
            _hfExistingKeyNames.RenderControl(writer);

            _validationSummary.RenderControl(writer);

            // row 1
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _tbName.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();

            // row 2
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-12");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _tbDescription.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();

            // row 3
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // row 3 col 1
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _cpCategories.RenderControl(writer);
            _tbKey.RenderControl(writer);
            _cvKey.RenderControl(writer);
            _tbIconCssClass.RenderControl(writer);
            _cbRequired.RenderControl(writer);
            _cbShowInGrid.RenderControl(writer);
            writer.RenderEndTag();

            // row 3 col 2
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _ddlFieldType.RenderControl(writer);
            _phQualifiers.RenderControl(writer);
            _phDefaultValue.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();

            // </fieldset>
            writer.RenderEndTag();

            if (ShowActions)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Class, "actions");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                _btnSave.RenderControl(writer);
                writer.Write(Environment.NewLine);
                _btnCancel.RenderControl(writer);
                writer.RenderEndTag();
            }

            RegisterClientScript();
        }
Exemple #18
0
        /// <summary>
        /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client.
        /// </summary>
        /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            if (!Expanded)
            {
                foreach (WorkflowActionTypeEditor workflowActionTypeEditor in this.Controls.OfType <WorkflowActionTypeEditor>())
                {
                    if (workflowActionTypeEditor.Expanded)
                    {
                        Expanded = true;
                        break;
                    }
                }
            }

            string inactiveCss = _cbActivityTypeIsActive.Checked ? string.Empty : " workflow-activity-inactive";
            string activatedWithWorkflowCss = _cbActivityTypeIsActivatedWithWorkflow.Checked ? " activated-with-workflow" : string.Empty;

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel panel-widget workflow-activity" + inactiveCss + activatedWithWorkflowCss);

            writer.AddAttribute("data-key", _hfActivityTypeGuid.Value);
            writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ID + "_section");
            writer.RenderBeginTag("section");

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-heading clearfix clickable");
            writer.RenderBeginTag("header");

            // Hidden Field to track expansion
            _hfExpanded.RenderControl(writer);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "filter-toggle pull-left");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute("class", "panel-title");
            writer.RenderBeginTag(HtmlTextWriterTag.H3);
            _lblActivityTypeName.Text = _tbActivityTypeName.Text;
            _lblActivityTypeName.RenderControl(writer);

            // H3 tag
            writer.RenderEndTag();
            _lblActivityTypeDescription.Text = _tbActivityTypeDescription.Text;
            _lblActivityTypeDescription.RenderControl(writer);

            // Name/Description div
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            if (_sbSecurity.EntityId != 0)
            {
                writer.WriteLine(string.Format("<span class=\"label label-default\">Id: {0}</span>", _sbSecurity.EntityId));
            }
            writer.WriteLine("<a class='btn btn-xs btn-link workflow-activity-reorder'><i class='fa fa-bars'></i></a>");
            writer.WriteLine(string.Format("<a class='btn btn-xs btn-link'><i class='workflow-activity-state fa {0}'></i></a>",
                                           Expanded ? "fa fa-chevron-up" : "fa fa-chevron-down"));

            if (IsDeleteEnabled)
            {
                _lbDeleteActivityType.Visible = true;
                _lbDeleteActivityType.RenderControl(writer);
            }
            else
            {
                _lbDeleteActivityType.Visible = false;
            }

            // Add/ChevronUpDown/Delete div
            writer.RenderEndTag();

            _lblInactive.Style[HtmlTextWriterStyle.Display] = _cbActivityTypeIsActive.Checked ? "none" : string.Empty;
            _lblInactive.RenderControl(writer);

            // header div
            writer.RenderEndTag();

            if (!Expanded)
            {
                // hide details if the activity and actions are valid
                writer.AddStyleAttribute("display", "none");
            }
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-body");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // activity edit fields
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "row");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _tbActivityTypeName.ValidationGroup = ValidationGroup;
            _tbActivityTypeName.RenderControl(writer);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-2");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _cbActivityTypeIsActive.ValidationGroup = ValidationGroup;
            _cbActivityTypeIsActive.RenderControl(writer);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-4");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            if (_sbSecurity.EntityId > 0)
            {
                _sbSecurity.Title = _tbActivityTypeName.Text;
                _sbSecurity.RenderControl(writer);
            }

            _cbActivityTypeIsActivatedWithWorkflow.ValidationGroup = ValidationGroup;
            _cbActivityTypeIsActivatedWithWorkflow.RenderControl(writer);
            writer.RenderEndTag();

            writer.RenderEndTag();

            _tbActivityTypeDescription.ValidationGroup = ValidationGroup;
            _tbActivityTypeDescription.RenderControl(writer);

            _pwAttributes.RenderControl(writer);

            // actions
            writer.RenderBeginTag("fieldset");

            writer.RenderBeginTag("legend");
            writer.WriteLine("Actions");
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right");
            writer.RenderBeginTag(HtmlTextWriterTag.Span);
            _lbAddActionType.RenderControl(writer);
            writer.RenderEndTag();
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "workflow-action-list");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            foreach (WorkflowActionTypeEditor workflowActionTypeEditor in this.Controls.OfType <WorkflowActionTypeEditor>())
            {
                workflowActionTypeEditor.ValidationGroup = ValidationGroup;
                workflowActionTypeEditor.RenderControl(writer);
            }

            // workflow-action-list div
            writer.RenderEndTag();

            // actions fieldset
            writer.RenderEndTag();

            // widget-content div
            writer.RenderEndTag();

            // section tag
            writer.RenderEndTag();
        }
        /// <summary>
        /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client.
        /// </summary>
        /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param>
        public override void RenderControl(HtmlTextWriter writer)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel panel-widget workflow-action");
            writer.AddAttribute("data-key", _hfActionTypeGuid.Value);
            writer.RenderBeginTag("article");

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "clearfix clickable panel-heading");
            writer.RenderBeginTag("header");

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-left");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            _lblActionTypeName.Text = _tbActionTypeName.Text;
            _lblActionTypeName.RenderControl(writer);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.WriteLine("<a class='btn btn-xs btn-link workflow-action-reorder'><i class='fa fa-bars'></i></a>");
            writer.WriteLine("<a class='btn btn-xs btn-link'><i class='workflow-action-state fa fa-chevron-down'></i></a>");

            if (IsDeleteEnabled)
            {
                _lbDeleteActionType.Visible = true;

                _lbDeleteActionType.RenderControl(writer);
            }
            else
            {
                _lbDeleteActionType.Visible = false;
            }

            // Add/ChevronUpDown/Delete div
            writer.RenderEndTag();

            // header div
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-body");

            bool forceContentVisible = !WorkflowActionType.IsValid || ForceContentVisible;

            if (!forceContentVisible)
            {
                // hide details if the name has already been filled in
                writer.AddStyleAttribute("display", "none");
            }

            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // action edit fields
            _tbActionTypeName.RenderControl(writer);
            _ddlEntityType.RenderControl(writer);
            _cbIsActionCompletedOnSuccess.RenderControl(writer);
            _cbIsActivityCompletedOnSuccess.RenderControl(writer);

            // action attributes
            _phActionAttributes.RenderControl(writer);

            // widget-content div
            writer.RenderEndTag();

            // article tag
            writer.RenderEndTag();
        }