From: Jean-Philippe Bruyère Date: Mon, 19 Feb 2018 07:51:40 +0000 (+0100) Subject: try to make tg loading multithreaded, thread sync probs X-Git-Tag: v0.9.5-beta~163 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=c4ba610f43b9302ae5ece7741ad12fd3ab4b1fac;p=jp%2Fcrow.git try to make tg loading multithreaded, thread sync probs --- diff --git a/Templates/ComboBox.template b/Templates/ComboBox.template index 4a209023..aed500ab 100755 --- a/Templates/ComboBox.template +++ b/Templates/ComboBox.template @@ -1,16 +1,20 @@ - + diff --git a/Tests/BasicTests.cs b/Tests/BasicTests.cs index 8c851286..97469591 100644 --- a/Tests/BasicTests.cs +++ b/Tests/BasicTests.cs @@ -164,22 +164,23 @@ namespace Tests //testFiles = new string [] { @"Interfaces/Unsorted/testFileDialog.crow" }; //testFiles = new string [] { @"Interfaces/Divers/colorPicker.crow" }; - //testFiles = new string [] { @"Interfaces/Divers/welcome.crow" }; + testFiles = new string [] { @"Interfaces/Divers/welcome.crow" }; //testFiles = new string [] { @"Interfaces/TemplatedContainer/testTabView.crow" }; //testFiles = new string [] { @"Interfaces/TemplatedControl/testSpinner.crow" }; - testFiles = new string [] { @"Interfaces/DragAndDrop/0.crow" }; + //testFiles = new string [] { @"Interfaces/DragAndDrop/0.crow" }; //testFiles = new string [] { @"Interfaces/TemplatedControl/testItemTemplateTag.crow" }; - testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/DragAndDrop", "*.crow")).ToArray (); + testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedControl", "*.crow")).ToArray (); testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Divers", "*.crow")).ToArray (); testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray (); testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Container", "*.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/TemplatedControl", "*.crow")).ToArray (); + testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedContainer", "*.crow")).ToArray (); testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedGroup", "*.crow")).ToArray (); testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Splitter", "*.crow")).ToArray (); testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Wrapper", "*.crow")).ToArray (); + testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/DragAndDrop", "*.crow")).ToArray (); testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Unsorted", "*.crow")).ToArray (); Load(testFiles[idx]).DataSource = this; diff --git a/src/GraphicObjects/Group.cs b/src/GraphicObjects/Group.cs index 3802a4d9..10d87ab6 100644 --- a/src/GraphicObjects/Group.cs +++ b/src/GraphicObjects/Group.cs @@ -263,7 +263,7 @@ namespace Crow gr.Clip (); } - lock (Children) { + lock (children) { foreach (GraphicObject c in Children) { if (!c.Visible) continue; diff --git a/src/GraphicObjects/TemplatedGroup.cs b/src/GraphicObjects/TemplatedGroup.cs index 264c9e80..f2c097a2 100644 --- a/src/GraphicObjects/TemplatedGroup.cs +++ b/src/GraphicObjects/TemplatedGroup.cs @@ -176,7 +176,7 @@ namespace Crow if (value == data) return; - //cancelLoadingThread (); + cancelLoadingThread (); if (data is IObservableList) { IObservableList ol = data as IObservableList; @@ -200,11 +200,9 @@ namespace Crow if (data == null) return; -// loadingThread = new CrowThread (this, loading); -// loadingThread.Finished += (object sender, EventArgs e) => (sender as TemplatedGroup).Loaded.Raise (sender, e); -// loadingThread.Start (); - - loadPage (data, items, dataTest); + loadingThread = new CrowThread (this, loading); + loadingThread.Finished += (object sender, EventArgs e) => (sender as TemplatedGroup).Loaded.Raise (sender, e); + loadingThread.Start (); NotifyValueChanged ("SelectedIndex", _selectedIndex); NotifyValueChanged ("SelectedItem", SelectedItem); @@ -327,7 +325,9 @@ namespace Crow /// /// Items loading thread /// -// void loading(){ + void loading(){ + loadPage (data, items, dataTest); + } // //if (!ItemTemplates.ContainsKey ("default")) // // ItemTemplates ["default"] = Interface.GetItemTemplate (ItemTemplate); //