The Initialize method, if implemented, is called right after the object has been created and added to the editor's controls collection. The object can use this method to setup things for the tool and to attach to various editor events, for example the PreRender event to extend the editor right-click menu.

Namespace:  EPiServer.Editor.Tools
Assembly:  EPiServer (in EPiServer.dll) Version: 5.2.375.236

Syntax

C#
void Initialize(
	HtmlEditor editor
)

Parameters

editor
Type: EPiServer.Editor..::.HtmlEditor

Examples

The following sample plugin modifies the editor's width and height settings runtime in the Initialize method of the IInitializableTool interface. It does only execute on the server, at the time when all plugins are initialized by EPiSever.
CopyC#
using System;
using System.IO;
using System.Web.UI.WebControls;

using EPiServer.Editor;
using EPiServer.Editor.Tools;

namespace CodeSamples
{
   [EditorPlugIn()]
   public class ChangeEditorSettings : ToolBase, IInitializableTool
   {
      void IInitializableTool.Initialize(HtmlEditor editor)
      {
         editor.EditorAreaWidth = Unit.Pixel(600);
         editor.Height = Unit.Pixel(100);
      }
   }
}

See Also