Click or drag to resize

ContentsExtensionsOnContentsToPath Field

Event for SOWI Web Helper Contents Extensions ToPath(Contents)

Namespace:  SOWIWeb.Helper
Assembly:  SOWIWeb.Helper (in SOWIWeb.Helper.dll) Version: 19.1.23.1 (19.1.23.622)
Syntax
public static EventHandler<EventArgsViewEnum<Contents>> OnContentsToPath

Field Value

Type: EventHandlerEventArgsViewEnumContents
Examples
This example puts a costum content view path

Adds event handler for a custom content view path setting

//* add event handler for a custom content view path setting *
SOWIWeb.Helper.ContentsExtensions.OnContentsToPath += this.OnContentsToPath;
Event handler puts custom view path
private void OnContentsToPath(object sender, EventArgsViewEnum<Contents> e)
{
    switch (e.View)
    {
        case Contents.none:
            break;
        case Contents.CreateContent:
            break;
        case Contents.DeleteContent:
            break;
        case Contents.DetailsContent:
            break;
        case Contents.EditContent:
            break;
        case Contents.IndexContentDataTables:
            e.Path = "path changed";
            break;
        default:
            break;
    }
}
Note Note
When a local content to remove the event handler. See following example.
/// <summary>
/// Remove event handler for a custom content view path setting
/// </summary>
/// <param name="disposing"></param>
protected override void Dispose(bool disposing)
{
  SOWIWeb.Helper.ContentsExtensions.OnContentsToPath -= this.OnContentsToPath;

  base.Dispose(disposing);
}
See Also