public void ConfigureToolTip(ToolTip tip) { tip .Rendering .SetPrettyRender(true) .Finish() .Options .SetDisabled(this.disabled) .ShowAnimation .SetEffect(this.showEffect) .Finish() .HideAnimation .SetEffect(this.hideEffect) .Finish() .Position .SetAt(this.At1, this.At2) .SetMy(this.My1, this.My2) .SetCollision(this.Collision1, this.Collision2) .Finish() .SetTrack(this.track) .Finish(); if (this.showEvents) { tip .Events .SetCreateEvent("return createEvent(event, ui);") .SetOpenEvent("return openEvent(event, ui);") .SetCloseEvent("return closeEvent(event, ui);") .Finish(); } if (!this.prettyRender) tip.Rendering.Compress(); if (this.renderCSS) tip.Rendering.ShowCSS(); }
#pragma warning restore 1591 /// <summary> /// Contructor /// </summary> /// <param name="tooltip">Tooltip object we're configuring</param> public Options(ToolTip tooltip) : base() { this.ToolTip = tooltip; this.Reset(); this.Position = new PositionOptions(this); this.ShowAnimation = new AnimationOptions(this, "show"); this.HideAnimation = new AnimationOptions(this, "hide"); }
public string CSharpCode(ToolTip tip) { jStringBuilder sb = new jStringBuilder(true/*includeWhitespace*/, 0); sb.AppendTabsLineIf("<%"); sb.AppendTabsLineIf("Html.CreateToolTip(\"name\")"); string optionsCode = OptionsCSharpCode(); string positionOptionsCode = PositionsCSharpCode(); string showEventsCode = ShowEventsCSharpCode(); string renderCode = base.RenderCSharpCode(); bool showOptions = (optionsCode.Length > 0 || showEventsCode.Length > 0 || renderCode.Length > 0); if (showOptions) { sb.IncIndent(); if (optionsCode.Length > 0 || positionOptionsCode.Length > 0) { sb.AppendTabsLineIf(".Options"); sb.IncIndent(); sb.Append(optionsCode); sb.DecIndent(); sb.AppendTabsLineIf(".Finish()"); } if (positionOptionsCode.Length > 0) { sb.AppendTabsLineIf(".Options"); sb.IncIndent(); sb.Append(optionsCode); if (positionOptionsCode.Length > 0) { sb.AppendTabsLineIf(".Position"); sb.Append(positionOptionsCode); sb.AppendTabsLineIf(".Finish()"); } sb.DecIndent(); sb.AppendTabsLineIf(".Finish()"); } if (showEventsCode.Length > 0) { sb.AppendTabsLineIf(".Events"); sb.IncIndent(); sb.Append(showEventsCode); sb.DecIndent(); sb.AppendTabsLineIf(".Finish()"); } if (renderCode.Length > 0) sb.Append(renderCode); sb.DecIndent(); } sb.AppendTabsLineIf(".Render();"); sb.AppendTabsLineIf("%>"); return sb.ToString(); }
public void Auto_Script_With_Selector_Delivers_Correct_Rendering() { // Arrange var resp = new MockWriter(); ToolTip tooltip = new ToolTip(resp, "myTipper"); // only testing raw output tooltip.Rendering.Compress(); TestHelper.ForceRender(tooltip); // Act - Force output we'd see on the web page string html = resp.Output.ToString(); // Assert string expected = "<script type=\"text/javascript\">" + "$(document).ready( function() {" + "$(\"#myTipper\").tooltip()" + ";});" + "</script>"; Assert.IsTrue(html.Contains(expected)); }
/// <summary> /// Constructor /// </summary> /// <param name="tip">ToolTip object to configure events for</param> public Events(ToolTip tip) : base() { this.ToolTip = tip; this.Reset(); }
internal static void ForceRender(ToolTip t) { t.Render(); }
internal static ToolTip SetupSimpleToolTipObject(TextWriter writer) { ToolTip t = new ToolTip(writer); return t; }
/// <summary> /// Constructor /// </summary> /// <param name="tooltip">ToolTip object to call</param> public Methods(ToolTip tooltip) : base(tooltip) { // need a reference back to the control that created us this.ToolTip = tooltip; }
public string JavaScriptCode(ToolTip tip) { tip.Rendering.SetPrettyRender(true); return tip.GetStartUpScript(); }
/// <summary> /// Constructor /// </summary> /// <param name="ToolTip">ToolTip object to set rendering options of</param> public Rendering(ToolTip tooltip) : base() { this.ToolTip = tooltip; }
/// <summary> /// Creates a ToolTip control that can be configured and later rendered on the page. /// </summary> /// <param name="page">WebForms page to render the control onto</param> /// <param name="id">ID to target the tooltip on (must be unique on the page)</param> /// <returns>Created ToolTip control</returns> public static ToolTip CreateToolTip(this System.Web.UI.Page page, string id) { TextWriter writer = page.Response.Output; ToolTip newToolTip = new ToolTip(writer, id); return newToolTip; }
/// <summary> /// Creates a ToolTip control that can be configured and later rendered on the page. /// </summary> /// <param name="html">Html helper (used to get the HttpResponse object to render onto)</param> /// <param name="id">ID to target the tooltip (must be unique on the page)</param> /// <returns>Created ToolTip control</returns> public static ToolTip CreateToolTip(this HtmlHelper html, string id) { TextWriter writer = html.ViewContext.Writer; ToolTip newToolTip = new ToolTip(writer, id); return newToolTip; }