public GridFooterCellBuilder(IDictionary<string, object> htmlAttributes, HtmlTemplate<GridAggregateResult> template) { this.htmlAttributes = htmlAttributes; this.template = template; Decorators = new List<IGridCellBuilderDecorator>(); }
public Editor(ViewContext viewContext, IJavaScriptInitializer initializer, IUrlGenerator urlGenerator) : base(viewContext, initializer) { UrlGenerator = urlGenerator; DefaultToolGroup = new EditorToolGroup(this); Template = new HtmlTemplate(); Messages = new EditorMessages(); StyleSheets = new List<string>(); new EditorToolFactory(DefaultToolGroup) .Bold().Italic().Underline().Strikethrough() .FontName() .FontSize() .FontColor().BackColor() .JustifyLeft().JustifyCenter().JustifyRight().JustifyFull() .InsertUnorderedList().InsertOrderedList() .Outdent().Indent() .FormatBlock() .CreateLink().Unlink() .InsertImage(); ImageBrowserSettings = new EditorImageBrowserSettings(Messages.ImageBrowserMessages); }
public Editor(ViewContext viewContext, IJavaScriptInitializer initializer, IUrlGenerator urlGenerator) : base(viewContext, initializer) { UrlGenerator = urlGenerator; DefaultToolGroup = new EditorToolGroup(this); Template = new HtmlTemplate(); Messages = new EditorMessages(); StyleSheets = new List<string>(); Pdf = new PDFSettings(); new EditorToolFactory(DefaultToolGroup) .Formatting() .Bold().Italic().Underline() .JustifyLeft().JustifyCenter().JustifyRight() .InsertUnorderedList().InsertOrderedList() .Outdent().Indent() .CreateLink().Unlink() .InsertImage() .TableEditing(); TagName = "textarea"; ImageBrowserSettings = new EditorImageBrowserSettings(Messages.ImageBrowserMessages); FileBrowserSettings = new EditorFileBrowserSettings(Messages.FileBrowserMessages); //>> Initialization Resizable = new EditorResizableSettings(); Serialization = new EditorSerializationSettings(); //<< Initialization }
public void Applying_when_html_is_set_sets_html_of_the_node() { var template = new HtmlTemplate<object>(); template.Html = "<strong>foo</strong>"; var node = new HtmlElement("div"); template.Apply(null, node); Assert.Equal(template.Html, node.InnerHtml); }
/// <summary> /// Initialize the WidgetView instance. /// </summary> public WidgetView() { UserPreferencesTemplate = new HtmlTemplate<WidgetHelper>(); HeaderTemplate = new HtmlTemplate<WidgetHelper>(); ContentTemplate = new HtmlTemplate<WidgetHelper>(); DesignTemplate = new HtmlTemplate<WidgetHelper>(); PreviewTemplate = new HtmlTemplate<WidgetHelper>(); }
public void Applying_when_code_block_is_set_sets_template_of_the_node() { var template = new HtmlTemplate<object>(); template.CodeBlockTemplate = delegate { }; var node = new HtmlElement("div"); template.Apply(null, node); Assert.NotNull(node.Template()); }
public void Applying_when_inline_template_sets_html_of_the_node() { var template = new HtmlTemplate<object>(); template.InlineTemplate = (value) => value; var node = new HtmlElement("div"); template.Apply("foo", node); Assert.Equal("<div>foo</div>", node.ToString()); }
public SplitterPane() { Scrollable = true; Resizable = true; HtmlAttributes = new RouteValueDictionary(); Template = new HtmlTemplate(); }
public MobileNavBar(ViewContext viewContext, IJavaScriptInitializer initializer, IUrlGenerator urlGenerator) : base(viewContext, initializer) { this.urlGenerator = urlGenerator; Content = new HtmlTemplate(); //>> Initialization //<< Initialization }
public InfoWindow(Marker marker) : base(marker.Map) { if (marker == null) throw new ArgumentNullException("marker"); this.marker = marker; Content = string.Format("{0}Marker{1}",marker.Map.Id,marker.Index); Template = new HtmlTemplate(); }
public ResponsivePanel(ViewContext viewContext, IJavaScriptInitializer initializer, IUrlGenerator urlGenerator) : base(viewContext, initializer) { this.urlGenerator = urlGenerator; Template = new HtmlTemplate(); //>> Initialization //<< Initialization }
public InfoWindow(Marker marker) : base(PassThroughNonNull(marker).Map) { if (marker == null) throw new ArgumentNullException("marker"); this.marker = marker; Content = string.Format(CultureInfo.InvariantCulture, "{0}Marker{1}",marker.Map.Id,marker.Index); Template = new HtmlTemplate(); }
private void SendConfirmationMail(MembershipUser user, string newEmail) { HtmlTemplate<ChangeEmailConfirmation> body = new HtmlTemplate<ChangeEmailConfirmation>(); body.Template.Email = newEmail; body.Template.Code = user.ProviderUserKey.ToString(); body.Template.Checker = Hash.ReadableHash(Hash.MD5, newEmail + body.Template.Code); body.Template.Host = Request.Url.Host; MailMessage m = new MailMessage("*****@*****.**", newEmail, CommonResources.ChangeEmailEmailSubject, body.GenerateHtml()); m.IsBodyHtml = true; new System.Net.Mail.SmtpClient().Send(m); }
public void Setting_html_clears_other_properties() { var template = new HtmlTemplate<string>(); template.InlineTemplate = delegate { return null; }; template.CodeBlockTemplate = delegate { }; template.Html = "foo"; Assert.Null(template.CodeBlockTemplate); Assert.Null(template.InlineTemplate); }
public MobileSplitViewPane() { //>> Initialization //<< Initialization HtmlAttributes = new RouteValueDictionary(); Content = new HtmlTemplate(); Events = new Dictionary<string, object>(); }
public MobileDrawer(ViewContext viewContext, IJavaScriptInitializer initializer, IUrlGenerator urlGenerator) : base(viewContext, initializer) { this.urlGenerator = urlGenerator; Header = new HtmlTemplate(); Content = new HtmlTemplate(); Footer = new HtmlTemplate(); SwipeToOpen = true; //>> Initialization //<< Initialization }
public MobileLayout(ViewContext viewContext, IJavaScriptInitializer initializer, IUrlGenerator urlGenerator) : base(viewContext, initializer) { this.urlGenerator = urlGenerator; Header = new HtmlTemplate(); Footer = new HtmlTemplate(); HeaderHtmlAttributes = new RouteValueDictionary(); FooterHtmlAttributes = new RouteValueDictionary(); //>> Initialization //<< Initialization }
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)); }
private void SendConfirmationMail(MembershipUser user, string newEmail) { HtmlTemplate<ChangeEmailConfirmation> body = new HtmlTemplate<ChangeEmailConfirmation>(); body.Template.Email = newEmail; body.Template.Code = user.ProviderUserKey.ToString(); body.Template.Checker = Hash.ReadableHash(Hash.MD5, newEmail + body.Template.Code); body.Template.Host = Request.Url.Host; var to = new MailAddress(newEmail, user.UserName); var m = SmtpManager.Instance.CreateMail(to , CommonResources.ChangeEmailEmailSubject , body.GenerateHtml()); SmtpManager.Instance.Send(m); }
public void Should_render_column_footer_template_if_declared() { const string expectedContent = "template content"; var template = new HtmlTemplate<GridAggregateResult> { Html = expectedContent }; var cell = new GridFooterCellBuilder(new Dictionary<string, object>(), template).CreateCell(); cell.InnerHtml.ShouldEqual(expectedContent); }
public void Should_apply_template() { var template = new HtmlTemplate<Customer>(); template.Html = "foo"; builder = new GridTemplateCellBuilder<Customer>(template); builder.Callback = delegate { }; var td = builder.CreateCell(null); td.InnerHtml.ShouldEqual("foo"); }
public static void SendRegistrationMail(MembershipUser user, string password) { HtmlTemplate<CompleteRegistration> body = new HtmlTemplate<CompleteRegistration>(); body.Template.Login = user.UserName; body.Template.Password = password; body.Template.Code = user.ProviderUserKey.ToString(); body.Template.Host = HttpContext.Current.Request.Url.Host; var to = new MailAddress(user.Email, user.UserName); var m = SmtpManager.Instance.CreateMail(to , CommonResources.RegistrationEmailSubject , body.GenerateHtml()); SmtpManager.Instance.Send(m); }
public MobilePopOver(ViewContext viewContext, IJavaScriptInitializer initializer, IUrlGenerator urlGenerator) : base(viewContext, initializer) { this.urlGenerator = urlGenerator; Content = new HtmlTemplate(); //>> Initialization Pane = new MobilePopOverPaneSettings(); Popup = new MobilePopOverPopupSettings(); //<< Initialization }
public void Should_append_template_if_both_commands_and_template_is_defined() { var template = new HtmlTemplate {Html = "aaaa"}; var toolBarData = new GridToolBarData { Commands = new[] {new Mock<IGridActionCommand>().Object}, Template = template }; sectionBuilder.CreateToolBar(toolBarData); toolBarBuilder.Verify(tb => tb.CreateToolBar(template), Times.Once()); toolBarBuilder.Verify(tb => tb.CreateToolBar(It.IsAny<IEnumerable<IGridButtonBuilder>>()),Times.Never()); }
public MobileCollapsible(ViewContext viewContext, IJavaScriptInitializer initializer, IUrlGenerator urlGenerator) : base(viewContext, initializer) { this.urlGenerator = urlGenerator; Collapsed = true; Animation = true; Inset = false; Header = new HtmlTemplate(); Content = new HtmlTemplate(); //>> Initialization //<< Initialization }
public Window(ViewContext viewContext, IJavaScriptInitializer initializer) : base(viewContext, initializer) { Template = new HtmlTemplate(); ResizingSettings = new WindowResizingSettings(); Actions = new WindowButtons(); defaultButtons.Each(button => Actions.Container.Add(button)); Animation = new PopupAnimation(); ContentHtmlAttributes = new RouteValueDictionary(); Scrollable = true; Visible = true; }
public void Send(Message m) { var user = Membership.GetUser(m.RecipientId); if (user != null && user.IsOnline == false) { var profile = CustomProfileProvider.GetProfileByUserKey(m.RecipientId); if (profile != null && profile.EmailMessageNotification == true) { HtmlTemplate<NewMessageNotification> body = new HtmlTemplate<NewMessageNotification>(); body.Template.SenderId = m.SenderId; body.Template.RecipientId = m.RecipientId; var to = new MailAddress(user.Email, user.UserName); var mail = SmtpManager.Instance.CreateMail(to , CommonResources.Notification_NewMessageSubject , body.GenerateHtml()); SmtpManager.Instance.Send(mail); } } }
public void Should_pass_aggregate_result_to_template_if_exists() { var expectedResult = new GridAggregateResult(new AggregateResult[0]); GridAggregateResult result = null; var template = new HtmlTemplate<GridAggregateResult> { InlineTemplate = arg => result = arg }; var cellBuilder = new GridFooterCellBuilder(new Dictionary<string, object>(), template) { AggregateResults = expectedResult }; cellBuilder.CreateCell().ToString(); result.ShouldBeSameAs(expectedResult); }
public Editor(ViewContext viewContext, IClientSideObjectWriterFactory clientSideObjectWriterFactory) : base(viewContext, clientSideObjectWriterFactory) { ScriptFileNames.AddRange(new[] { "telerik.common.js", "telerik.list.js", "telerik.combobox.js", "telerik.draganddrop.js", "telerik.window.js", "telerik.editor.js" }); DefaultToolGroup = new EditorToolGroup(); ClientEvents = new EditorClientEvents(); StyleSheets = new WebAssetItemGroup("default", false) { DefaultPath = WebAssetDefaultSettings.StyleSheetFilesPath }; Localization = new EditorLocalization(); 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(); }
public Window(ViewContext viewContext, IClientSideObjectWriterFactory clientSideObjectWriterFactory, IWindowHtmlBuilderFactory builderFactory) : base(viewContext, clientSideObjectWriterFactory) { this.builderFactory = builderFactory; ScriptFileNames.AddRange(new[] { "telerik.common.js", "telerik.draganddrop.js", "telerik.window.js" }); Template = new HtmlTemplate(); ClientEvents = new WindowClientEvents(); ResizingSettings = new WindowResizingSettings(); Buttons = new WindowButtons(); defaultButtons.Each(button => Buttons.Container.Add(button)); Effects = new Effects(); defaultEffects.Each(el => Effects.Container.Add(el)); ContentHtmlAttributes = new RouteValueDictionary(); Scrollable = true; Visible = true; }