Ejemplo n.º 1
0
 /// <summary>
 /// Renders the contents of the control to the specified writer. This method is used primarily by control developers.
 /// </summary>
 /// <param name="writer">A <see cref="T:System.Web.UI.HtmlTextWriter"/> that represents the output stream to render HTML content on the client.</param>
 protected override void RenderContents(HtmlTextWriter writer)
 {
     // add property fields
     writer.AddPrevalueRow("'On' label", "The label text for the true (on) state", this.OnText);
     writer.AddPrevalueRow("'On' background", "The background-color for the true (on) state", this.OnBackgroundColor);
     writer.AddPrevalueRow("'Off' label", "The label text for the false (off) state", this.OffText);
     writer.AddPrevalueRow("'Off' background", "The background-color for the false (off) state", this.OffBackgroundColor);
     writer.AddPrevalueRow("Default state", "The initial position for the ToggleBox on the edit page, either 'on' or 'off'", this.DefaultValue);
 }
        /// <summary>
        /// Renders the contents of the control to the specified writer. This method is used primarily by control developers.
        /// </summary>
        /// <param name="writer">A <see cref="T:System.Web.UI.HtmlTextWriter"/> that represents the output stream to render HTML content on the client.</param>
        protected override void RenderContents(HtmlTextWriter writer)
        {
            // add property fields
            writer.AddPrevalueRow("Database Type:", this.DatabaseDataType);
            writer.AddPrevalueRow("Enable Range:", this.EnableRange);
            writer.AddPrevalueRow("Range:", this.RangeValue);
            writer.AddPrevalueRow("Initial Value:", this.Value);
            writer.AddPrevalueRow("Initial Value 2:", this.Value2);
            writer.AddPrevalueRow("Minimum Value:", this.MinValue);
            writer.AddPrevalueRow("Maximum Value:", this.MaxValue);
            writer.AddPrevalueRow("Enable Step Increments:", this.EnableStep);
            writer.AddPrevalueRow("Step Increments:", this.StepValue);
            writer.AddPrevalueRow("Orientation:", this.Orientation);

            ////writer.AddPrevalueRow("&nbsp;", new LiteralControl("<h2 class='propertypaneTitel'>Preview:</h2><br/>"), this.PreviewSlider);

            // add jquery window load event for toggling fields.
            var javascriptMethod = string.Format(
                @"
$('#{0}').click(function(){{
    var disable = !$(this).attr('checked');
    $('#{1},#{3}').attr('disabled', disable);
    $('#{6}').val(disable && !checkDecimals() ? 'Integer' : 'Nvarchar');
    if(!disable) disable = $('#{1}').val() != '';
    
}});
$('#{1}').change(function(){{
    var disable = $(this).val() != '';
    $('#{3}').attr('disabled', disable);
}});
$('#{4}').click(function(){{
    var disable = !$(this).attr('checked');
    $('#{5}').attr('disabled', disable);
}});
$('#{6}').change(function(){{
    var disable = $(this).val() == 'Integer';
    if (checkDecimals() && disable) {{
        $('#{6}').val('Nvarchar');
        alert('Please remove decimal points below if you wish to use the Integer datatype');  
    }}
    else {{
    $('#{0}').removeAttr('checked');
    $('#{1},#{3}').attr('disabled', disable);
    }}
}});
$('.slider-numeric').keydown(function(event) {{
    // Allow only backspace and delete
    if ( event.keyCode == 46 || event.keyCode == 8 || ($(this).hasClass('slider-decimal') && (event.keyCode == 110 || event.keyCode == 190))) {{
        // let it happen, don't do anything
    }} else {{
        // Ensure that it is a number and stop the keypress
        if ( (event.keyCode < 48 || event.keyCode > 57 ) && (event.keyCode < 96 || event.keyCode > 105 ) ) {{
            event.preventDefault();
        }}
    }}
}});
$('.slider-numeric').keyup(function(event) {{
    if ($('#{6}').val() != 'Nvarchar' && checkDecimals()) {{
        $('#{6}').val('Nvarchar');
    }}
}});
function checkDecimals() {{
    foundDecimals = false;
    $('.slider-numeric').each(function() {{
            if ($(this).val().indexOf('.') >= 0) {{
                foundDecimals = true;
                return false;
            }}  
        }});
    return foundDecimals;
}}
",
                this.EnableRange.ClientID,
                this.RangeValue.ClientID,
                this.Value.ClientID,
                this.Value2.ClientID,
                this.EnableStep.ClientID,
                this.StepValue.ClientID,
                this.DatabaseDataType.ClientID);
            var javascript = string.Concat("<script type='text/javascript'>jQuery(window).load(function(){", javascriptMethod, "});</script>");
            writer.WriteLine(javascript);
        }
 /// <summary>
 /// Renders the contents of the control to the specified writer. This method is used primarily by control developers.
 /// </summary>
 /// <param name="writer">A <see cref="T:System.Web.UI.HtmlTextWriter"/> that represents the output stream to render HTML content on the client.</param>
 protected override void RenderContents(HtmlTextWriter writer)
 {
     // add property fields
     writer.AddPrevalueRow("Minimum:", "Minimum number of rows to display.", this.TextBoxMinimum);
     writer.AddPrevalueRow("Maximum:", "Maximum number of rows to display.", this.TextBoxMaximum);
 }
        /// <summary>
        /// Sends server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter"/> object, which writes the content to be rendered on the client.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter"/> object that receives the server control content.</param>
        protected override void Render(HtmlTextWriter writer)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Class, Constants.ApplicationName);
            writer.RenderBeginTag(HtmlTextWriterTag.Div); //// start 'uComponents'

            // add property fields
            writer.AddPrevalueRow("Properties to search on :", "Please select properties to search on ", this._propertiesToSearchOn);
            writer.AddPrevalueRow("Maximum number of results to return :", "", this._txtMaxResults);
            writer.AddPrevalueRow("Index to search on", "Please select umbraco index to search, please note this will not work with media index", this._indexToSearch);
            writer.RenderEndTag(); //// end 'uComponents'
        }
 /// <summary>
 /// Renders the contents of the control to the specified writer. This method is used primarily by control developers.
 /// </summary>
 /// <param name="writer">A <see cref="T:System.Web.UI.HtmlTextWriter"/> that represents the output stream to render HTML content on the client.</param>
 protected override void RenderContents(HtmlTextWriter writer)
 {
     // add property fields
     writer.AddPrevalueRow("Show label?", this.ShowLabel);
     writer.AddPrevalueRow("Macro Editor", this.MacroEditor);
     writer.AddPrevalueRow(string.Empty, "Please note: If a document is unpublished or is used on a non-content section (e.g. media, member or custom), then the root content node (usually your homepage) will be used as the context.", this.Styles);
 }
 /// <summary>
 /// Renders the contents of the control to the specified writer. This method is used primarily by control developers.
 /// </summary>
 /// <param name="writer">A <see cref="T:System.Web.UI.HtmlTextWriter"/> that represents the output stream to render HTML content on the client.</param>
 protected override void RenderContents(HtmlTextWriter writer)
 {
     // add property fields
     writer.AddPrevalueRow("ListControl Type:", this.ListControlType);
     writer.AddPrevalueRow("User Type:", this.UserTypesList);
 }
        /// <summary>
        /// Replaces the base class writer and instead uses the shared uComponents extension method, to inject consistant markup
        /// </summary>
        /// <param name="writer"></param>
        protected override void RenderContents(HtmlTextWriter writer)
        {
            writer.AddPrevalueRow("Type", @"xml schema to query", this.typeRadioButtonList);
            writer.AddPrevalueRow("XPath Expression", @"expects a result set of node, meda or member elements", this.xPathTextBox, this.xPathRequiredFieldValidator, this.xPathCustomValidator);
            writer.AddPrevalueRow("Sort On", "property to sort the source data on - empty = xml order", this.sortOnDropDown);

            if (this.sortDirectionRadioButtonList.Visible)
            {
                writer.AddPrevalueRow("Sort Direction", "", this.sortDirectionRadioButtonList);
            }
            else
            {
                // render the control so it's state is persisted, but without any additional layout markup
                this.sortDirectionRadioButtonList.RenderControl(writer);
            }

            writer.AddPrevalueRow("Limit To", "limit the source data count - 0 means no limit", this.limitToTextBox, this.limitToRegularExpressionValidator);
            writer.AddPrevalueRow("List Height", "px height of the source list - 0 means not set / no scrolling", this.listHeightTextBox, this.listHeightRegularExpressionValidator);

            writer.AddPrevalueRow("Macro", "macro expects an int paramter named 'id'", this.macroDropDownList);
            writer.AddPrevalueRow("Css File", "can use classes: .xpath-templatable-list.datatype-id-" + this.DataType.DataTypeDefinitionId + ".property-alias-????", this.cssFileDropDownList);
            writer.AddPrevalueRow("Script File", "contents passed as callback parameter to datatype initialization (can use classes above)", this.scriptFileDropDownList);

            writer.AddPrevalueRow("Min Items", "number of items that must be selected", this.minItemsTextBox, this.minItemsRegularExpressionValidator, this.minItemsCustomValidator);
            writer.AddPrevalueRow("Max Items", "number of items that can be selected - 0 means no limit", this.maxItemsTextBox, this.maxItemsCustomValidator); // BUG: this.maxItemsRegularExpressionValidator doens't work here !
            writer.AddPrevalueRow("Allow Duplicates", "when checked, duplicate values can be selected", this.allowDuplicatesCheckBox);
        }
        /// <summary>
        /// Sends server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter"/> object, which writes the content to be rendered on the client.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter"/> object that receives the server control content.</param>
        protected override void Render(HtmlTextWriter writer)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Class, Constants.ApplicationName);
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            // add property fields
            writer.AddPrevalueRow("Allowed modes:", "Select all modes which are allowed for this data type", this.ModeSelector);
            writer.AddPrevalueRow("Default mode:", "Choose a mode which is shown for empty instances of this data type", this.DefaultModeDropDown);
            writer.AddPrevalueRow(
                "Data format:",
                @"You can specify to store the data in a number of formats:
                  <ul>
                      <li>XML is best for retrieval by XSLT,</li>
                      <li>CSV is best for retrieval by scripting languages like Python,</li>
                      <li>JSON is best for retrieval by Javascript (you never know!)</li>
                  </ul>
                  To get at the data easily in .NET, you can use the method
                  <strong>uComponents.DataTypes.UrlPicker.Dto.UrlPickerState.Deserialize</strong> and pass it the data in any format",
                this.DataFormatDropDown);
            writer.AddPrevalueRow("Allow link title:", "User can specify a title for the link", this.EnableTitleCheckbox);
            writer.AddPrevalueRow("Allow new window:", "User can specify link to open in new window", this.EnableNewWindowCheckbox);

            writer.RenderEndTag();
        }
 /// <summary>
 /// Renders the contents of the control to the specified writer. This method is used primarily by control developers.
 /// </summary>
 /// <param name="writer">A <see cref="T:System.Web.UI.HtmlTextWriter"/> that represents the output stream to render HTML content on the client.</param>
 protected override void RenderContents(HtmlTextWriter writer)
 {
     // add property fields
     writer.AddPrevalueHeading("Amazon S3 and Cloud Front API Settings");
     writer.AddPrevalueRow("", "Add your Amazon account information here.");
     writer.AddPrevalueRow("Access Key:", this.txtAccessKey);
     writer.AddPrevalueRow("Secret Key:", this.txtSecretKey);
 }
 /// <summary>
 /// Renders the contents of the control to the specified writer. This method is used primarily by control developers.
 /// </summary>
 /// <param name="writer">A <see cref="T:System.Web.UI.HtmlTextWriter"/> that represents the output stream to render HTML content on the client.</param>
 protected override void RenderContents(HtmlTextWriter writer)
 {
     writer.AddPrevalueRow("XML File Path:", "Specify the path to the XML file.", this.PathPickerXmlFilePath);
     writer.AddPrevalueRow("XPath Expression:", "The XPath expression to select the nodes used in the XML file.", this.TextBoxXPathExpression);
     writer.AddPrevalueRow("Text column:", "The name of the field used for the item's display text.", this.TextBoxTextColumn);
     writer.AddPrevalueRow("Value column:", "The name of the field used for the item's value.", this.TextBoxValueColumn);
 }
 /// <summary>
 /// Replaces the base class writer and instead uses the shared uComponents extension method, to inject consistant markup
 /// </summary>
 /// <param name="writer">A <see cref="T:System.Web.UI.HtmlTextWriter"/> that represents the output stream to render HTML content on the client.</param>
 protected override void RenderContents(HtmlTextWriter writer)
 {
     writer.AddPrevalueRow("Image Property Alias", "(recursive) property to use as source for image", this.imagePropertyAliasPicker);
     writer.AddPrevalueRow("Width", "width in px (0 = calculate from image)", this.widthTextBox);
     writer.AddPrevalueRow("Height", "height in px (0 = calculate from image)", this.heightTextBox);
 }
 /// <summary>
 /// Renders the contents of the control to the specified writer. This method is used primarily by control developers.
 /// </summary>
 /// <param name="writer">A <see cref="T:System.Web.UI.HtmlTextWriter"/> that represents the output stream to render HTML content on the client.</param>
 protected override void RenderContents(HtmlTextWriter writer)
 {
     writer.AddPrevalueRow("XPath Start Node", "first matched node will be the root of the tree", this.treeStartNodeXPathTextBox, this.treeStartNodeXPathRequiredFieldValidator, this.treeStartNodeXPathCustomValidator);
     writer.AddPrevalueRow("XPath Filter", "not required - only matched nodes will have checkboxes", this.selectableTreeNodesXPathTextBox, this.selectableTreeNodesXPathCustomValidator);
     writer.AddPrevalueRow("Min Selection", "0 = no limit", this.minSelectionTextBox);
     writer.AddPrevalueRow("Max Selection", "0 = no limit", this.maxSelectionTextBox);
     writer.AddPrevalueRow("Auto Selection", "ensure a top down or bottom up tree selection", this.autoSelectionDropDownList);
     writer.AddPrevalueRow("Show Tree Icons", "(doesn't yet work with sprites)", this.showTreeIconsCheckBox);
     writer.AddPrevalueRow("Expand Options", "on load, select whether to collapse all, expand all or only selected branches.", this.selectExpandOptionDropDownList);
     writer.AddPrevalueRow("Output Format", this.selectOutputFormat);
 }
        /// <summary>
        /// Sends server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter"/> object, which writes the content to be rendered on the client.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter"/> object that receives the server control content.</param>
        protected override void Render(HtmlTextWriter writer)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Class, Constants.ApplicationName);
            writer.RenderBeginTag(HtmlTextWriterTag.Div); //// start 'uComponents'

            // add property fields
            writer.AddPrevalueRow("Textbox width:", this.WidthTextBox);
            writer.AddPrevalueRow("Textbox style:", this.StyleTextBox);
            writer.AddPrevalueRow("Preview:", "Hit the 'Save' button to view preview", this.PreviewTextBox);

            writer.RenderEndTag(); //// end 'uComponents'
        }
 /// <summary>
 /// Renders the contents of the control to the specified writer. This method is used primarily by control developers.
 /// </summary>
 /// <param name="writer">A <see cref="T:System.Web.UI.HtmlTextWriter"/> that represents the output stream to render HTML content on the client.</param>
 protected override void RenderContents(HtmlTextWriter writer)
 {
     writer.AddPrevalueRow("Object Type", this.objectTypesDropDownList);
     writer.AddPrevalueRow("Content Type", this.contentTypesDropDownList);
     writer.AddPrevalueRow("Include default attributes?", "This option includes all the default attribute properties for the given content type; e.g. @id, @nodeName, etc.", this.includeDefaultAttributesCheckBox);
 }
 /// <summary>
 /// Renders the contents of the control to the specified writer. This method is used primarily by control developers.
 /// </summary>
 /// <param name="writer">A <see cref="T:System.Web.UI.HtmlTextWriter"/> that represents the output stream to render HTML content on the client.</param>
 protected override void RenderContents(HtmlTextWriter writer)
 {
     // add property fields
     writer.AddPrevalueHeading("Azure CDN API Settings");
     writer.AddPrevalueRow("", "Add your Azure account information here.");
     writer.AddPrevalueRow("Account Name:", this.txtAccountName);
     writer.AddPrevalueRow("Key:", this.txtKey);
 }
 /// <summary>
 /// Renders the contents of the control to the specified writer. This method is used primarily by control developers.
 /// </summary>
 /// <param name="writer">A <see cref="T:System.Web.UI.HtmlTextWriter"/> that represents the output stream to render HTML content on the client.</param>
 protected override void RenderContents(HtmlTextWriter writer)
 {
     writer.AddPrevalueRow(string.Empty, "There are no options for this data-type.");
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Renders the contents of the control to the specified writer. This method is used primarily by control developers.
 /// </summary>
 /// <param name="writer">A <see cref="T:System.Web.UI.HtmlTextWriter"/> that represents the output stream to render HTML content on the client.</param>
 protected override void RenderContents(HtmlTextWriter writer)
 {
     writer.AddPrevalueRow("Select min value:", this.MinValueTextBox, this.minValNumberRex, this.minValNumberReq);
     writer.AddPrevalueRow("Select max value:", this.MaxValueTextBox, this.maxValNumberRex, this.maxValNumberReq);
     writer.AddPrevalueRow("Increment value by:", this.IncrementValueTextBox, this.incrementValNumberReq, this.incrementValNumberRex);
 }
 /// <summary>
 /// Replaces the base class writer and instead uses the shared uComponents extension method, to inject consistant markup
 /// </summary>
 /// <param name="writer"></param>
 protected override void RenderContents(HtmlTextWriter writer)
 {
     writer.AddPrevalueRow("XPath Expression", @"can use the tokens <strong>$ancestorOrSelf</strong>, <strong>$parentPage</strong> and <strong>$currentPage</strong>, eg.<br />
                                                 <br />                                            
                                                 all siblings: $parentPage//*[@id != $currentPage/@id] <br />                                                        
                                                 ", this.xPathTextBox, this.xPathRequiredFieldValidator, this.xPathCustomValidator);
     writer.AddPrevalueRow("Value", this.valueTypeDropDownList);
 }
 /// <summary>
 ///   Sends server control content to a provided <see cref = "T:System.Web.UI.HtmlTextWriter" /> object, 
 ///   which writes the content to be rendered on the client.
 /// </summary>
 /// <param name = "writer">The <see cref = "T:System.Web.UI.HtmlTextWriter" /> object that receives the server control content.</param>
 protected override void Render(HtmlTextWriter writer)
 {
     writer.AddAttribute(HtmlTextWriterAttribute.Class, "imageResizerPreValues");
     writer.RenderBeginTag(HtmlTextWriterTag.Div); //start 'imageResizerPreValues'
     writer.AddPrevalueHeading("Aspose Image Resizer");
     writer.AddPrevalueRow("Property Alias", "Alias of image property  (eg. 'umbracoFile'):", PropertyAliasTextBox);
     writer.AddPrevalueRow("Width", "Maximum width of generated image", MaxWidthTextBox);
     writer.AddPrevalueRow("Height", "Maximum height of generated image", MaxHeightTextBox);
     writer.AddPrevalueRow("", "<p>Aspect ratio is maintained during image resizing.</br>Landscape will restrict to Width<br/>Portrait will restrict to Height</p>");
     writer.RenderEndTag(); // end 'imageResizerPreValues'
 }
        /// <summary>
        /// Sends server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter"/> object, which writes the content to be rendered on the client.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter"/> object that receives the server control content.</param>
        protected override void Render(HtmlTextWriter writer)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Class, Constants.ApplicationName);
            writer.RenderBeginTag(HtmlTextWriterTag.Div); //// start 'uComponents'

            // add property fields
            writer.AddPrevalueRow("Property Alias:", "Please select the property alias of field to check for uniqueness.", this.PropertiesTextBox);

            writer.RenderEndTag(); //// end 'uComponents'
        }
        /// <summary>
        /// Replaces the base class writer and instead uses the shared uComponents extension method, to inject consistant markup
        /// </summary>
        /// <param name="writer"></param>
        protected override void RenderContents(HtmlTextWriter writer)
        {
            writer.AddPrevalueRow(
                        "Type", 
                        "the xml schema to query", 
                        this.typeRadioButtonList);

            writer.AddPrevalueRow(
                        "XPath Expression", 
                        "can use the tokens <strong>$ancestorOrSelf</strong>, <strong>$parentPage</strong> and <strong>$currentPage</strong>",                                                        
                        this.xPathTextBox, 
                        this.xPathRequiredFieldValidator, 
                        this.xPathCustomValidator);
            
            writer.AddPrevalueRow(
                        "Value", 
                        "store the node id or the name",
                        this.valueTypeDropDownList);
        }
 /// <summary>
 /// Renders the contents of the control to the specified writer. This method is used primarily by control developers.
 /// </summary>
 /// <param name="writer">A <see cref="T:System.Web.UI.HtmlTextWriter"/> that represents the output stream to render HTML content on the client.</param>
 protected override void RenderContents(HtmlTextWriter writer)
 {
     writer.AddPrevalueRow("Country picker type:", "Please type of picker to render for country list", this._pickerType);
     writer.AddPrevalueRow("Dropdown choose text:", "If dropdown then text to prompt user to choose", this._chooseTextBox);
 }
 /// <summary>
 /// Renders the contents of the control to the specified writer. This method is used primarily by control developers.
 /// </summary>
 /// <param name="writer">A <see cref="T:System.Web.UI.HtmlTextWriter"/> that represents the output stream to render HTML content on the client.</param>
 protected override void RenderContents(HtmlTextWriter writer)
 {
     // add property fields
     writer.AddPrevalueRow("Directory:", "The directory to list the files from, relative to the root of the website.", this.TextBoxDirectory);
     writer.AddPrevalueRow("Search Pattern:", "The pattern to match the files. e.g. <code>*.css</code>", this.TextBoxSearchPattern);
     writer.AddPrevalueRow("Use Directories:", "Select this option to display sub-directories instead of files.", this.CheckBoxUseDirectories);
 }
 /// <summary>
 /// Replaces the base class writer and instead uses the shared uComponents extension method, to inject consistant markup
 /// </summary>
 /// <param name="writer"></param>
 protected override void RenderContents(HtmlTextWriter writer)
 {
     writer.AddPrevalueRow("SQL Expression", @" expects a result set with two fields : 'Text' and 'Value' - can include the tokens : @currentId and @autoCompleteText", this.sqlTextBox, this.sqlRequiredFieldValidator, this.sqlCustomValidator);
     writer.AddPrevalueRow("Connection String", "add items to the web.config &lt;connectionStrings /&gt; section to list here", this.connectionStringDropDownList);
     writer.AddPrevalueRow("Min Length", "number of chars in the autocomplete text box before querying for data", this.minLengthDropDownList);
     writer.AddPrevalueRow("Max Suggestions", "max number of items to return as autocomplete suggestions - 0 means no limit", this.maxSuggestionsTextBox);
     writer.AddPrevalueRow("Min Items", "number of items that must be selected", this.minItemsTextBox);
     writer.AddPrevalueRow("Max Items", "number of items that can be selected - 0 means no limit", this.maxItemsTextBox);
     writer.AddPrevalueRow("Allow Duplicates", "when checked, duplicate values can be selected", this.allowDuplicatesCheckBox);
 }
