Overview

Namespace: TheTechIdea.Beep.Winform.Controls.Design.Server.ActionLists
Inheritance: DesignerActionList | Visibility: internal sealed

ImagePathDesignerActionList provides a compact image-management smart-tag for any image-enabled control (buttons, picture boxes, panels with background images). It requires the hosting designer to implement IImagePathDesignerHost -- an interface declaring SelectImage(), ClearImage(), EmbedImage(), GetImagePath(), SetImagePath(). All items appear under a single "Image" header section.

IImagePathDesignerHost

internal interface IImagePathDesignerHost
{
    void SelectImage();     // Select/link an existing image file
    void ClearImage();      // Clear the current image
    void EmbedImage();      // Browse and embed an image as project resource
    string GetImagePath();  // Get current image path
    void SetImagePath(string path); // Set image path
}

Smart-Tag Items

SectionTypeNameLabelDescription
ImagePropertyImagePathImage PathGet/set the current image file path. Delegates to _host.GetImagePath()/_host.SetImagePath().
ImageActionSelectImageSelect / Link Image...Opens a file browser to select or link an existing image file. Delegates to _host.SelectImage().
ImageActionEmbedImageBrowse and Embed Image...Opens a file browser and embeds the chosen image as a project resource. Delegates to _host.EmbedImage().
ImageActionClearImageClear ImageRemoves the current image. Delegates to _host.ClearImage().

Examples

// At design time, any image-enabled control shows:
// Smart-tag > Image section > "Select / Link Image..."
// -> Opens file dialog to pick icon.png
// -> Sets ImagePath = "Icons/icon.png"

// Smart-tag > Image section > "Browse and Embed Image..."
// -> Opens file dialog, embeds as project resource
// -> Sets ImagePath and adds to .resx file

// Implementing IImagePathDesignerHost in a custom designer:
public class MyImageDesigner : ControlDesigner, IImagePathDesignerHost
{
    public void SelectImage() { /* show file dialog, set path */ }
    public void ClearImage() { /* clear ImagePath property */ }
    public void EmbedImage() { /* browse, add to resx, set path */ }
    public string GetImagePath() => ((MyControl)Component).ImagePath;
    public void SetImagePath(string p) => ((MyControl)Component).ImagePath = p;
}