aboutsummaryrefslogtreecommitdiffstatsci
path: root/Tests/BasicTests.cs
diff options
context:
space:
mode:
authorj-p <jp.bruyere@live.be>2016-08-11 04:20:36 +0200
committerGitHub <noreply@github.com>2016-08-11 04:20:36 +0200
commit81eb8c7a75ffbe8b6740b2a84a9ebff75da9b393 (patch)
tree3225277358a2bba61c4496923ba39353c942098b /Tests/BasicTests.cs
parent4d4a9116ea5c68b27f0b7c43db9682ab57738ae7 (diff)
parent7560c0bb4a769210e289e2633ddf13d2617f8e6e (diff)
Merge pull request #18 from jpbruyere/BindingImprovement
Instantiator
Diffstat (limited to 'Tests/BasicTests.cs')
-rw-r--r--Tests/BasicTests.cs27
1 files changed, 21 insertions, 6 deletions
diff --git a/Tests/BasicTests.cs b/Tests/BasicTests.cs
index 2a82bd23..658cddd8 100644
--- a/Tests/BasicTests.cs
+++ b/Tests/BasicTests.cs
@@ -4,6 +4,8 @@ using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Reflection;
+using System.Text;
+using System.Diagnostics;
namespace Tests
@@ -92,10 +94,10 @@ namespace Tests
this.KeyDown += KeyboardKeyDown1;
- testFiles = new string [] { @"Interfaces/Divers/welcome.crow" };
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray ();
- //testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/basicTests", "*.crow")).ToArray ();
+ //testFiles = new string [] { @"Interfaces/Divers/welcome.crow" };
+ testFiles = Directory.GetFiles (@"Interfaces/basicTests", "*.crow");
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Container", "*.crow")).ToArray ();
+ testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Group", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Stack", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Splitter", "*.crow")).ToArray ();
@@ -151,14 +153,27 @@ namespace Tests
if (fi == null)
return;
if (fi.Extension == ".crow" || fi.Extension == ".goml") {
- IMLStream imls = new IMLStream (fi.FullName);
+ Instantiator i = new Instantiator(fi.FullName);
lock (CrowInterface.UpdateMutex) {
(CrowInterface.FindByName ("crowContainer") as Container).SetChild
- (imls.Instance);
- CurSources = imls.Source;
+ (i.CreateInstance());
+ CurSources = i.GetImlSourcesCode();
}
}
}
+ void onImlSourceChanged(Object sender, TextChangeEventArgs e){
+ Instantiator i;
+ try {
+ i = Instantiator.CreateFromImlFragment (e.Text);
+ } catch (Exception ex) {
+ Debug.WriteLine (ex);
+ return;
+ }
+ lock (CrowInterface.UpdateMutex) {
+ (CrowInterface.FindByName ("crowContainer") as Container).SetChild
+ (i.CreateInstance());
+ }
+ }
void onButClick(object send, MouseButtonEventArgs e)
{
Console.WriteLine ("button clicked:" + send.ToString());