コード例 #1
0
ファイル: Parser.cs プロジェクト: alesliehughes/olive
	public void TestSimplestAddChild()
	{

		code = "<ConsoleApp xmlns=\"console\" xmlns:x=\"http://schemas.microsoft.com/winfx/xaml/2005\">\n"+
			"<ConsoleWriter></ConsoleWriter>" +
			"</ConsoleApp>";
		ConsoleApp app = new ConsoleApp();
		ConsoleWriter writer = new ConsoleWriter();
		app.AddChild(writer);

		compare(app);
	}
コード例 #2
0
ファイル: Parser.cs プロジェクト: alesliehughes/olive
	public void TestKeyAndStaticResource()
	{
		code = "<ConsoleApp xmlns=\"console\" xmlns:x=\"http://schemas.microsoft.com/winfx/xaml/2005\">\n"+
			"<ConsoleWriter Text=\"xyz\" x:Key=\"foobar\" />\n" +
			"<ConsoleReader Prompt=\"{StaticResource foobar}\" />\n" +
			"</ConsoleApp>";

		ConsoleApp app = new ConsoleApp();
		ConsoleWriter writer = new ConsoleWriter();
		writer.Text = new ConsoleValueString("xyz");
		app.AddChild(writer);
		ConsoleReader reader = new ConsoleReader();
		app.AddChild(reader);
		reader.Prompt = writer;
		
		compare(app);
	}
コード例 #3
0
ファイル: Parser.cs プロジェクト: alesliehughes/olive
	public void TestDependencyProperty()
	{
		code = "<ConsoleApp xmlns=\"console\" xmlns:x=\"http://schemas.microsoft.com/winfx/xaml/2005\">\n"+
			"<ConsoleWriter ConsoleApp.Repetitions=\"3\" />" +
			"</ConsoleApp>";

		ConsoleApp app = new ConsoleApp();
		ConsoleWriter writer = new ConsoleWriter();
		ConsoleApp.SetRepetitions(writer, 3);
		app.AddChild(writer);

		compare(app);
	}
コード例 #4
0
ファイル: Parser.cs プロジェクト: alesliehughes/olive
	public void TestObjectAsPropertyValue()
	{
		code = "<ConsoleApp xmlns=\"console\" xmlns:x=\"http://schemas.microsoft.com/winfx/xaml/2005\">\n"+
		"<ConsoleReader>\n" +
		"<ConsoleReader.Prompt><ConsoleWriter /></ConsoleReader.Prompt>\n" +
		"</ConsoleReader>\n" +
		"</ConsoleApp>";
		ConsoleApp app = new ConsoleApp();
		ConsoleReader reader = new ConsoleReader();
		app.AddChild(reader);
		ConsoleWriter writer = new ConsoleWriter();
		reader.Prompt = writer;
		compare(app);
	}
コード例 #5
0
ファイル: Parser.cs プロジェクト: alesliehughes/olive
	public void TestTextProperty()
	{
		code = "<ConsoleApp xmlns=\"console\" xmlns:x=\"http://schemas.microsoft.com/winfx/xaml/2005\">\n"+
			"<ConsoleWriter Text=\"Hello\" />" +
			"</ConsoleApp>";

		ConsoleApp app = new ConsoleApp();
		ConsoleWriter writer = new ConsoleWriter();
		writer.Text = new ConsoleValueString("Hello");
		app.AddChild(writer);

		compare(app);							
	}