using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using Telerik.WebControls.RadEditorUtils;
using Telerik.WebControls;

namespace ServerAPI
{
  public partial class _Default : System.Web.UI.Page
  {
    protected void Page_Load(object sender, EventArgs e)
    {
      if (!Page.IsPostBack)
      {
        RadEditor1.EnableClientSerialize = false;
        RadEditor1.Skin = "Office2007";
        RadEditor1.ShowHtmlMode = false;
        RadEditor1.ShowPreviewMode = false;
        RadEditor1.ToolbarMode = EditorToolbarMode.Default;

        RadEditor1.Modules.Clear();
        Module module = new Module("RadEditorStatistics");
        module.DockingZoneId = "Right";
        module.IsDockable = false;
        RadEditor1.Modules.Add(module);

        ContextMenu contextMenu = new ContextMenu("p");
        contextMenu.Tools.Add(new ToolbarButton("JustifyLeft"));
        contextMenu.Tools.Add(new ToolbarButton("JustifyRight"));
        contextMenu.Tools.Add(new ToolbarButton("JustifyCenter"));
        contextMenu.Tools.Add(new ToolbarButton("JustifyFull"));
        RadEditor1.ContextMenus.Add(contextMenu);

        RadEditor1.Links.ChildLinks.Clear();
        Link link = RadEditor1.Links.Add("My <b>t</b>elerik Links", "http://www.telerik.com");
        link.Add("Demos", "http://www.telerik.com/demos/aspnet/Editor/Examples/Overview/DefaultCS.aspx");
        link.Add("RadEditor Help", "http://www.telerik.com/help/aspnet/editor/");
        link.Add("Products and Download", "http://www.telerik.com/client.net/my-licenses/my-purchases.aspx");

        RadEditor1.Toolbars.Clear();
        Telerik.WebControls.RadEditorUtils.Toolbar toolbar = new Toolbar("My Toolbar");
        toolbar.IsRibbon = true;
        toolbar.DockingZoneId = "Bottom";
        toolbar.IsDockable = false;
        toolbar.Tools.Add(new ToolbarButton("Copy"));
        toolbar.Tools.Add(new ToolbarButton("Paste"));
        toolbar.Tools.Add(new ToolbarSeparator());
        toolbar.Tools.Add(new ToolbarButton("Undo"));
        toolbar.Tools.Add(new ToolbarButton("Redo"));
        RadEditor1.Toolbars.Add(toolbar);

        Telerik.WebControls.RadEditorUtils.Toolbar tbLink = new Toolbar("DropdownToolbar");
        tbLink.IsRibbon = true;
        tbLink.DockingZoneId = "Bottom";
        tbLink.IsDockable = false;
        tbLink.Tools.Add(new ToolbarDropDown("InsertCustomLink"));
        RadEditor1.Toolbars.Add(tbLink);
      }
    }
  }
}
