Beispiel #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();
    }
Beispiel #2
0
 public RubberStamp(
     Page page,
     RectangleF box,
     string text,
     IconTypeEnum iconType
     ) : base(page, PdfName.Stamp, box, text)
 {
     IconType = iconType;
 }
Beispiel #3
0
 public RubberStamp(
     Page page,
     RectangleF box,
     string text,
     IconTypeEnum iconType
     )
     : base(page, PdfName.Stamp, box, text)
 {
     IconType = iconType;
 }
Beispiel #4
0
   public RubberStamp(
 Page page,
 RectangleF box,
 IconTypeEnum iconType
 )
       : base(page.Document,
   PdfName.Stamp,
   box,
   page)
   {
       IconType = iconType;
   }
Beispiel #5
0
 public RubberStamp(
     Page page,
     RectangleF box,
     IconTypeEnum iconType
     ) : base(
         page.Document,
         PdfName.Stamp,
         box,
         page
         )
 {
     IconType = iconType;
 }
Beispiel #6
0
    /// <summary>
    /// Handles the Load event of the Page control.
    /// </summary>
    protected void Page_Load(object sender, EventArgs e)
    {
        lstOptions.SelectedIndexChanged += lstOptions_SelectedIndexChanged;

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

            if (!RequestHelper.IsPostBack())
            {
                InitializeControl();
            }

            iconType = lstOptions.SelectedValue.ToEnum <IconTypeEnum>();
        }

        CheckFieldEmptiness = false;
    }
    /// <summary>
    /// Loads the form control data.
    /// </summary>
    private void InitializeControl()
    {
        if (DocumentType == null)
        {
            return;
        }

        // First load initialization
        if (!RequestHelper.IsPostBack())
        {
            // Icon CSS class
            txtCssClass.ToolTip = GetString("fontIconCss.tooltip");

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

            lstOptions.SelectedValue = iconType.ToStringRepresentation();
        }

        // This control can be used only under existing document type
        if (SystemContext.DevelopmentMode)
        {
            // Allow 'gif' images in development mode
            dfuSmall.AllowedExtensions = "gif;png";
            dfuLarge.AllowedExtensions = "gif;png";
        }

        // Hide direct file uploader for external storage
        if (StorageHelper.IsExternalStorage("~/App_Themes/Default/Images/DocumentTypeIcons"))
        {
            dfuLarge.Visible = false;
            dfuSmall.Visible = false;
        }

        // Register refresh script
        ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "RefreshIcons", ScriptHelper.GetScript("function RefreshIcons() {" + ControlsHelper.GetPostBackEventReference(this, "update") + "}"));
    }
Beispiel #8
0
    /// <summary>
    /// Page_Load event handler
    /// </summary>
    protected void Page_Load(object sender, EventArgs e)
    {
        // Hide the control if it shouldn't be processed or required document type data are not available
        if (StopProcessing || (DocumentType == null))
        {
            pnlIcons.Visible         = false;
            lblControlHidden.Visible = true;
            return;
        }

        lstOptions.SelectedIndexChanged += lstOptions_SelectedIndexChanged;

        if (Form != null)
        {
            InitializeControl();

            iconType = lstOptions.SelectedValue.ToEnum <IconTypeEnum>();
        }

        CheckFieldEmptiness = false;
    }
    /// <summary>
    /// Loads the form control data.
    /// </summary>
    private void InitializeControl()
    {
        if ((DocumentType == null) || (FormObject == null))
        {
            return;
        }

        // First load initialization
        if (!RequestHelper.IsPostBack())
        {
            // Icon CSS class
            txtCssClass.ToolTip = GetString("fontIconCss.tooltip");

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

            lstOptions.SelectedValue = iconType.ToStringRepresentation();
        }

        // This control can be used only under existing document type
        if (SystemContext.DevelopmentMode)
        {
            // Allow 'gif' images in development mode
            dfuSmall.AllowedExtensions = "gif;png";
            dfuLarge.AllowedExtensions = "gif;png";
        }

        // Hide direct file uploader for external storage
        if (StorageHelper.IsExternalStorage("~/App_Themes/Default/Images/DocumentTypeIcons"))
        {
            dfuLarge.Visible = false;
            dfuSmall.Visible = false;
        }

        // Register refresh script
        ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "RefreshIcons", ScriptHelper.GetScript("function RefreshIcons() {" + ControlsHelper.GetPostBackEventReference(this, "update") + "}"));
    }
    /// <summary>
    /// Page_Load event handler
    /// </summary>
    protected void Page_Load(object sender, EventArgs e)
    {
        // Hide the control if it shouldn't be processed or required document type data are not available
        if (StopProcessing || (DocumentType == null) || (FormObject == null))
        {
            pnlIcons.Visible = false;
            lblControlHidden.Visible = true;
            return;
        }

        lstOptions.SelectedIndexChanged += lstOptions_SelectedIndexChanged;

        if (Form != null)
        {
            InitializeControl();

            iconType = lstOptions.SelectedValue.ToEnum<IconTypeEnum>();
        }

        CheckFieldEmptiness = false;
    }
Beispiel #11
0
 public override void Deserialize(ref ReadOnlySpan <byte> buffer)
 {
     base.Deserialize(ref buffer);
     Icon = (IconTypeEnum)BinSerialize.ReadPackedUnsignedInteger(ref buffer);
 }
Beispiel #12
0
 /// <summary>
 /// Handles the SelectedIndexChanged event of the lstOptions control.
 /// </summary>
 private void lstOptions_SelectedIndexChanged(object sender, EventArgs e)
 {
     iconType = lstOptions.SelectedValue.ToEnum <IconTypeEnum>();
 }
    /// <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>
    /// Handles the Load event of the Page control.
    /// </summary>
    protected void Page_Load(object sender, EventArgs e)
    {
        lstOptions.SelectedIndexChanged += lstOptions_SelectedIndexChanged;

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

            if (!RequestHelper.IsPostBack())
            {
                InitializeControl();
            }

            iconType = lstOptions.SelectedValue.ToEnum<IconTypeEnum>();
        }

        CheckFieldEmptiness = false;
    }
 /// <summary>
 /// Handles the SelectedIndexChanged event of the lstOptions control.
 /// </summary>
 private void lstOptions_SelectedIndexChanged(object sender, EventArgs e)
 {
     iconType = EnumStringRepresentationExtensions.ToEnum <IconTypeEnum>(lstOptions.SelectedValue);
 }
 /// <summary>
 /// Handles the SelectedIndexChanged event of the lstOptions control.
 /// </summary>
 private void lstOptions_SelectedIndexChanged(object sender, EventArgs e)
 {
     iconType = lstOptions.SelectedValue.ToEnum<IconTypeEnum>();
 }
Beispiel #17
0
 /**
  * <summary>Gets the code corresponding to the given value.</summary>
  */
 private static PdfName ToCode(
     IconTypeEnum value
     )
 {
     return(IconTypeEnumCodes[value]);
 }
Beispiel #18
0
 /**
   <summary>Gets the code corresponding to the given value.</summary>
 */
 private static PdfName ToCode(
     IconTypeEnum value
     )
 {
     return IconTypeEnumCodes[value];
 }