Esempio n. 1
0
		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]);
		}
Esempio n. 3
0
		protected override void AddAttributesToElement (ScriptTextWriter writer)
		{
			base.AddAttributesToElement (writer);

			if (Target != "")
				writer.WriteAttributeString ("target", Target);
		}
Esempio n. 4
0
		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);
		}
Esempio n. 5
0
		protected override void AddAttributesToElement (ScriptTextWriter writer)
		{
			base.AddAttributesToElement (writer);

			if (Property != "")
				writer.WriteAttributeString ("property", Property);
			if (Value != "")
				writer.WriteAttributeString ("value", Value);
		}
Esempio n. 6
0
		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
			}
		}
Esempio n. 8
0
		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");
		}
Esempio n. 10
0
		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");
		}
Esempio n. 11
0
		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");
		}
Esempio n. 13
0
		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");
		}
Esempio n. 15
0
		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");
		}
Esempio n. 16
0
		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");
		}
Esempio n. 17
0
		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
			}
				
		}
Esempio n. 18
0
		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");
		}
Esempio n. 19
0
		protected virtual void RenderScriptBeginTag (ScriptTextWriter writer)
		{
			writer.WriteStartElement (TagName);
		}
Esempio n. 20
0
		void IScriptComponent.RenderScript (ScriptTextWriter writer)
		{
			RenderScriptBeginTag (writer);
			AddAttributesToElement (writer);
			RenderScriptTagContents (writer);
			RenderScriptEndTag (writer);
		}
Esempio n. 21
0
		protected virtual void AddAttributesToElement (ScriptTextWriter writer)
		{
			if (ID != null && ID != "")
				writer.WriteAttributeString ("id", ID);
		}
Esempio n. 22
0
		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
			}
		}
Esempio n. 23
0
		protected virtual void RenderScriptEndTag (ScriptTextWriter writer)
		{
			writer.WriteEndElement ();
		}
Esempio n. 24
0
 protected virtual void RenderScriptBeginTag(ScriptTextWriter writer)
 {
     writer.WriteStartElement(TagName);
 }
Esempio n. 25
0
 void IScriptComponent.RenderScript(ScriptTextWriter writer)
 {
     RenderScript(writer);
 }
Esempio n. 26
0
		[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");
		}
Esempio n. 27
0
			public void AddAttributes (ScriptTextWriter w)
			{
				AddAttributesToElement (w);
			}
Esempio n. 28
0
 public void RenderAction(ScriptTextWriter writer)
 {
     ((IScriptComponent)this).RenderScript(writer);
 }
Esempio n. 29
0
		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");
		}
Esempio n. 31
0
 public void RenderHandlers(ScriptTextWriter writer)
 {
     writer.WriteAttributeString(Name, Handler);
 }
Esempio n. 32
0
 protected virtual void RenderScriptEndTag(ScriptTextWriter writer)
 {
     writer.WriteEndElement();
 }
Esempio n. 33
0
		public void RenderHandlers (ScriptTextWriter writer)
		{
			writer.WriteAttributeString (Name, Handler);
		}
Esempio n. 34
0
		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 ();
		}
Esempio n. 35
0
		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");
		}
Esempio n. 36
0
 protected internal sealed override void RenderScript(ScriptTextWriter writer)
 {
     RenderBehavior(writer);
 }