コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        public HtmlEditor.Builder HtmlEditor(HtmlEditor component)
        {
#if MVC
            component.ViewContext = this.HtmlHelper != null ? this.HtmlHelper.ViewContext : null;
#endif
            return(new HtmlEditor.Builder(component));
        }
コード例 #2
0
        public override string XGetDesignTimeHtml()
        {
            StringWriter   writer     = new StringWriter(CultureInfo.CurrentCulture);
            HtmlTextWriter htmlWriter = new HtmlTextWriter(writer);

            HtmlEditor c = (HtmlEditor)this.Control;

            string width  = " width: {0};".FormatWith((c.Width != Unit.Empty) ? c.Width.ToString() : "504px");
            string height = " height: {0};".FormatWith((c.Height != Unit.Empty) ? c.Height.ToString() : "275px");

            /*
             * 0 - ClientID
             * 1 - Text
             * 2 - Width
             * 3 - Height
             * 4 - Font
             * 5 - Format
             * 6 - FontSize
             * 7 - Colors
             * 8 - Alignments
             * 9 - Links
             * 10 - Lists
             * 11- SourceEdit
             */

            object[] args = new object[12];
            args[0]  = c.ClientID;
            args[1]  = c.Text;
            args[2]  = width;
            args[3]  = height;
            args[4]  = (c.EnableFont) ? this.Font : "";
            args[5]  = (c.EnableFormat) ? this.Format : "";
            args[6]  = (c.EnableFontSize) ? this.FontSize : "";
            args[7]  = (c.EnableColors) ? this.Colors : "";
            args[8]  = (c.EnableAlignments) ? this.Alignments : "";
            args[9]  = (c.EnableLinks) ? this.Links : "";
            args[10] = (c.EnableLists) ? this.Lists : "";
            args[11] = (c.EnableSourceEdit) ? this.SourceEdit : "";

            LiteralControl ctrl = new LiteralControl(string.Format(this.Html, args));

            ctrl.RenderControl(htmlWriter);

            return(writer.ToString());
        }
コード例 #3
0
 /// <summary>
 ///
 /// </summary>
 public HtmlEditor.Builder HtmlEditor(HtmlEditor component)
 {
     return(new HtmlEditor.Builder(component));
 }
コード例 #4
0
    /// <summary>
    /// Lấy fieldname và giá trị
    /// </summary>
    /// <param name="control"></param>
    /// <param name="value"></param>
    /// <returns></returns>
    private string GetFieldName(Ext.Net.Component control, ref object value)
    {
        switch (control.ToString())
        {
        case "Ext.Net.TextField":
            Ext.Net.TextField txtControl = (Ext.Net.TextField)control;
            value = txtControl.Text;
            if (!txtControl.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(txtControl.ID.Substring(txtControl.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.Hidden":
            Ext.Net.Hidden hdfControl = (Ext.Net.Hidden)control;
            value = hdfControl.Text;
            if (!hdfControl.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(hdfControl.ID.Substring(hdfControl.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.Checkbox":
            Ext.Net.Checkbox chk = (Ext.Net.Checkbox)control;
            value = chk.Checked == true ? 1 : 0;
            if (!chk.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(chk.ID.Substring(chk.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.DateField":
            Ext.Net.DateField dfDate = (Ext.Net.DateField)control;
            if (!SoftCore.Util.GetInstance().IsDateNull(dfDate.SelectedDate))
            {
                value = dfDate.SelectedDate.Month + "/" + dfDate.SelectedDate.Day + "/" + dfDate.SelectedDate.Year;
            }
            else
            {
                value = "";
            }
            if (!dfDate.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(dfDate.ID.Substring(dfDate.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.NumberField":
            Ext.Net.NumberField nbf = (Ext.Net.NumberField)control;
            value = nbf.Text;
            if (!nbf.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(nbf.ID.Substring(nbf.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.ComboBox":
            Ext.Net.ComboBox cbBox = (Ext.Net.ComboBox)control;
            value = cbBox.SelectedItem.Value;
            if (!cbBox.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(cbBox.ID.Substring(cbBox.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.SpinnerField":
            Ext.Net.SpinnerField spinnerField = (Ext.Net.SpinnerField)control;
            value = spinnerField.Text;
            if (!spinnerField.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(spinnerField.ID.Substring(spinnerField.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.TextArea":
            Ext.Net.TextArea txtArea = (Ext.Net.TextArea)control;
            value = txtArea.Text;
            if (!txtArea.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(txtArea.ID.Substring(txtArea.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.Container":
            Ext.Net.Container cContainer = (Ext.Net.Container)control;
            GetChildControl(cContainer);
            break;

        case "Ext.Net.FieldSet":
            Ext.Net.FieldSet fieldSet = (Ext.Net.FieldSet)control;
            GetChildControl(fieldSet);
            break;

        case "Ext.Net.HtmlEditor":
            Ext.Net.HtmlEditor htmlEditor = (Ext.Net.HtmlEditor)control;
            value = htmlEditor.Text;
            if (!htmlEditor.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(htmlEditor.ID.Substring(htmlEditor.ID.IndexOf("_") + 1));
            }
        }
        return("");
    }