Exemplo n.º 1
0
        public Editor(ViewContext viewContext,
                      IClientSideObjectWriterFactory clientSideObjectWriterFactory,
                      IWebAssetCollectionResolver resolver,
                      ILocalizationService localizationService,
                      IUrlGenerator urlGenerator)
            : base(viewContext, clientSideObjectWriterFactory)
        {
            this.resolver     = resolver;
            this.urlGenerator = urlGenerator;

            ScriptFileNames.AddRange(new[] {
                "telerik.common.js",
                "telerik.list.js",
                "telerik.combobox.js",
                "telerik.draganddrop.js",
                "telerik.window.js",
                "telerik.editor.js"
            });

            DefaultToolGroup = new EditorToolGroup(this);

            ClientEvents = new EditorClientEvents();

            StyleSheets = new WebAssetGroup("default", false)
            {
                DefaultPath = WebAssetDefaultSettings.StyleSheetFilesPath
            };

            Localization = new EditorLocalization(localizationService, CultureInfo.CurrentUICulture);

            Template = new HtmlTemplate();

            new EditorToolFactory(DefaultToolGroup)
            .Bold().Italic().Underline().Strikethrough()
            .Separator()
            .FontName()
            .FontSize()
            .FontColor().BackColor()
            .Separator()
            .JustifyLeft().JustifyCenter().JustifyRight().JustifyFull()
            .Separator()
            .InsertUnorderedList().InsertOrderedList()
            .Separator()
            .Outdent().Indent()
            .Separator()
            .FormatBlock()
            .Separator()
            .CreateLink().Unlink()
            .Separator()
            .InsertImage();

            FileBrowserSettings = new EditorFileBrowserSettings(this);

            DefaultToolGroup.Tools.OfType <EditorComboBox>()
            .Each(combo => combo.InputHtmlAttributes.Add("title", combo.Identifier));
        }
Exemplo n.º 2
0
        public Editor(ViewContext viewContext, 
            IClientSideObjectWriterFactory clientSideObjectWriterFactory, 
            IWebAssetCollectionResolver resolver, 
            ILocalizationService localizationService,
            IUrlGenerator urlGenerator)
            : base(viewContext, clientSideObjectWriterFactory)
        {
            this.resolver = resolver;
            this.urlGenerator = urlGenerator;

            ScriptFileNames.AddRange(new[] {
                "telerik.common.js",
                "telerik.list.js",
                "telerik.combobox.js",
                "telerik.draganddrop.js",
                "telerik.window.js",
                "telerik.editor.js"
            });

            DefaultToolGroup = new EditorToolGroup(this);

            ClientEvents = new EditorClientEvents();

            StyleSheets = new WebAssetGroup("default", false) { DefaultPath = WebAssetDefaultSettings.StyleSheetFilesPath };

            Localization = new EditorLocalization(localizationService, CultureInfo.CurrentUICulture);

            Template = new HtmlTemplate();

            new EditorToolFactory(DefaultToolGroup)
                .Bold().Italic().Underline().Strikethrough()
                .Separator()
                .FontName()
                .FontSize()
                .FontColor().BackColor()
                .Separator()
                .JustifyLeft().JustifyCenter().JustifyRight().JustifyFull()
                .Separator()
                .InsertUnorderedList().InsertOrderedList()
                .Separator()
                .Outdent().Indent()
                .Separator()
                .FormatBlock()
                .Separator()
                .CreateLink().Unlink()
                .Separator()
                .InsertImage();

            FileBrowserSettings = new EditorFileBrowserSettings(this);

            DefaultToolGroup.Tools.OfType<EditorComboBox>()
                .Each(combo => combo.InputHtmlAttributes.Add("title", combo.Identifier));
        }