Ejemplo n.º 25
0
 /// <summary>
 /// Renders the contents of the control to the specified writer. This method is used primarily by control developers.
 /// </summary>
 /// <param name="writer">A <see cref="T:System.Web.UI.HtmlTextWriter"/> that represents the output stream to render HTML content on the client.</param>
 protected override void RenderContents(HtmlTextWriter writer)
 {
     // add property fields
     writer.AddPrevalueRow("Type:", this.TextBoxType);
     writer.AddPrevalueRow("Width:", this.TextBoxWidth);
     writer.AddPrevalueRow("Height:", this.TextBoxHeight);
 }
Ejemplo n.º 26
0
 /// <summary>
 /// Renders the contents of the control to the specified writer. This method is used primarily by control developers.
 /// </summary>
 /// <param name="writer">A <see cref="T:System.Web.UI.HtmlTextWriter"/> that represents the output stream to render HTML content on the client.</param>
 protected override void RenderContents(HtmlTextWriter writer)
 {
     // add property fields
     writer.AddPrevalueRow("Url to JSON data", "Url string to JSON data", this.UrlTextBox);
     writer.AddPrevalueRow("jQuery Expression", "jQuery Expression", this.ExpressionTextBox);
     writer.AddPrevalueRow("The key data for dropdown list", "The key data for dropdown list", this.KeyTextBox);
     writer.AddPrevalueRow("The value data for dropdown list", "The key data for dropdown list", this.ValueTextbox);
 }
 /// <summary>
 /// Replaces the base class writer and instead uses the shared uComponents extension method, to inject consistant markup
 /// </summary>
 /// <param name="writer"></param>
 protected override void RenderContents(HtmlTextWriter writer)
 {
     writer.AddPrevalueRow("SQL Expression", "expects a result set with two fields : 'Text' and 'Value' - can include the token: @currentId", this.sqlTextBox, this.sqlRequiredFieldValidator, this.sqlCustomValidator);
     writer.AddPrevalueRow("Connection String", "add items to the web.config &lt;connectionStrings /&gt; section to list here", this.connectionStringDropDownList);
 }
        /// <summary>
        ///   Sends server control content to a provided <see cref = "T:System.Web.UI.HtmlTextWriter" /> object, which writes the content to be rendered on the client.
        /// </summary>
        /// <param name = "writer">The <see cref = "T:System.Web.UI.HtmlTextWriter" /> object that receives the server control content.</param>
        protected override void Render(HtmlTextWriter writer)
        {
            if (_hasError)
            {
                writer.Write(_errorMessage);
                SetErrorMessage(null);
                return;
            }

            writer.AddAttribute(HtmlTextWriterAttribute.Class, Constants.ApplicationName);
            writer.RenderBeginTag(HtmlTextWriterTag.Div); //start 'uComponents'

            writer.AddPrevalueRow("Server Font", FontNameDropDownList);
            writer.AddPrevalueRow("Custom Font Path",
                                  "Relative path to font file; overrides server font<br/>(example: '<strong>/fonts/customfont.ttf</strong>' )",
                                  CustomFontPathTextBox);
            writer.AddPrevalueRow("Font Size", FontSizeTextBox);
            writer.AddPrevalueRow("Font Style", FontStyleCheckBoxList);
            writer.AddPrevalueRow("Foreground Color", ForegroundColorPicker);
            writer.AddPrevalueRow("Background Color", BackgroundColorPicker);
            writer.AddPrevalueRow("Shadow Color", ShadowColorPicker);
            writer.AddPrevalueRow("Horizontal Alignment", HorizontalAlignmentDropDownList);
            writer.AddPrevalueRow("Vertical Alignment", VerticalAlignmentDropDownList);
            writer.AddPrevalueRow("Height", "Enter -1 for auto height", ImageHeightTextBox);
            writer.AddPrevalueRow("Width", "Enter -1 for auto width", ImageWidthTextBox);
            writer.AddPrevalueRow("Background",
                                  "Dimensions of selected background image will override the height and width values",
                                  BackgroundMediaChooser);
            writer.AddPrevalueRow("Output Format", ImageFormatDropDownList);
            writer.AddPrevalueRow("Preview", "NOTE: Border is for preview only and will not show in generated text",
                                  ImagePreview);
            writer.RenderEndTag(); //end 'uComponents'

            // Color picker script
            //writer.RenderBeginTag(HtmlTextWriterTag.Script);
            //writer.Write("$(window).load(function(){$('.colorpicker').simpleColor({boxWidth:50,boxHeight:15,displayColorCode:true});});");
            //writer.RenderEndTag();
        }
        /// <summary>
        /// Replaces the base class writer and instead uses the shared uComponents extension method, to inject consistant markup
        /// </summary>
        /// <param name="writer"></param>
        protected override void RenderContents(HtmlTextWriter writer)
        {
            writer.AddPrevalueRow("Picker Alias", this.pickerPropertyAliasPicker, this.pickerPropertyAliasRequiredFieldValidator);
            writer.AddPrevalueRow("Relation Type", this.relationTypeDropDownList, this.relationTypeRequiredFieldValidator);

            // Only show this field if selected RelationType is of Parent to Child
            if (this.RelationType != null)
            {
                if (!this.RelationType.Dual)
                {
                    writer.AddPrevalueRow("Reverse Indexing", this.reverseIndexingCheckBox);
                }
            }

			writer.AddPrevalueRow("Hide Data Editor", this.hideDataEditorCheckBox);
        }
        /// <summary>
        /// Renders the contents of the control to the specified writer. This method is used primarily by control developers.
        /// </summary>
        /// <param name="writer">A <see cref="T:System.Web.UI.HtmlTextWriter"/> that represents the output stream to render HTML content on the client.</param>
        protected override void RenderContents(HtmlTextWriter writer)
        {
            writer.AddPrevalueRow("Add prevalue:", this.TextControl, this.RequiredControl);

            // get the existing prevalues
            var prevalues = PreValues.GetPreValues(this.m_DataType.DataTypeDefinitionId).GetValueList();

            // check if there are any prevalues
            if (prevalues != null && prevalues.Count > 0)
            {
                // create placeholder DIV tag
                var placeholder = new HtmlGenericControl("div");

                // loop through each of the prevalues
                foreach (PreValue value in prevalues)
                {
                    // if the value is empty, then remove it
                    if (string.IsNullOrEmpty(value.Value))
                    {
                        value.Delete();
                        break;
                    }

                    // create row
                    var row = new HtmlGenericControl("div");
                    row.Attributes.Add("class", "row clearfix");

                    // create the label
                    var label = new HtmlGenericControl("div");
                    label.Attributes.Add("class", "label");
                    label.InnerText = value.Value;

                    // create the field
                    var field = new HtmlGenericControl("div");
                    field.Attributes.Add("class", "field");

                    // create the anchor
                    var anchor = new System.Web.UI.HtmlControls.HtmlAnchor();
                    anchor.HRef = string.Concat("?id=", this.m_DataType.DataTypeDefinitionId, "&delete=", value.Id);
                    anchor.InnerText = ui.Text("delete");
                    anchor.Attributes.Add("onclick", "javascript:return confirm('Are you sure you want to delete this value?');");

                    // add the anchor to the field
                    field.Controls.Add(anchor);

                    // add the label and field to the row
                    row.Controls.Add(label);
                    row.Controls.Add(field);

                    // add the row to the placeholder
                    placeholder.Controls.Add(row);

                }

                // render the placeholder
                writer.AddPrevalueRow("Values:", placeholder);
            }
        }