ContentsExtensionsOnContentsToPath Field |
Namespace: SOWIWeb.Helper
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;
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 |
---|
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); }