Пример #1
0
    /// <summary>
    /// Loads the form control data.
    /// </summary>
    private void InitializeControl()
    {
        if (FormObject != null)
        {
            // Icon CSS class
            txtCssClass.Text    = FormObject.GetStringValue(IconCssFieldName, null);
            txtCssClass.ToolTip = GetString("fontIconCss.tooltip");

            // Load file uploader
            fileUploader.Category   = Category;
            fileUploader.ObjectType = FormObject.TypeInfo.ObjectType;
            fileUploader.ObjectID   = FormObject.Generalized.ObjectID;

            if (FormObject.Generalized.ObjectSiteID > 0)
            {
                fileUploader.SiteID = FormObject.Generalized.ObjectSiteID;
            }

            // Identify the currently selected icon type
            iconType = IconTypeEnum.Metafile;
            if (!string.IsNullOrEmpty(txtCssClass.Text))
            {
                iconType = IconTypeEnum.CssClass;
            }

            lstOptions.SelectedValue = iconType.ToStringRepresentation();
        }

        InitializeUploadControl();
    }
    /// <summary>
    /// Initializes the CSS class text box control.
    /// </summary>
    private void InitializeCssClassTextBox()
    {
        // Icon CSS class
        txtCssClass.Text    = FormObject.GetStringValue(IconCssFieldName, null);
        txtCssClass.ToolTip = GetString("fontIconCss.tooltip");

        // Set the max length of the textbox according to the form field definition
        if ((IconCssFieldInfo != null) && (IconCssFieldInfo.DataType == FieldDataType.Text))
        {
            txtCssClass.MaxLength = IconCssFieldInfo.Size;
        }
    }
Пример #3
0
    /// <summary>
    /// Handles the Load event of the Page control.
    /// </summary>
    protected void Page_Load(object sender, EventArgs e)
    {
        CheckFieldEmptiness = false;

        if (Form != null)
        {
            Form.OnBeforeSave += Form_OnBeforeSave;
            Form.OnAfterSave  += Form_OnAfterSave;
        }

        if (!RequestHelper.IsPostBack() && (FormObject != null))
        {
            InitializeThumbnailTypeDropDownList();

            fontIconSelector.Value         = FormObject.GetStringValue(IconCssFieldName, null);
            drpThumbnailType.SelectedValue = String.IsNullOrEmpty(fontIconSelector.Value) ? ThumbnailTypeEnum.Metafile.ToStringRepresentation() : ThumbnailTypeEnum.CssClass.ToStringRepresentation();
        }

        SetupFileUploaderControl();
    }