コード例 #1
0
		protected override void AddAttributesToElement (ScriptTextWriter writer)
		{
			base.AddAttributesToElement (writer);

			if (Method != "")
				writer.WriteAttributeString ("method", Method);
		}
コード例 #2
0
		protected override void AddAttributesToElement (ScriptTextWriter writer)
		{
			base.AddAttributesToElement (writer);

			foreach (string prop in valueProperties.Keys)
				writer.WriteAttributeString (prop, (string)valueProperties[prop]);
		}
コード例 #3
0
ファイル: Action.cs プロジェクト: alesliehughes/olive
		protected override void AddAttributesToElement (ScriptTextWriter writer)
		{
			base.AddAttributesToElement (writer);

			if (Target != "")
				writer.WriteAttributeString ("target", Target);
		}
コード例 #4
0
ファイル: Behavior.cs プロジェクト: alesliehughes/olive
		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);
		}
コード例 #5
0
ファイル: PropertyFilter.cs プロジェクト: alesliehughes/olive
		protected override void AddAttributesToElement (ScriptTextWriter writer)
		{
			base.AddAttributesToElement (writer);

			if (Property != "")
				writer.WriteAttributeString ("property", Property);
			if (Value != "")
				writer.WriteAttributeString ("value", Value);
		}
コード例 #6
0
ファイル: ScriptControl.cs プロジェクト: alesliehughes/olive
		protected override void AddAttributesToElement (ScriptTextWriter writer)
		{
			base.AddAttributesToElement (writer);

			if (CssClass != "")
				writer.WriteAttributeString ("cssClass", CssClass);

			if (ClientID != null && ClientID != "")
				writer.WriteAttributeString ("targetElement", ClientID);
		}
コード例 #7
0
		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
			}
		}
コード例 #8
0
ファイル: ScriptControl.cs プロジェクト: alesliehughes/olive
		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
			}
		}
コード例 #9
0
		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");
		}
コード例 #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");
		}
コード例 #11
0
ファイル: ListView.cs プロジェクト: alesliehughes/olive
		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
		}
コード例 #12
0
		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");
		}
コード例 #13
0
ファイル: ScriptEvent.cs プロジェクト: alesliehughes/olive
		public void RenderActions (ScriptTextWriter writer)
		{
			if (Actions.Count == 0)
				return;

			writer.WriteStartElement (Name);

			foreach (Action a in Actions) {
				a.RenderAction (writer);
			}

			writer.WriteEndElement ();
		}
コード例 #14
0
		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");
		}
コード例 #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");
		}
コード例 #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");
		}
コード例 #17
0
ファイル: TextBox.cs プロジェクト: alesliehughes/olive
		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
			}
				
		}
コード例 #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");
		}
コード例 #19
0
		protected virtual void RenderScriptBeginTag (ScriptTextWriter writer)
		{
			writer.WriteStartElement (TagName);
		}
コード例 #20
0
		void IScriptComponent.RenderScript (ScriptTextWriter writer)
		{
			RenderScriptBeginTag (writer);
			AddAttributesToElement (writer);
			RenderScriptTagContents (writer);
			RenderScriptEndTag (writer);
		}
コード例 #21
0
		protected virtual void AddAttributesToElement (ScriptTextWriter writer)
		{
			if (ID != null && ID != "")
				writer.WriteAttributeString ("id", ID);
		}
コード例 #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
			}
		}
コード例 #23
0
		protected virtual void RenderScriptEndTag (ScriptTextWriter writer)
		{
			writer.WriteEndElement ();
		}
コード例 #24
0
ファイル: ScriptComponent.cs プロジェクト: stanasse/olive
 protected virtual void RenderScriptBeginTag(ScriptTextWriter writer)
 {
     writer.WriteStartElement(TagName);
 }
コード例 #25
0
ファイル: ScriptComponentBase.cs プロジェクト: stanasse/olive
 void IScriptComponent.RenderScript(ScriptTextWriter writer)
 {
     RenderScript(writer);
 }
コード例 #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");
		}
コード例 #27
0
			public void AddAttributes (ScriptTextWriter w)
			{
				AddAttributesToElement (w);
			}
コード例 #28
0
ファイル: Action.cs プロジェクト: stanasse/olive
 public void RenderAction(ScriptTextWriter writer)
 {
     ((IScriptComponent)this).RenderScript(writer);
 }
コード例 #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");
		}
コード例 #30
0
		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");
		}
コード例 #31
0
 public void RenderHandlers(ScriptTextWriter writer)
 {
     writer.WriteAttributeString(Name, Handler);
 }
コード例 #32
0
ファイル: ScriptComponent.cs プロジェクト: stanasse/olive
 protected virtual void RenderScriptEndTag(ScriptTextWriter writer)
 {
     writer.WriteEndElement();
 }
コード例 #33
0
ファイル: ScriptEvent.cs プロジェクト: alesliehughes/olive
		public void RenderHandlers (ScriptTextWriter writer)
		{
			writer.WriteAttributeString (Name, Handler);
		}
コード例 #34
0
ファイル: Binding.cs プロジェクト: alesliehughes/olive
		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 ();
		}
コード例 #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");
		}
コード例 #36
0
 protected internal sealed override void RenderScript(ScriptTextWriter writer)
 {
     RenderBehavior(writer);
 }