protected override void AddAttributesToElement (ScriptTextWriter writer) { base.AddAttributesToElement (writer); if (Method != "") writer.WriteAttributeString ("method", Method); }
protected override void AddAttributesToElement (ScriptTextWriter writer) { base.AddAttributesToElement (writer); foreach (string prop in valueProperties.Keys) writer.WriteAttributeString (prop, (string)valueProperties[prop]); }
protected override void AddAttributesToElement (ScriptTextWriter writer) { base.AddAttributesToElement (writer); if (Target != "") writer.WriteAttributeString ("target", Target); }
protected internal virtual void RenderBehavior (ScriptTextWriter writer) { RenderScriptBeginTag (writer); AddAttributesToElement (writer); // XXX toshok: just a hunch, but we probably // don't have bindings in behaviors.. so // let's leave out the contents? RenderScriptEndTag (writer); }
protected override void AddAttributesToElement (ScriptTextWriter writer) { base.AddAttributesToElement (writer); if (Property != "") writer.WriteAttributeString ("property", Property); if (Value != "") writer.WriteAttributeString ("value", Value); }
protected override void AddAttributesToElement (ScriptTextWriter writer) { base.AddAttributesToElement (writer); if (CssClass != "") writer.WriteAttributeString ("cssClass", CssClass); if (ClientID != null && ClientID != "") writer.WriteAttributeString ("targetElement", ClientID); }
protected override void RenderScriptTagContents (ScriptTextWriter writer) { base.RenderScriptTagContents (writer); foreach (string colName in collections.Keys) { ScriptComponentCollection col = (ScriptComponentCollection)collections[colName]; writer.WriteStartElement (colName); foreach (IScriptComponent c in col) c.RenderScript (writer); writer.WriteEndElement (); // colName } }
protected override void RenderScriptTagContents (ScriptTextWriter writer) { base.RenderScriptTagContents (writer); if (behaviors != null && behaviors.Count > 0) { writer.WriteStartElement ("behaviors"); foreach (Behavior b in behaviors) { b.RenderScript (writer); } writer.WriteEndElement (); // behaviors } }
public void Render () { DraggableListItem b = new DraggableListItem (); StringWriter sw; ScriptTextWriter w; sw = new StringWriter(); w = new ScriptTextWriter (sw); ((IScriptComponent)b).RenderScript (w); Assert.AreEqual ("", sw.ToString(), "A1"); }
public void Render () { FloatingBehavior c = new FloatingBehavior (); StringWriter sw; ScriptTextWriter w; sw = new StringWriter(); w = new ScriptTextWriter (sw); ((IScriptComponent)c).RenderScript (w); Assert.AreEqual ("", sw.ToString(), "A1"); }
protected override void RenderScriptTagContents (ScriptTextWriter writer) { base.RenderScriptTagContents (writer); writer.WriteStartElement ("layoutTemplate"); writer.WriteStartElement ("template"); writer.WriteAttributeString ("layoutElement", ID + "_layoutTemplate"); // XXX ? writer.WriteEndElement (); // template writer.WriteEndElement (); // layoutTemplate writer.WriteStartElement ("itemTemplate"); writer.WriteEndElement (); // itemTemplate }
public void ValueProperty_duplicate () { GenericScriptComponent c = new GenericScriptComponent ("generic"); StringWriter sw = new StringWriter(); ScriptTextWriter w = new ScriptTextWriter (sw); c.AddValueProperty ("key1", "value1"); c.AddValueProperty ("key1", "value2"); ((IScriptComponent)c).RenderScript (w); Assert.AreEqual ("<generic key1=\"value2\" />", sw.ToString (), "A1"); }
public void RenderActions (ScriptTextWriter writer) { if (Actions.Count == 0) return; writer.WriteStartElement (Name); foreach (Action a in Actions) { a.RenderAction (writer); } writer.WriteEndElement (); }
public void CollectionItem () { GenericScriptComponent c = new GenericScriptComponent ("generic"); StringWriter sw = new StringWriter(); ScriptTextWriter w = new ScriptTextWriter (sw); GenericScriptComponent foo = new GenericScriptComponent ("foo"); c.AddCollectionItem ("behaviors", foo); ((IScriptComponent)c).RenderScript (w); Assert.AreEqual ("<generic>\n <behaviors>\n <foo />\n </behaviors>\n</generic>", sw.ToString ().Replace ("\r\n", "\n"), "A1"); }
public void Render () { HoverBehavior b = new HoverBehavior (); StringWriter sw; ScriptTextWriter w; sw = new StringWriter(); w = new ScriptTextWriter (sw); b.HoverElementID = "hi"; b.UnhoverDelay = 100; ((IScriptComponent)b).RenderScript (w); Assert.AreEqual ("", sw.ToString(), "A1"); }
public void Render () { PropertyFilter f = new PropertyFilter (); StringWriter sw; ScriptTextWriter w; sw = new StringWriter(); w = new ScriptTextWriter (sw); f.Property = "Property"; f.Value = "Value"; ((IScriptComponent)f).RenderScript (w); Assert.AreEqual ("<propertyFilter property=\"Property\" value=\"Value\" />", sw.ToString(), "A1"); }
protected override void RenderScriptTagContents (ScriptTextWriter writer) { base.RenderScriptTagContents (writer); if (AutoCompletionServiceMethod != "" && AutoCompletionServiceUrl != "") { writer.WriteStartElement ("behaviors"); writer.WriteStartElement ("autoComplete"); writer.WriteAttributeString ("serviceURL", AutoCompletionServiceUrl); writer.WriteAttributeString ("serviceMethod", AutoCompletionServiceMethod); if (AutoCompletionMinimumPrefixLength != 0) writer.WriteAttributeString ("minimumPrefixLength", AutoCompletionMinimumPrefixLength.ToString()); writer.WriteAttributeString ("completionList", ID + "__autocomplete"); // XXX ? writer.WriteEndElement (); // autoComplete writer.WriteEndElement (); // behaviors } }
public void Render () { SetPropertyAction a = new SetPropertyAction (); StringWriter sw; ScriptTextWriter w; // test an empty action sw = new StringWriter(); w = new ScriptTextWriter (sw); a.RenderAction (w); Assert.AreEqual ("<setProperty />", sw.ToString(), "A1"); // test with a property a.Target = "target"; a.Property = "property"; a.PropertyKey = "propertyKey"; a.Value = "value"; sw = new StringWriter(); w = new ScriptTextWriter (sw); a.RenderAction (w); Assert.AreEqual ("<setProperty target=\"target\" property=\"property\" propertyKey=\"propertyKey\" value=\"value\" />", sw.ToString(), "A2"); // test with a target and id a.ID = "set_id"; a.Target = "target"; a.Property = "property"; a.PropertyKey = "propertyKey"; a.Value = "value"; sw = new StringWriter(); w = new ScriptTextWriter (sw); a.RenderAction (w); Assert.AreEqual ("<setProperty id=\"set_id\" target=\"target\" property=\"property\" propertyKey=\"propertyKey\" value=\"value\" />", sw.ToString(), "A3"); }
protected virtual void RenderScriptBeginTag (ScriptTextWriter writer) { writer.WriteStartElement (TagName); }
void IScriptComponent.RenderScript (ScriptTextWriter writer) { RenderScriptBeginTag (writer); AddAttributesToElement (writer); RenderScriptTagContents (writer); RenderScriptEndTag (writer); }
protected virtual void AddAttributesToElement (ScriptTextWriter writer) { if (ID != null && ID != "") writer.WriteAttributeString ("id", ID); }
protected virtual void RenderScriptTagContents (ScriptTextWriter writer) { if (bindings != null && bindings.Count > 0) { writer.WriteStartElement ("bindings"); foreach (Binding b in bindings) { b.RenderScript (writer); } writer.WriteEndElement (); // bindings } }
protected virtual void RenderScriptEndTag (ScriptTextWriter writer) { writer.WriteEndElement (); }
protected virtual void RenderScriptBeginTag(ScriptTextWriter writer) { writer.WriteStartElement(TagName); }
void IScriptComponent.RenderScript(ScriptTextWriter writer) { RenderScript(writer); }
[ExpectedException (typeof (NullReferenceException))] // this happens with MS anyway. public void Attributes () { Poker c = new Poker (); StringWriter sw; ScriptTextWriter w; sw = new StringWriter(); w = new ScriptTextWriter (sw); c.AddAttributes (w); Assert.AreEqual ("", sw.ToString(), "A1"); }
public void AddAttributes (ScriptTextWriter w) { AddAttributesToElement (w); }
public void RenderAction(ScriptTextWriter writer) { ((IScriptComponent)this).RenderScript(writer); }
public void RenderActions () { ActionPoker a = new ActionPoker (); ScriptEvent e = new ScriptEvent (a, "HelloEvent", true); StringWriter sw; ScriptTextWriter w; // test an empty event sw = new StringWriter(); w = new ScriptTextWriter (sw); e.RenderActions (w); Assert.AreEqual ("", sw.ToString(), "A1"); // now add an action and see what happens ActionPoker action = new ActionPoker (); action.ID = "action_id"; action.Target = "action_target"; e.Actions.Add (action); e.RenderActions (w); Assert.AreEqual ("<HelloEvent>\n <poker id=\"action_id\" target=\"action_target\" />\n</HelloEvent>", sw.ToString().Replace ("\r\n", "\n"), "A2"); }
public void Render () { DataSourceDropTarget c = new DataSourceDropTarget (); StringWriter sw; ScriptTextWriter w; sw = new StringWriter(); w = new ScriptTextWriter (sw); ((IScriptComponent)c).RenderScript (w); Assert.AreEqual ("", sw.ToString(), "A1"); }
public void RenderHandlers(ScriptTextWriter writer) { writer.WriteAttributeString(Name, Handler); }
protected virtual void RenderScriptEndTag(ScriptTextWriter writer) { writer.WriteEndElement(); }
public void RenderHandlers (ScriptTextWriter writer) { writer.WriteAttributeString (Name, Handler); }
public void RenderScript (ScriptTextWriter writer) { writer.WriteStartElement ("binding"); if (Automatic == false) writer.WriteAttributeString ("automatic", Automatic.ToString()); if (DataContext != "") writer.WriteAttributeString ("dataContext", DataContext); if (DataPath != "") writer.WriteAttributeString ("dataPath", DataPath); if (Direction != BindingDirection.In) writer.WriteAttributeString ("direction", Direction.ToString()); if (ID != "") writer.WriteAttributeString ("id", ID); if (Property != "") writer.WriteAttributeString ("property", Property); if (PropertyKey != "") writer.WriteAttributeString ("propertyKey", PropertyKey); if (TransformerArgument != "") writer.WriteAttributeString ("transformerArgument", TransformerArgument); writer.WriteEndElement (); }
public void RenderHandlers () { ActionPoker a = new ActionPoker (); ScriptEvent e = new ScriptEvent (a, "HelloEvent", true); StringWriter sw; ScriptTextWriter w; sw = new StringWriter(); w = new ScriptTextWriter (sw); e.Handler = "hi there"; e.RenderHandlers (w); Assert.AreEqual ("HelloEvent=\"hi there\"", sw.ToString(), "A1"); }
protected internal sealed override void RenderScript(ScriptTextWriter writer) { RenderBehavior(writer); }