Esempio n. 1
0
        void ApplyToolbarItemModel(IModelHtmlEditorToolBar toolbar, HtmlEditorToolbar editorToolbar, int index)
        {
            int i = 0;

            foreach (var toolbarItem in toolbar.Items.ToList())
            {
                var editorToolBarItem = EditorToolBarItem(toolbarItem, editorToolbar);
                ApplyModel(toolbarItem, editorToolBarItem, ApplyValues);
                var visibleIndex = (index + 1) * i;
                if (editorToolBarItem.Visible && editorToolBarItem.VisibleIndex != visibleIndex)
                {
                    editorToolBarItem.VisibleIndex = visibleIndex;
                }
                i++;
            }
        }
Esempio n. 2
0
 void CreateModelToolbarCustomDialogButton(HtmlEditorToolbar toolbar, IModelHtmlEditorToolBar modelHtmlEditorToolBar)
 {
     foreach (var editorToolbarItem in toolbar.Items.ToList())
     {
         var toolbarCustomDialogButton = editorToolbarItem as ToolbarCustomDialogButton;
         if (toolbarCustomDialogButton != null)
         {
             var customDialogButton = modelHtmlEditorToolBar.Items.AddNode <IModelToolbarCustomDialogButton>(toolbarCustomDialogButton.Name);
             customDialogButton.SetValue("Name", toolbarCustomDialogButton.Name);
             customDialogButton.SetValue("ToolTip", editorToolbarItem.ToolTip);
             customDialogButton.SetValue("ViewStyle", editorToolbarItem.ViewStyle);
             var modelNode = customDialogButton.GetNodeByPath("Image");
             modelNode.SetValue("Url", editorToolbarItem.Image.Url);
         }
         else
         {
             modelHtmlEditorToolBar.Items.AddNode <IModelHtmlEditorToolBarItem>(editorToolbarItem.CommandName);
         }
     }
 }