AI OnAI Off
using System;
using EPiServer;
using EPiServer.Editor;
using EPiServer.Editor.Tools;
namespace EditorPluginSamples
{
[EditorPlugIn(ServerOnly=true)]
public class ChangeEditorCSS : ToolBase, IInitializableTool
{
void IInitializableTool.Initialize(HtmlEditor editor)
{
// Modify editor in editor's PreRender, that executes
// after everything else has been setup.
editor.PreRender += new EventHandler(editor_PreRender);
}
private void editor_PreRender(object sender, EventArgs e)
{
HtmlEditor editor = (HtmlEditor) sender;
string stylesDir = Global.EPConfig.RootDir + "styles/";
switch(editor.CreatorObject.Name)
{
case "Details1":
editor.ContentCssFile = stylesDir + "CustomEditor1.css";
break;
case "Details2":
editor.ContentCssFile = stylesDir + "CustomEditor2.css";
break;
case "Details3":
editor.ContentCssFile = stylesDir + "CustomEditor3.css";
break;
}
}
}
}