]> O.S.I.I.S - jp/crow.git/commitdiff
Cairo namespace renamed to Crow.Cairo to avoid md addins fault
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Wed, 21 Aug 2019 14:03:14 +0000 (16:03 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Wed, 21 Aug 2019 14:03:14 +0000 (16:03 +0200)
122 files changed:
Crow.sln
Crow/Crow.csproj
Crow/src/BmpPicture.cs
Crow/src/CompilerServices/CompilerServices.cs
Crow/src/Fill/Fill.cs
Crow/src/Font.cs
Crow/src/Gradient.cs
Crow/src/GraphicObjects/Border.cs
Crow/src/GraphicObjects/Button.cs
Crow/src/GraphicObjects/GraduatedSlider.cs
Crow/src/GraphicObjects/Group.cs
Crow/src/GraphicObjects/HueSelector.cs
Crow/src/GraphicObjects/Image.cs
Crow/src/GraphicObjects/Label.cs
Crow/src/GraphicObjects/PrivateContainer.cs
Crow/src/GraphicObjects/ProgressBar.cs
Crow/src/GraphicObjects/SaturationValueSelector.cs
Crow/src/GraphicObjects/Scroller.cs
Crow/src/GraphicObjects/ScrollingObject.cs
Crow/src/GraphicObjects/Shape.cs
Crow/src/GraphicObjects/Slider.cs
Crow/src/GraphicObjects/TabItem.cs
Crow/src/GraphicObjects/TabView.cs
Crow/src/GraphicObjects/TemplatedControl.cs
Crow/src/GraphicObjects/TemplatedGroup.cs
Crow/src/GraphicObjects/TestCairoPatch.cs
Crow/src/GraphicObjects/TextBox.cs
Crow/src/GraphicObjects/TextRun.cs
Crow/src/GraphicObjects/Trend.cs
Crow/src/GraphicObjects/Widget.cs
Crow/src/Interface.cs
Crow/src/Mono.Cairo/Antialias.cs
Crow/src/Mono.Cairo/Cairo.cs
Crow/src/Mono.Cairo/CairoDebug.cs
Crow/src/Mono.Cairo/Content.cs
Crow/src/Mono.Cairo/Context.cs
Crow/src/Mono.Cairo/DRMDevice.cs
Crow/src/Mono.Cairo/DRMSurface.cs
Crow/src/Mono.Cairo/Device.cs
Crow/src/Mono.Cairo/DirectFBSurface.cs
Crow/src/Mono.Cairo/Distance.cs
Crow/src/Mono.Cairo/EGLDevice.cs
Crow/src/Mono.Cairo/Extend.cs
Crow/src/Mono.Cairo/FillRule.cs
Crow/src/Mono.Cairo/Filter.cs
Crow/src/Mono.Cairo/FontExtents.cs
Crow/src/Mono.Cairo/FontFace.cs
Crow/src/Mono.Cairo/FontOptions.cs
Crow/src/Mono.Cairo/FontSlant.cs
Crow/src/Mono.Cairo/FontType.cs
Crow/src/Mono.Cairo/FontWeight.cs
Crow/src/Mono.Cairo/Format.cs
Crow/src/Mono.Cairo/GLSurface.cs
Crow/src/Mono.Cairo/GLXDevice.cs
Crow/src/Mono.Cairo/GlitzSurface.cs
Crow/src/Mono.Cairo/Glyph.cs
Crow/src/Mono.Cairo/Gradient.cs
Crow/src/Mono.Cairo/HintMetrics.cs
Crow/src/Mono.Cairo/HintStyle.cs
Crow/src/Mono.Cairo/ImageSurface.cs
Crow/src/Mono.Cairo/LineCap.cs
Crow/src/Mono.Cairo/LineJoin.cs
Crow/src/Mono.Cairo/LinearGradient.cs
Crow/src/Mono.Cairo/Matrix.cs
Crow/src/Mono.Cairo/MeshPattern.cs
Crow/src/Mono.Cairo/NativeMethods.cs
Crow/src/Mono.Cairo/Operator.cs
Crow/src/Mono.Cairo/PSSurface.cs
Crow/src/Mono.Cairo/Path.cs
Crow/src/Mono.Cairo/Pattern.cs
Crow/src/Mono.Cairo/PatternType.cs
Crow/src/Mono.Cairo/PdfSurface.cs
Crow/src/Mono.Cairo/Point.cs
Crow/src/Mono.Cairo/PointD.cs
Crow/src/Mono.Cairo/RadialGradient.cs
Crow/src/Mono.Cairo/Region.cs
Crow/src/Mono.Cairo/ScaledFont.cs
Crow/src/Mono.Cairo/SolidPattern.cs
Crow/src/Mono.Cairo/Status.cs
Crow/src/Mono.Cairo/SubpixelOrder.cs
Crow/src/Mono.Cairo/Surface.cs
Crow/src/Mono.Cairo/SurfacePattern.cs
Crow/src/Mono.Cairo/SurfaceType.cs
Crow/src/Mono.Cairo/SvgSurface.cs
Crow/src/Mono.Cairo/SvgVersion.cs
Crow/src/Mono.Cairo/TextExtents.cs
Crow/src/Mono.Cairo/WGLDevice.cs
Crow/src/Mono.Cairo/Win32Surface.cs
Crow/src/Mono.Cairo/XcbSurface.cs
Crow/src/Mono.Cairo/XlibSurface.cs
Crow/src/Picture.cs
Crow/src/SolidColor.cs
Crow/src/SvgPicture.cs
Crow/src/backends/win32/WinBackend.cs [changed mode: 0755->0644]
Crow/src/debug/DbgEventTypeColors.cs
Crow/src/debug/DbgLogViewer.cs
Crow/src/debug/DebugLogger.cs
Crow/src/rsvg/Handle.cs
CrowIDE/CrowIDE.csproj
CrowIDE/IDE.style
CrowIDE/src/CrowIDE.cs
CrowIDE/src/DesignInterface.cs
CrowIDE/src/Editors/CodeBuffer/TextEditor.cs
CrowIDE/src/Editors/ImlVisualEditor.cs
CrowIDE/src/Editors/SourceEditor.cs
CrowIDE/src/Editors/SvgEditor.cs
CrowIDE/src/GraphicObjectDesignContainer.cs
CrowIDE/src/MemberView/MembersView.cs
CrowIDE/src/MemberView/PropertyContainer.cs
CrowIDE/src/Project.cs
CrowIDE/src/ProjectTree/ProjectFile.cs
CrowIDE/src/ProjectTree/ProjectItem.cs
CrowIDE/src/ProjectTree/ProjectReference.cs
CrowIDE/src/Solution.cs [deleted file]
CrowIDE/src/Workspace.cs [new file with mode: 0644]
Samples/HelloWorld/main.cs
Samples/ShowCase/main.cs
Samples/common/ui/Interfaces/Container/1.crow
Samples/common/ui/Interfaces/Container/3.crow
Samples/common/ui/Interfaces/Divers/testBind0.crow
Samples/common/ui/Interfaces/TemplatedContainer/test_Listbox.crow
Samples/common/ui/Interfaces/TemplatedControl/testCombobox.crow

index 37f1d7b111dd608be69409548c3f8376c468c760..465d115b9dcaf65c85e709db7d9f91442e3e745c 100644 (file)
--- a/Crow.sln
+++ b/Crow.sln
@@ -37,7 +37,7 @@ Global
        GlobalSection(MonoDevelopProperties) = preSolution
                Policies = $0
                $0.StandardHeader = $1
-               $1.Text = @\n${FileName}\n \nAuthor:\n      ${AuthorName} <${AuthorEmail}>\n\nCopyright (c) 2013-2017 Jean-Philippe Bruyère\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the "Software"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.
+               $1.Text = @Copyright (c) ${Year}  ${AuthorName} <${AuthorEmail}>\n\nThis code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
                $0.DotNetNamingPolicy = $2
                $0.TextStylePolicy = $3
                $3.EolMarker = Unix
@@ -69,7 +69,6 @@ Global
                $6.LastFilePostfix = "@:\n  "
                $6.LineAlign = 0
                $6.Wrap = False
-               $5.inheritsSet = Mono
                description = @C.R.O.W. c# Rapid Open Widgets\n\nCrow is a pure c# widget toolkit with XML definition of interface, bindings, styling...\n
                version = 0.8.0
        EndGlobalSection
index 7a1330933d5f6768ab72c6d8dfd761472385637d..857a24e90291424432e3c969d22c0390a38ad2d3 100644 (file)
@@ -1,10 +1,10 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <Import Project="$(SolutionDir)netfx.props" />
   <PropertyGroup>
-    <TargetFrameworks>net471;netstandard2.0</TargetFrameworks>
+    <TargetFrameworks>net461;net471;netstandard2.0</TargetFrameworks>
     <AssemblyName>Crow</AssemblyName>
     <Copyright></Copyright>
-    <AssemblyVersion>0.8.1</AssemblyVersion>    
+    <AssemblyVersion>0.8.3.2</AssemblyVersion>    
     <Description>C.R.O.W. is a widget toolkit and rendering engine entirely developed in C# with templates, styles, compositing, and bindings.</Description>        
                     
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>        
     <PackageIconUrl>https://jpbruyere.github.io/Crow/images/crow.png</PackageIconUrl>
     <PackageCopyright>Copyright 2013-2019</PackageCopyright>
     <PackageReleaseNotes>xcb backend</PackageReleaseNotes>    
-    <RepositoryUrl>https://github.com/jpbruyere/Crow</RepositoryUrl>
+    <RepositoryUrl>https://github.com/jpbruyere/Crow</RepositoryUrl>           
+       
+       <LangVersion>7.2</LangVersion>
         
     <OutputPath>$(SolutionDir)build\$(Configuration)\</OutputPath>        
     <DefineConstants>DESIGN_MODE</DefineConstants>
-    <ReleaseVersion>0.8.0</ReleaseVersion>
   </PropertyGroup>   
   
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugType>full</DebugType>
     <DefineConstants>TRACE;DESIGN_MODE;_DEBUG_CLIP_RECTANGLE;_DEBUG_FOCUS;_DEBUG_DRAGNDROP;DEBUG;NETFRAMEWORK;NET471</DefineConstants>
-    <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
+    <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>    
   </PropertyGroup>
        
   <ItemGroup Condition="$(TargetFramework.StartsWith('net4'))">
index 98c2a01607898fc50577e33b6fbcb22afbdf1344..540087dc6814c480461fa7997c2df5b5efd63526 100644 (file)
@@ -26,7 +26,7 @@
 
 using System;
 using System.IO;
-using Cairo;
+using Crow.Cairo;
 
 namespace Crow
 {
index d57cb7b57c66774350ea316b2735cea5f6a55b08..8819e86dbf89dccb3f0749cd9097d047c4d55c06 100644 (file)
@@ -920,7 +920,8 @@ namespace Crow.IML
                                foreach (Type expT in a.GetExportedTypes ()) {
                                        if (expT.Name != strDataType)
                                                continue;
-                                       knownTypes.Add (strDataType, expT);
+                                       if (!knownTypes.ContainsKey(strDataType))
+                                               knownTypes.Add (strDataType, expT);
                                        return expT;
                                }
                        }
index 0c0bdf5b671be0a26c257ffbd09c53db9f5a57b9..7d521045cbb5086f2aac43c6562df86c71341d23 100644 (file)
@@ -26,7 +26,7 @@
 
 using System;
 using System.Collections.Generic;
-using Cairo;
+using Crow.Cairo;
 
 namespace Crow
 {
index 16353d70226eda53fd98c24b8a43176515f2e058..06df4a88ae6f78d1367c7cf5668796fbab3eb538 100644 (file)
@@ -25,7 +25,7 @@
 // THE SOFTWARE.
 
 using System;
-using Cairo;
+using Crow.Cairo;
 
 namespace Crow
 {
index 2630c42a59dc00990c1b44068c27f6ed5d94d7c4..e76be7b6fcec6b8d2364c40dcefa1f987503087b 100644 (file)
@@ -26,7 +26,7 @@
 
 using System;
 using System.Collections.Generic;
-using Cairo;
+using Crow.Cairo;
 
 namespace Crow
 {
index 9379c26acaa96525a5ef1d64a8cc1eec26f793a8..e5a16ec8949b3758fc0c3237ea1f1149d47b4652 100644 (file)
@@ -28,7 +28,7 @@ using System;
 using System.Xml.Serialization;
 using System.ComponentModel;
 using System.Diagnostics;
-using Cairo;
+using Crow.Cairo;
 
 namespace Crow
 {
index 30612512f208522f844153370f07f67ed39ead73..8b15c2ea6ec000d7c56378a6d641075d5a1a1b17 100644 (file)
@@ -33,7 +33,7 @@ using System.Text;
 using System.Diagnostics;
 
 using System.Xml.Serialization;
-using Cairo;
+using Crow.Cairo;
 using System.ComponentModel;
 
 namespace Crow
index e1d4dd46e8a45f872811842542f1ea6d477b0801..71bbff112954ef479880906f4263dcf6aeb89eea 100644 (file)
@@ -28,7 +28,7 @@ using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
-using Cairo;
+using Crow.Cairo;
 using System.Xml.Serialization;
 
 namespace Crow
index 26a5084d8d365eb738a4be03e44638297d2a5f92..a0ae35b24c7785e76c7724c1e98ea04f87a9f3c8 100644 (file)
@@ -28,7 +28,7 @@ using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Xml.Serialization;
-using Cairo;
+using Crow.Cairo;
 using System.Diagnostics;
 using System.Reflection;
 using System.Threading;
index d8218feeb64b30af95ddcb88a3c87a7577246112..e9a31dfbeb0187bf0ae9df5418f66f9e809d5169 100644 (file)
@@ -27,7 +27,7 @@
 using System;
 using System.Xml.Serialization;
 using System.ComponentModel;
-using Cairo;
+using Crow.Cairo;
 
 namespace Crow
 {
index 388abb1b4b74acc9dea19bf548577f32bfdb0533..98f86e58cd605cc57f8aa951edc40e9dbbfb6826 100644 (file)
@@ -25,7 +25,7 @@
 // THE SOFTWARE.
 
 using System;
-using Cairo;
+using Crow.Cairo;
 using System.Xml.Serialization;
 using System.ComponentModel;
 using System.Diagnostics;
index 3736f968c61629f1881c3cd790d8be8870067fcc..f597f5d7afe0a13c9a05a1249e0a4b11d441e9f3 100644 (file)
@@ -28,7 +28,7 @@ using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Diagnostics;
-using Cairo;
+using Crow.Cairo;
 using System.Text.RegularExpressions;
 using System.Xml.Serialization;
 using System.ComponentModel;
index 8b1650e5f2bfbaf5bf0e6ce068d4d005bb5430bd..1225cbb385a6235993e6b42888c0e1e59e3ab438 100644 (file)
@@ -27,7 +27,7 @@
 using System;
 using System.Xml.Serialization;
 using System.ComponentModel;
-using Cairo;
+using Crow.Cairo;
 
 namespace Crow
 {
index afaead9b452850bdee25208a39e6c96faae185ce..20fadadce0cdffaebc5b03d97c04eff2b4eb123b 100644 (file)
@@ -28,7 +28,7 @@ using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
-using Cairo;
+using Crow.Cairo;
 using System.Diagnostics;
 using System.Xml.Serialization;
 using System.ComponentModel;
index 5a25d6a22f21b145698a572529f46ba78a99940f..535a90df198884774737e0ba1e09c04d921fd161 100644 (file)
@@ -25,7 +25,7 @@
 // THE SOFTWARE.
 
 using System;
-using Cairo;
+using Crow.Cairo;
 using System.Xml.Serialization;
 
 namespace Crow
index e9d14711d08a177ee880c2af5d55bfb33303ba6d..a234a3e43e69101718b628d7a7173fedb4c239b3 100644 (file)
@@ -28,7 +28,7 @@ using System;
 using System.Xml.Serialization;
 using System.ComponentModel;
 using System.Diagnostics;
-using Cairo;
+using Crow.Cairo;
 
 namespace Crow
 {
index 0f694236f6022f514df9efcb974f3609b136848d..12804899dfc7baed69b784ca5789716ea3c0954d 100644 (file)
@@ -28,7 +28,7 @@ using System;
 using System.Xml.Serialization;
 using System.ComponentModel;
 using System.Collections;
-using Cairo;
+using Crow.Cairo;
 
 
 namespace Crow
index ea0409b121a4fb05f27141461a2093e87af2e0c7..99678556afc66a9d73f7246f7de285072c65e9a1 100644 (file)
@@ -28,7 +28,7 @@ using System.Xml.Serialization;
 using System.ComponentModel;
 using System.IO;
 using System.Text;
-using Cairo;
+using Crow.Cairo;
 
 namespace Crow
 {
index 2db34f922861ef2212f18a6abbe756584c4eea45..bd46b051637ffdd40cbf45231ed14557b3117f33 100644 (file)
@@ -25,7 +25,7 @@
 // THE SOFTWARE.
 
 using System;
-using Cairo;
+using Crow.Cairo;
 using System.Xml.Serialization;
 using System.ComponentModel;
 using System.Diagnostics;
index 4d9847c751ab2c38e2a3e8a3960d4585bf2441b2..113a43997ad8879d515e38409f41aaa299d3581b 100644 (file)
@@ -28,7 +28,7 @@ using System;
 using System.Xml.Serialization;
 using System.ComponentModel;
 using System.Diagnostics;
-using Cairo;
+using Crow.Cairo;
 using System.Linq;
 
 namespace Crow
index 655732f166b5b9e1edc8407b93555c7917abd884..550d60aa3ffaae6cf36edc6fbea453ff288aa6d6 100644 (file)
@@ -27,7 +27,7 @@
 using System;
 using System.Xml.Serialization;
 using System.ComponentModel;
-using Cairo;
+using Crow.Cairo;
 using System.Diagnostics;
 using System.Linq;
 
index 2e36eac6bc624e70f4c0fa43967f19e350cc6d05..d93cf4c8b64d3b6125248377349e8595c1a9976c 100644 (file)
@@ -29,7 +29,7 @@ using System.ComponentModel;
 using System.IO;
 using System.Xml;
 using System.Reflection;
-using Cairo;
+using Crow.Cairo;
 
 namespace Crow
 {
index 8b9e15b8675e77fa47993f07cdef38b1380de277..cb57a72149fc2ad0d723effe07c85f0a70a076a6 100644 (file)
 // THE SOFTWARE.
 
 using System;
-using System.Xml.Serialization;
-using System.Xml;
-using System.Reflection;
+using System.Collections;
 using System.Collections.Generic;
 using System.ComponentModel;
-using System.Collections;
-using System.Threading;
 using System.Linq;
 using Crow.IML;
-using System.Diagnostics;
-using System.IO;
 
-namespace Crow
-{
+namespace Crow {
        public abstract class TemplatedGroup : TemplatedControl
        {
                #if DESIGN_MODE
@@ -72,7 +65,7 @@ namespace Crow
                public event EventHandler Loaded;
                #endregion
 
-               IList data;
+               IEnumerable data;
                int _selectedIndex = -1;
                Color selBackground, selForeground;
 
@@ -172,7 +165,7 @@ namespace Crow
                        }
                }
                [XmlIgnore]public virtual object SelectedItem{
-                       get { return data == null ? null : _selectedIndex < 0 ? data.GetDefaultValue() : data[_selectedIndex]; }
+                       get { return data == null ? null : _selectedIndex < 0 ? data.GetDefaultValue() : ((IList)data)?[_selectedIndex]; }
                        set {
                                if (data == null) {
                                        SelectedIndex = -1;
@@ -182,13 +175,13 @@ namespace Crow
                                if (value == SelectedItem)
                                        return;
                                
-                               SelectedIndex = data.IndexOf (value);
+                               SelectedIndex = (int)((IList)data)?.IndexOf (value);
                        }
                }
                [XmlIgnore]public bool HasItems {
                        get { return Items.Count > 0; }
                }
-               public IList Data {
+               public IEnumerable Data {
                        get { return data; }
                        set {
                                if (value == data)
@@ -362,7 +355,7 @@ namespace Crow
                        if (loadingThread != null)
                                loadingThread.Cancel ();
                }
-               void loadPage(IList _data, Group page, string _dataTest)
+               void loadPage(IEnumerable _data, Group page, string _dataTest)
                {
                        #if DEBUG_LOAD
                        Stopwatch loadingTime = Stopwatch.StartNew ();
@@ -374,26 +367,27 @@ namespace Crow
 //                             typeof(Wrapper).IsAssignableFrom (items.GetType ())) {
                                //page = items;
                                itemPerPage = int.MaxValue;
-//                     } else if (typeof(GenericStack).IsAssignableFrom (items.GetType ())) {
-//                             GenericStack gs = new GenericStack (items.CurrentInterface);
-//                             gs.Orientation = (items as GenericStack).Orientation;
-//                             gs.Width = items.Width;
-//                             gs.Height = items.Height;
-//                             gs.VerticalAlignment = items.VerticalAlignment;
-//                             gs.HorizontalAlignment = items.HorizontalAlignment;
-//                             page = gs;
-//                             page.Name = "page" + pageNum;
-//                             isPaged = true;
-//                     } else {
-//                             page = Activator.CreateInstance (items.GetType ()) as Group;
-//                             page.CurrentInterface = items.CurrentInterface;
-//                             page.Initialize ();
-//                             page.Name = "page" + pageNum;
-//                             isPaged = true;
-//                     }
-
-                       for (int i = 0; i < _data.Count; i++) {                         
-                               loadItem (_data[i], page, _dataTest);
+                       //                      } else if (typeof(GenericStack).IsAssignableFrom (items.GetType ())) {
+                       //                              GenericStack gs = new GenericStack (items.CurrentInterface);
+                       //                              gs.Orientation = (items as GenericStack).Orientation;
+                       //                              gs.Width = items.Width;
+                       //                              gs.Height = items.Height;
+                       //                              gs.VerticalAlignment = items.VerticalAlignment;
+                       //                              gs.HorizontalAlignment = items.HorizontalAlignment;
+                       //                              page = gs;
+                       //                              page.Name = "page" + pageNum;
+                       //                              isPaged = true;
+                       //                      } else {
+                       //                              page = Activator.CreateInstance (items.GetType ()) as Group;
+                       //                              page.CurrentInterface = items.CurrentInterface;
+                       //                              page.Initialize ();
+                       //                              page.Name = "page" + pageNum;
+                       //                              isPaged = true;
+                       //                      }
+
+
+                       foreach (object d in _data) {
+                               loadItem (d, page, _dataTest);
                                if (loadingThread.cancelRequested)
                                        break;
                        }
@@ -461,22 +455,27 @@ namespace Crow
                        if (iTemp.Expand != null && g is Expandable) {
                                Expandable e = g as Expandable;
                                e.Expand += iTemp.Expand;
-                               e.GetIsExpandable = iTemp.HasSubItems;
+                               if ((o as ICollection) == null)
+                                       e.GetIsExpandable = new BooleanTestOnInstance((instance) => true);
+                               else
+                                       e.GetIsExpandable = iTemp.HasSubItems;
                        }
 
                        g.DataSource = o;
                }
-//             protected void _list_LayoutChanged (object sender, LayoutingEventArgs e)
-//             {
-//                     #if DEBUG_LAYOUTING
-//                     Debug.WriteLine("list_LayoutChanged");
-//                     #endif
-//                     if (_gsList.Orientation == Orientation.Horizontal) {
-//                             if (e.LayoutType == LayoutingType.Width)
-//                                     _gsList.Width = approxSize;
-//                     } else if (e.LayoutType == LayoutingType.Height)
-//                             _gsList.Height = approxSize;
-//             }
+
+
+               //              protected void _list_LayoutChanged (object sender, LayoutingEventArgs e)
+               //              {
+               //                      #if DEBUG_LAYOUTING
+               //                      Debug.WriteLine("list_LayoutChanged");
+               //                      #endif
+               //                      if (_gsList.Orientation == Orientation.Horizontal) {
+               //                              if (e.LayoutType == LayoutingType.Width)
+               //                                      _gsList.Width = approxSize;
+               //                      } else if (e.LayoutType == LayoutingType.Height)
+               //                              _gsList.Height = approxSize;
+               //              }
                int approxSize
                {
                        get {
@@ -487,16 +486,16 @@ namespace Crow
                                        return -1;
 
                                return page1.Orientation == Orientation.Horizontal ?
-                                       data.Count < itemPerPage ?
+                                       (data as ICollection)?.Count < itemPerPage ?
                                        -1:
-                                       (int)Math.Ceiling ((double)page1.Slot.Width / (double)itemPerPage * (double)(data.Count+1)):
-                                       data.Count < itemPerPage ?
+                                       (int)Math.Ceiling ((double)page1.Slot.Width / (double)itemPerPage * (double)((data as ICollection)?.Count+1)):
+                                       (data as ICollection)?.Count < itemPerPage ?
                                        -1:
-                                       (int)Math.Ceiling ((double)page1.Slot.Height / (double)itemPerPage * (double)(data.Count+1));
+                                       (int)Math.Ceiling ((double)page1.Slot.Height / (double)itemPerPage * (double)((data as ICollection)?.Count+1));
                        }
                }
                internal virtual void itemClick(object sender, MouseButtonEventArgs e){
-                       SelectedIndex = data.IndexOf((sender as Widget).DataSource);
+                       SelectedIndex = (int)((IList)data)?.IndexOf((sender as Widget).DataSource);
                }
 
                bool emitHelperIsAlreadyExpanded (Widget go){
index cd15adc5b4bd0e5a6b64a61ddd6a6bcbef10b2a8..dcfb584c7fb5b0fb073ba1bf2b11296362a1e0e1 100644 (file)
@@ -24,7 +24,7 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 using System;
-using Cairo;
+using Crow.Cairo;
 
 namespace Crow
 {
index 500a0a1a45099f9e99d5d4411d6fd7798980afeb..71fd62053cd6e1ef436ea8982e92c261c983cb01 100644 (file)
@@ -25,7 +25,7 @@
 // THE SOFTWARE.
 
 using System;
-using Cairo;
+using Crow.Cairo;
 using System.Diagnostics;
 using System.Xml.Serialization;
 
index 6550411e6ed94bf2b5e5012aeff52eb9b28b28f7..f784f90e63cc1a64434a0b12bfc8bc00a6aab08b 100644 (file)
@@ -29,7 +29,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Diagnostics;
-using Cairo;
+using Crow.Cairo;
 using System.Text.RegularExpressions;
 using System.Xml.Serialization;
 using System.ComponentModel;
index 8fcd8830975994c5989a2a9e11e78cc23560cd35..b62fd2f2bd976c5e9a22c2bb9e03201df80985d8 100644 (file)
@@ -28,7 +28,7 @@ using System;
 using System.Collections.Generic;
 using System.Xml.Serialization;
 using System.ComponentModel;
-using Cairo;
+using Crow.Cairo;
 
 namespace Crow
 {
index d2314138a08285b9173bcc5dcc06ab8079dc6a9f..d85ddfaac4f09b570a14f9ee3aed4db54159b156 100644 (file)
@@ -31,7 +31,7 @@ using System.Xml.Serialization;
 using System.Reflection;
 using System.Reflection.Emit;
 using System.Runtime.CompilerServices;
-using Cairo;
+using Crow.Cairo;
 using System.Diagnostics;
 using Crow.IML;
 using System.Threading;
@@ -1007,7 +1007,7 @@ namespace Crow
                                #if DEBUG_LOG
                                DbgEvent dbgEvt = DebugLog.AddEvent(DbgEvtType.GOLockLayouting, this);
                                #endif
-                               lock (IFace.LayoutMutex) {
+                               lock (IFace.UpdateMutex) {
                                        OnDataSourceChanged (this, dse);
                                        NotifyValueChanged ("DataSource", DataSource);
                                }
index 495ca23b5e07351e7d076c5f5a12170bba265546..c4553066acf2599b9863fd6c915dd37834ea82de 100644 (file)
@@ -32,7 +32,7 @@ using System.IO;
 using System.Linq;
 using System.Reflection;
 using System.Threading;
-using Cairo;
+using Crow.Cairo;
 using Crow.IML;
 
 
@@ -62,37 +62,39 @@ namespace Crow
        /// The resulting surface (a byte array in the OpenTK renderer) is made available and protected with the
        /// RenderMutex of the interface.
        /// </remarks>
-       public class Interface : ILayoutable, IDisposable ,IValueChange
+       public class Interface : ILayoutable, IDisposableIValueChange
        {
                #region IValueChange implementation
                public event EventHandler<ValueChangeEventArgs> ValueChanged;
-               public virtual void NotifyValueChanged(string MemberName, object _value)
+               public virtual void NotifyValueChanged (string MemberName, object _value)
                {
                        //Debug.WriteLine ("Value changed: {0}->{1} = {2}", this, MemberName, _value);
-                       ValueChanged.Raise(this, new ValueChangeEventArgs(MemberName, _value));
+                       ValueChanged.Raise (this, new ValueChangeEventArgs (MemberName, _value));
                }
                #endregion
 
-               internal IBackend backend;
+               protected IBackend backend;
+               protected bool running;
+
 
                #region CTOR
-               static Interface(){
+               static Interface () {
                        /*if (Type.GetType ("Mono.Runtime") == null) {
                                throw new Exception (@"C.R.O.W. run only on Mono, download latest version at: http://www.mono-project.com/download/stable/");
                        }*/
 
                        CROW_CONFIG_ROOT =
-                               System.IO.Path.Combine(
-                                       Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
+                               System.IO.Path.Combine (
+                                       Environment.GetFolderPath (Environment.SpecialFolder.UserProfile),
                                        ".config");
                        CROW_CONFIG_ROOT = System.IO.Path.Combine (CROW_CONFIG_ROOT, "crow");
                        if (!Directory.Exists (CROW_CONFIG_ROOT))
                                Directory.CreateDirectory (CROW_CONFIG_ROOT);
 
                        //ensure all assemblies are loaded, because IML could contains classes not instanciated in source
-                       foreach (string af in Directory.GetFiles (AppDomain.CurrentDomain.BaseDirectory, "*.dll")){
+                       foreach (string af in Directory.GetFiles (AppDomain.CurrentDomain.BaseDirectory, "*.dll")) {
                                try {
-                                       Assembly.LoadFrom (af); 
+                                       Assembly.LoadFrom (af);
                                } catch (Exception ex) {
                                        Console.WriteLine ("{0} not loaded as assembly.", af);
                                }
@@ -105,54 +107,70 @@ namespace Crow
                        FontRenderingOptions.SubpixelOrder = SubpixelOrder.Default;
                }
 
-               public Interface(int width=800, int height=600){
-
+               public Interface(int width=800, int height=600, IBackend _backend = null){
+                       CultureInfo.DefaultThreadCurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
+                       CurrentInterface = this;
                        clientRectangle = new Rectangle (0, 0, width, height);
+                       backend = _backend;
 
-                       Init ();
-
-                       InitBackend ();
+                       Thread t = new Thread (InterfaceThread) {
+                               IsBackground = true
+                       };
+                       t.Start ();
+#if MEASURE_TIME
+                       PerfMeasures.Add (updateMeasure);
+                       PerfMeasures.Add (drawingMeasure);
+                       PerfMeasures.Add (layoutingMeasure);
+                       PerfMeasures.Add (clippingMeasure);
+#endif
                }
                #endregion
 
-               protected bool running;
-               protected virtual void InitBackend () {
-            if (Environment.OSVersion.Platform == PlatformID.Unix)
-                backend = new Crow.XCB.XCBBackend();
-                               //backend = new Crow.XLib.XLibBackend ();
-            else
-                backend = new Crow.Win32.Win32Backend();
-                
+               public virtual void InterfaceThread ()
+               {
+                       if (backend == null) {
+                               if (Environment.OSVersion.Platform == PlatformID.Unix)
+                                       backend = new XCB.XCBBackend ();
+                               else
+                                       backend = new Win32.Win32Backend ();
+                       }
+
                        backend.Init (this);
 
+                       while (!running)
+                               Thread.Sleep (2);
+
+                       while (running) {
+                               Update ();
+                               Thread.Sleep (5);
+                       }
+               }
+               protected virtual void Startup ()
+               {
+                       try {
+                               Load ("#main.crow").DataSource = this;
+                       } catch { }
+               }
+               public virtual void Run () {
+                       loadStyling ();
+
                        initTooltip ();
                        initContextMenus ();
 
                        running = true;
 
-                       Thread t = new Thread (interfaceThread);
-                       t.IsBackground = true;
-                       t.Start ();
-               }
-               public void Run () {
                        Startup ();
+
                        while (running) {
                                ProcessEvents ();
                                Thread.Sleep(1);
                        }
                }
-               protected virtual void Startup ()
-               {
-                       //load default main.crow if present
-                       try {
-                               Load ("#main.crow").DataSource = this;
-                       } catch { }
-               }
+
                public void ProcessKeyPress (char c)
                {
                        _focusedWidget?.onKeyPress (_focusedWidget, new KeyPressEventArgs(c));
                }
-
                public void ProcessKeyUp (Key key)
                {
                        _focusedWidget?.onKeyUp (_focusedWidget, new KeyEventArgs(key, false));
@@ -173,26 +191,16 @@ namespace Crow
                        //                      keyboardRepeatThread.IsBackground = true;
                        //                      keyboardRepeatThread.Start ();
                }
-
                public bool Shift {
                        get { return backend.Shift; }
                }
-
                public bool Ctrl {
                        get { return backend.Ctrl; }
                }
-
                public bool Alt {
                        get { return backend.Alt; }
                }
 
-               void interfaceThread()
-               {                       
-                       while (running) {
-                               Update ();
-                               Thread.Sleep (5);
-                       }
-               }
 
                #region IDisposable Support
                private bool disposedValue = false; // To detect redundant calls
@@ -254,24 +262,10 @@ namespace Crow
                                        FocusedWidget = w;
                                        break;
                                }
-                               w = w.LogicalParent as Widget;
+                               w = w.FocusParent;
                        }
 
                }
-               public void Init () {
-                       CultureInfo.DefaultThreadCurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
-
-                       CurrentInterface = this;
-                       //loadCursors ();
-                       loadStyling ();
-
-                       #if MEASURE_TIME
-                       PerfMeasures.Add (updateMeasure);
-                       PerfMeasures.Add (drawingMeasure);
-                       PerfMeasures.Add (layoutingMeasure);
-                       PerfMeasures.Add (clippingMeasure);
-                       #endif
-               }
 
                #region Static and constants
                /// <summary>
@@ -454,10 +448,10 @@ namespace Crow
                                if (s == null)
                                        s = Assembly.GetAssembly (declaringType).GetManifestResourceStream (resId);
                                if (s == null)
-                                       throw new Exception ($"Template not found '{path}'");
+                                       throw new Exception ($"Template ressource not found '{path}'");
                        } else {
                                if (!File.Exists (path))
-                                       throw new FileNotFoundException ("Template not found: ", path);
+                                       throw new FileNotFoundException ($"Template not found: {path}", path);
                                s = new FileStream (path, FileMode.Open, FileAccess.Read);
                        }
                        return s;
@@ -481,7 +475,7 @@ namespace Crow
                                        throw new Exception ("Resource not found: " + path);
                        } else {
                                if (!File.Exists (path))
-                                       throw new FileNotFoundException ("File not found: ", path);
+                                       throw new FileNotFoundException ($"File not found: {path}", path);
                                stream = new FileStream (path, FileMode.Open, FileAccess.Read);
                        }
                        return stream;
@@ -504,7 +498,7 @@ namespace Crow
                                        throw new Exception ("Resource not found: " + path);
                        } else {
                                if (!File.Exists (path))
-                                       throw new FileNotFoundException ("File not found: ", path);
+                                       throw new FileNotFoundException ($"File not found: {path}", path);
                                stream = new FileStream (path, FileMode.Open, FileAccess.Read);
                        }
                        return stream;
@@ -700,7 +694,7 @@ namespace Crow
                ///     - Drawing
                /// Result: the Interface bitmap is drawn in memory (byte[] bmp) and a dirtyRect and bitmap are available
                /// </summary>
-               public void Update(){
+               public void Update(Context ctx = null){
                        CrowThread[] tmpThreads;
                        lock (CrowThreads) {
                                tmpThreads = new CrowThread[CrowThreads.Count];
@@ -734,11 +728,16 @@ namespace Crow
 
                        clippingRegistration ();
 
-                       processDrawing ();
+                       if (ctx == null) {
+                               using (ctx = new Context (surf)) {
+                                       processDrawing (ctx);
+                               }
+                       }else
+                               processDrawing (ctx);
 
-                       #if MEASURE_TIME
+#if MEASURE_TIME
                        updateMeasure.StopCycle();
-                       #endif
+#endif
 
                        Monitor.Exit (UpdateMutex);
                }
@@ -800,7 +799,7 @@ namespace Crow
                }
                /// <summary>Clipping Rectangles drive the drawing process. For compositing, each object under a clip rectangle should be
                /// repainted. If it contains also clip rectangles, its cache will be update, or if not cached a full redraw will take place</summary>
-               void processDrawing(){
+               void processDrawing(Context ctx){
                        #if MEASURE_TIME
                        drawingMeasure.StartCycle();
                        #endif
@@ -811,7 +810,6 @@ namespace Crow
                        if (DragImage != null)
                                clipping.UnionRectangle(new Rectangle (DragImageX, DragImageY, DragImageWidth, DragImageHeight));
                        //using (surf = new ImageSurface (bmp, Format.Argb32, ClientRectangle.Width, ClientRectangle.Height, ClientRectangle.Width * 4)) {
-                       using (ctx = new Context (surf)){
                                if (!clipping.IsEmpty) {
                                        IsDirty = true;
 
@@ -872,7 +870,7 @@ namespace Crow
 
                                        backend?.Flush ();
                                }
-                       }
+                       
                        /*#if DEBUG_LOG
                        DebugLog.AddEvent (DbgEvtType.IFaceEndDrawing);
                        #endif*/
@@ -1002,11 +1000,7 @@ namespace Crow
 
                                /*surf.Dispose ();
                                surf = new Cairo.XlibSurface (xHandle, xwinHnd, xDefaultVisual, clientRectangle.Width, clientRectangle.Height);*/
-                               if (surf is XlibSurface)
-                                       (surf as XlibSurface).SetSize (clientRectangle.Width, clientRectangle.Height);
-                               else if (surf is XcbSurface)
-                                       (surf as XcbSurface).SetSize (clientRectangle.Width, clientRectangle.Height);
-
+                               surf.SetSize (clientRectangle.Width, clientRectangle.Height);
 
                                foreach (Widget g in GraphicTree)
                                        g.RegisterForLayouting (LayoutingType.All);
index 30c71c0fc7643af3953b17cb54d30281aa3ad8fe..64da6443314f6580a5c479f51e4458e082624628 100644 (file)
@@ -30,7 +30,7 @@
 
 using System;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        
        public enum Antialias
index c0a5f2ab0af9771219b031717ef44fcbcfd3ecfe..c32c00d83f4e230ab2025eaf176576f601b48916 100644 (file)
@@ -1,4 +1,4 @@
-//
+//
 // Cairo.cs - a simplistic binding of the Cairo API to C#.
 //
 // Authors: Duncan Mak (duncan@ximian.com)
@@ -34,7 +34,7 @@
 using System;
 using System.Runtime.InteropServices;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        public static class CairoAPI {
                static public int Version {
index d694bbb545112665c1c988b8afbacd4c46bfe1be..faff93386b1db4a8720acd294b814b58f66778a8 100644 (file)
@@ -28,7 +28,7 @@
 
 using System;
 
-namespace Cairo {
+namespace Crow.Cairo {
 
        static class CairoDebug
        {
index a45370ff1b2b1a54e379b79e946fb9194a1b4496..f14305a49026304e0067c36a946e14e75b766314 100644 (file)
@@ -30,7 +30,7 @@
 
 using System;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        //[Flags]
        
index d428b42cc47c8cd5691a3602fa3f5515a6507125..3259294ff031826a1a6d64fe054347b2f3d2056a 100644 (file)
@@ -1,4 +1,4 @@
-//
+//
 // Mono.Cairo.Context.cs
 //
 // Author:
@@ -39,7 +39,7 @@ using System.Runtime.InteropServices;
 using System.Text;
 using Color = Crow.Color;
 
-namespace Cairo {      
+namespace Crow.Cairo { 
 
        [Obsolete ("Renamed Cairo.Context per suggestion from cairo binding guidelines.")]
        public class Graphics : Context {
index a03195fbfc7ea2503e54c37dacfd5963e6433047..05e142cbcddcf557907bbd3c27af5a50154cbec6 100644 (file)
@@ -29,7 +29,7 @@
 //
 using System;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        public class DRMDevice : Device
        {
index 248541c70e037d1c356c47173b53e1fcf69ff500..f624967facd71a3cdb2b2fbf6e26ebdc6805266c 100644 (file)
@@ -30,7 +30,7 @@
 
 using System;
 
-namespace Cairo {
+namespace Crow.Cairo {
 
        public class DRMSurface : Surface
        {
index a5452f9d660b3061de158120ef5cee5ebf6e85c0..dc9910cbde3f66e6ee71ad6b5ed2f3db94b5e2f5 100644 (file)
@@ -29,7 +29,7 @@
 //
 using System;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        public class Device : IDisposable
        {
index afa57b7dff1f4b210e4d353c3227b28569dda0ef..64431574854e3996cbd4f24858345663292db2ff 100644 (file)
@@ -28,7 +28,7 @@
 
 using System;
 
-namespace Cairo {
+namespace Crow.Cairo {
        public class DirectFBSurface : Surface
        {
                internal DirectFBSurface (IntPtr handle, bool owns) : base (handle, owns)
index 7cba3729ceae93fbcf228d46a307b9ae3adcbe70..d716ab1f87148872d23f3087222f687b20aa3c61 100644 (file)
@@ -34,7 +34,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-namespace Cairo {
+namespace Crow.Cairo {
 
        public struct Distance
        {
index 45c988a3849fc34bb10da9296761417306276820..44590c70932f735f6fd8c80762d680ee795e748f 100644 (file)
@@ -29,7 +29,7 @@
 //
 using System;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        public class EGLDevice : Device
        {
index 1135c2ff3c917b84d3bab835a179e4b91e6fff48..4af536dce6a14f599edfdf2bf8e262169e397355 100644 (file)
@@ -32,7 +32,7 @@
 
 using System;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        
        public enum Extend
index 24cbfba2b4065da8ca1916fedc8124497c9db00f..80f61ed5d7f67836d868991a2e386e68029a97d5 100644 (file)
@@ -30,7 +30,7 @@
 
 using System;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        
        public enum FillRule
index 2355fbb313b51030986e07d7c736a27a119640a2..a73ea58df6666c980e7a1e933c0a00e6e4a5f9b3 100644 (file)
@@ -30,7 +30,7 @@
 
 using System;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        
        public enum Filter
index 76c7e658d5d24a9a2f17c6de588b37a09e89239a..ea26d9bb8d3f518cb5f4fdcfbeefa049a0cf3d87 100644 (file)
@@ -34,7 +34,7 @@
 using System;
 using System.Runtime.InteropServices;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        [StructLayout (LayoutKind.Sequential)]
        public struct FontExtents
index 19d8163c35fea4f0f8b9d17db74b6158d01a2f21..64c428e2739167b8fea92d0a7fae916c0f001d90 100644 (file)
@@ -32,7 +32,7 @@
 //
 using System;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        public class FontFace : IDisposable
        {
index 5269d54dfac2ca504e8a29cf3c883292292fed00..f90a3a4d792e98d83bb7e22c0261db485f681bb6 100644 (file)
@@ -28,7 +28,7 @@
 
 using System;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        public class FontOptions : IDisposable
        {
index b7a5684cddfdca3e944e28d48738f2ecd9745dc3..b3d8a1a201309d677a7d4ac819cb7df7a74b7fa9 100644 (file)
@@ -30,7 +30,7 @@
 
 using System;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        
        public enum FontSlant
index e9fd263a4fc505d826e48b112e34d543238c7b4d..5db44d4eec4683f7415989e0d4b0bbc6c2da15b5 100644 (file)
@@ -28,7 +28,7 @@
 
 using System;
 
-namespace Cairo {
+namespace Crow.Cairo {
 
        
        public enum FontType
index 5b7810957ab5898f5bddc96f3ea46627615470f1..0b8fc6a80842d789f143e0fdc4a20a3205172482 100644 (file)
@@ -30,7 +30,7 @@
 
 using System;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        
        public enum FontWeight
index 96e9a0f577f47fe5371530014d5e405287a23769..54c8be1e4dedfec7c6cb89114ade2e8089f04254 100644 (file)
@@ -29,7 +29,7 @@
 
 using System;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        
        public enum Format
index 9486c9cd13cd5975f37b79c802b5d3fef153843a..60384b0201e916b17d469b2a18e4a416d3bfb93c 100644 (file)
@@ -1,4 +1,4 @@
-//
+//
 // Mono.Cairo.GLSurface.cs
 //
 // Authors:
@@ -30,7 +30,7 @@
 
 using System;
 
-namespace Cairo {
+namespace Crow.Cairo {
 
        public class GLSurface : Surface
        {
index 189872a26ba379cf11d12990e76563b7e9a5a405..00cbce1feefc7a9eabb3aa5252509e6a98c179de 100644 (file)
@@ -29,7 +29,7 @@
 //
 using System;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        public class GLXDevice : Device
        {
index 6da1ac6a934e78424b20d4f1fadf55eb6b6c59df..4aa249830a6f6b579249abc293c1e1283057fb63 100644 (file)
@@ -28,7 +28,7 @@
 
 using System;
 
-namespace Cairo {
+namespace Crow.Cairo {
        public class GlitzSurface : Surface
        {
                internal GlitzSurface (IntPtr handle, bool owns) : base (handle, owns)
index ec9c2ff38a6707c3dfedcd7bf9b163704fe12d7e..ad5115621dbbcba0a67737cbcb359aee7523df27 100644 (file)
@@ -30,7 +30,7 @@
 using System;
 using System.Runtime.InteropServices;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        [StructLayout(LayoutKind.Sequential)]
        public struct Glyph
index c7bc53c6f958e2bbf691e335506e7b6bdad18e08..427cc053beea2dc766bc0109fbb8ab87283f3b4d 100644 (file)
@@ -29,7 +29,7 @@
 
 using System;
 using Color = Crow.Color;
-namespace Cairo {
+namespace Crow.Cairo {
 
        public class Gradient : Pattern
        {
index 3bf01d23da661380150b998a09a60b09dfe76d83..d830f3ebdfd0213d17320c3bee762800050b632c 100644 (file)
@@ -29,7 +29,7 @@
 
 using System;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        
        public enum HintMetrics
index b8cca97469a673c0a72030c08f20a3bdf85b9f85..343daf3e0bfbd516ecef77555fc9718ce19f5d2d 100644 (file)
@@ -29,7 +29,7 @@
 
 using System;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        
        public enum HintStyle
index 98143fe8e22543efeda94ddba4631f6ea29b1efd..1dd8329644e740f9f10c615d222fea2610373361 100644 (file)
@@ -1,4 +1,4 @@
-//
+//
 // Mono.Cairo.ImageSurface.cs
 //
 // Authors:
@@ -35,7 +35,7 @@
 using System;
 using System.Runtime.InteropServices;
 
-namespace Cairo {
+namespace Crow.Cairo {
 
        public class ImageSurface : Surface
        {
index 46938c25bf4020d9bd746f28b5c6a2d19ffbbb8e..1560cda4c93a76f7eb5bccdba1bc0eb5c6225790 100644 (file)
@@ -29,7 +29,7 @@
 
 using System;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        
        public enum LineCap
index b5c241b0b1fe42fa615eaeccee6c24374145690b..1d5389b56eb8293337634b94e6c52a6d41b3048c 100644 (file)
@@ -29,7 +29,7 @@
 
 using System;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        
        public enum LineJoin
index 85fdea84a2c53c4252576db7c424c7532b6d3d54..100d1e6d0da3acad7ecade98508e0449acdbb760 100644 (file)
@@ -29,7 +29,7 @@
 
 using System;
 
-namespace Cairo {
+namespace Crow.Cairo {
 
        public class LinearGradient : Gradient
        {
index 12f0cb92977217f0862544dcc8bd2c14ae2c28ba..7d5a6acd85945d71b970ea28fff9c9a0a48655d4 100644 (file)
@@ -1,4 +1,4 @@
-//
+//
 // Mono.Cairo.Matrix.cs
 //
 // Author: Duncan Mak
@@ -34,7 +34,7 @@
 using System;
 using System.Runtime.InteropServices;
 
-namespace Cairo {
+namespace Crow.Cairo {
 
        [StructLayout(LayoutKind.Sequential)]
        public class Matrix //: ICloneable
index b14c709bbb6134bdbc0b036a1f2cbc2a698a0562..96bc3c858caf594f862889f60e3a4bc11a786800 100644 (file)
@@ -29,7 +29,7 @@
 
 using System;
 
-namespace Cairo {
+namespace Crow.Cairo {
 
        public class MeshPattern : Pattern
        {
index 8ed90290cf9ceab521ffc61f0269c6065cb50e9a..1b423209bba5dc8e0fa847ad2d83448c20145c40 100644 (file)
@@ -1,4 +1,4 @@
-//
+//
 // Cairo.cs - a simplistic binding of the Cairo API to C#.
 //
 // Authors: Duncan Mak (duncan@ximian.com)
@@ -34,7 +34,7 @@
 using System;
 using System.Runtime.InteropServices;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        // sort the functions like in the following page so it is easier to find what is missing
        // http://cairographics.org/manual/index-all.html
index f233a25f195af292e5fccbb52f3678cc8c47b5ce..1c11cccc3fc456121929537f157f82ece92a22e8 100644 (file)
@@ -31,7 +31,7 @@
 
 using System;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        
        public enum Operator
index 9d6b73be68996272d7251ab88e8189288070bf56..cf90794e68e71f47fdd5d87ebe536a1c38c39dec 100644 (file)
@@ -28,7 +28,7 @@
 
 using System;
 
-namespace Cairo {
+namespace Crow.Cairo {
 
        public class PSSurface : Surface
        {
index 184c606cf3470b851e09c0c51de29ea8f7972d95..a55f03b073c5d189286755dc6c79a6fe4c11a9e1 100644 (file)
@@ -30,9 +30,9 @@
 
 using System;
 using System.Runtime.InteropServices;
-using Cairo;
+using Crow.Cairo;
 
-namespace Cairo {
+namespace Crow.Cairo {
 
        public class Path : IDisposable
        {
index bc0a962a218d59d5ff42a45289a56e7c2f5c8f40..3e933a19c0bddfc7745b1c8d021bd31e66018aa2 100644 (file)
@@ -30,7 +30,7 @@
 using System;
 using System.Collections;
 
-namespace Cairo {
+namespace Crow.Cairo {
    
        public class Pattern : IDisposable
        {
index f9b9523a0ab07ab351fd6e86f4978f083573a161..deac3ab7b707e1af58796b035c409ab6c5677442 100644 (file)
@@ -28,7 +28,7 @@
 
 using System;
 
-namespace Cairo {
+namespace Crow.Cairo {
 
        
        public enum PatternType
index c980f249ed06ae2626cb83c9e565498d11b82fbc..09a2d12688c6698e9b3b367e8cb027770763012e 100644 (file)
@@ -28,7 +28,7 @@
 
 using System;
 
-namespace Cairo {
+namespace Crow.Cairo {
 
        public class PdfSurface : Surface
        {
index e72ca6c529ce690000e7b403b0bfeccfaaf108df..cf07f31185fc8e4022f0b6a8c0c12ba632260f81 100644 (file)
@@ -34,7 +34,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-namespace Cairo {
+namespace Crow.Cairo {
        public struct Point
        {
                public Point (int x, int y)
index c2e3587d1f78ff10c394a54fab5881e692c9500d..8bc019c9f5d7c3f7070ef891e0fd132c3bd0b846 100644 (file)
@@ -34,7 +34,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-namespace Cairo {
+namespace Crow.Cairo {
 
        public struct PointD
        {
index 6422e00d6e4e778219c400072ba8cf5136353185..6abe2671f6098f68a0ca101ee33c9e19b74a5cdd 100644 (file)
@@ -29,7 +29,7 @@
 
 using System;
 
-namespace Cairo {
+namespace Crow.Cairo {
 
        public class RadialGradient : Gradient
        {
index 4a82842ae5c05743f13c7fca1029cd5539dda311..5e8d8d607e75bdc431ee6c5d536c10a4b6ca6d03 100644 (file)
@@ -23,7 +23,7 @@
 using System;
 using System.Runtime.InteropServices;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        [StructLayout(LayoutKind.Sequential)]
        public struct RectangleList {
index 937194607af414e35fbb5ee6a0b80b02a7949c07..594d1be9dc07f1c5ad5ba5ca4f3be87a3b209b94 100644 (file)
@@ -26,7 +26,7 @@
 using System;
 using System.Runtime.InteropServices;
 
-namespace Cairo {
+namespace Crow.Cairo {
    
        public class ScaledFont : IDisposable
        {
index 37864e5b8f1c40960b7d813c94b39ff969be4c52..6cd89f85328b9e84afb058787639821fd625b036 100644 (file)
@@ -29,7 +29,7 @@
 
 using System;
 using Color = Crow.Color;
-namespace Cairo {
+namespace Crow.Cairo {
 
        public class SolidPattern : Pattern
        {
index 54b2fec3ba829eace2d9579ea5148970f8c86450..2df15580148bfa2d0a5e0c45a2789caf48637bd6 100644 (file)
@@ -32,7 +32,7 @@
 
 using System;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        
        public enum Status
index 3c3a336227ad720d610460f3c8c2ec98313a69c1..95f3cbee00053f9aec17f96dc18cd51f1d05f7b8 100644 (file)
@@ -28,7 +28,7 @@
 
 using System;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        
        public enum SubpixelOrder
index 14f4a2b147852029dc00e4d6543bcb9976015f20..70821435c169dcb2c06e4e117bf38b7b72f48fda 100644 (file)
@@ -1,4 +1,4 @@
-//
+//
 // Mono.Cairo.Surface.cs
 //
 // Authors:
@@ -36,7 +36,7 @@
 using System;
 using System.Collections;
 
-namespace Cairo {
+namespace Crow.Cairo {
 
        public class Surface : IDisposable
        {
index 4422b11d41dc899da6aa8edfa5a31fcd8ca23e55..53a90d384ac06d9da1686bf59eedaf858214b3e6 100644 (file)
@@ -29,7 +29,7 @@
 
 using System;
 
-namespace Cairo {
+namespace Crow.Cairo {
 
        public class SurfacePattern : Pattern
        {
index b0b659c6221fc57c92ffe99bb641a06a980d67a4..bd992db0ccfdfe4f732b489c490ba214a5b8c3e9 100644 (file)
@@ -28,7 +28,7 @@
 
 using System;
 
-namespace Cairo {
+namespace Crow.Cairo {
 
        
        public enum SurfaceType
index 418295011fde1c26a144ab920ab513b634844902..c7d72988065bcdcc5729e27eda7bf9523aca60c6 100644 (file)
@@ -28,7 +28,7 @@
 
 using System;
 
-namespace Cairo {
+namespace Crow.Cairo {
 
        public class SvgSurface : Surface
        {
index 7f0f4620f3a7b5904a51e759e5a03d85fa984d5a..916fb86129542349de201d383218d80d157210d6 100644 (file)
@@ -28,7 +28,7 @@
 
 using System;
 
-namespace Cairo {
+namespace Crow.Cairo {
 
        
        public enum SvgVersion
index f9cd560f39ba7a7dae1c572ee3ee0a58af474b2f..965ca046b2e2b38eb3d362ea447e290ffc0d76b3 100644 (file)
@@ -31,7 +31,7 @@
 using System;
 using System.Runtime.InteropServices;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        [StructLayout (LayoutKind.Sequential)]
        public struct TextExtents
index 03f7e3a49870f3512c436a32afdade600e4424a5..308cfadd055461eef10bd11d9d1222fdb6de00b9 100644 (file)
@@ -29,7 +29,7 @@
 //
 using System;
 
-namespace Cairo
+namespace Crow.Cairo
 {
        public class WGLDevice : Device
        {
index dd244286dff508a90832ea9ac88cd2aaa1afe99c..4776a19bfd1d02f4ebb38c1cd26a3a41bb2d6f6c 100644 (file)
@@ -28,7 +28,7 @@
 
 using System;
 
-namespace Cairo {
+namespace Crow.Cairo {
        
        public class Win32Surface : Surface
        {
index 340b0fae99f391685a5f2b11420c6a7cc05cce95..32a6784823e91e923f2a99ecf307fa1c14123c46 100644 (file)
@@ -28,7 +28,7 @@
 
 using System;
 
-namespace Cairo {
+namespace Crow.Cairo {
        public class XcbSurface : Surface
        {
                internal XcbSurface (IntPtr handle, bool owns) : base (handle, owns)
index c0003a491e61f3afafefcbb4ebbfb025a1052f75..30b56f044426b314f1c4ed98d07fcd45c3d84ad1 100644 (file)
@@ -34,7 +34,7 @@
 
 using System;
 
-namespace Cairo {
+namespace Crow.Cairo {
 
        public class XlibSurface : Surface
        {
@@ -58,7 +58,7 @@ namespace Cairo {
                        NativeMethods.cairo_xlib_surface_set_drawable (Handle, drawable, width, height);
                }
 
-               public void SetSize (int width, int height)
+               public override void SetSize (int width, int height)
                {
                        NativeMethods.cairo_xlib_surface_set_size (Handle, width, height);
                }
index f2f45261874ccdcf93f176fbb9303c8e3f1f526c..133bc4efb834eac7fe5ab892aab88d4aeaad21da 100644 (file)
@@ -26,7 +26,7 @@
 
 using System;
 using System.IO;
-using Cairo;
+using Crow.Cairo;
 using System.Collections.Generic;
 
 namespace Crow
index d6423d318ad8259bd60a026f6dbc03abd66409bc..f14c7cf72ddf2b0346b4dc7da7146626631dcf80 100644 (file)
@@ -31,7 +31,7 @@ using System.Text;
 using System.Xml.Serialization;
 using System.Reflection;
 using System.Diagnostics;
-using Cairo;
+using Crow.Cairo;
 
 
 
index dee6c8e0f2d480ff9a09eaeabd0216891465d1da..33f689559ed2cd63756c63ed9d9cc23288b4af38 100644 (file)
@@ -26,7 +26,7 @@
 
 using System;
 using System.IO;
-using Cairo;
+using Crow.Cairo;
 
 namespace Crow
 {
old mode 100755 (executable)
new mode 100644 (file)
index e0881182b8c827127525ad9b05e36e1a627c2b27..1936704ebf9b602d96cc711affd7bb244eb35bc1 100644 (file)
@@ -24,7 +24,7 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 using System;
-using Cairo;
+using Crow.Cairo;
 using System.Linq;
 
 namespace Crow
index c10cfdf60c2e34eb7caa5254347af2fdec0c2c35..4ff6082e1c098016819af90b6c6218ab7ee179f7 100644 (file)
@@ -27,7 +27,7 @@ using System;
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;
-using Cairo;
+using Crow.Cairo;
 
 #if DEBUG_LOG
 namespace Crow
index 38cbc2afe345a65fd7f7bad3b3c2198c61a72569..f1eaf9c8f1a56118de97811661b6e660ddcfba81 100644 (file)
@@ -24,7 +24,7 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 using System;
-using Cairo;
+using Crow.Cairo;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.IO;
index e13f79ad57f4ae65d5625272f93326b171e97d54..26e7869ca507c84aa8a85a967d9b19e034814b51 100644 (file)
@@ -1,5 +1,5 @@
-//Copyright GPL2
-using Cairo;
+//Copyright GPL2
+using Crow.Cairo;
 
 
 namespace Rsvg {
@@ -108,7 +108,7 @@ namespace Rsvg {
                [DllImport("rsvg-2")]
                static extern void rsvg_handle_render_cairo_sub(IntPtr raw, IntPtr cr, string id);
 
-               public void RenderCairoSub(Cairo.Context cr, string id) {
+               public void RenderCairoSub(Crow.Cairo.Context cr, string id) {
                        rsvg_handle_render_cairo_sub(Raw, cr == null ? IntPtr.Zero : cr.Handle, id);
                }
 
index a03948bbcb376ef7d214fa39882f85376670bdb0..590ca9c852a4b092c781d66a492dbad671d0beab 100644 (file)
@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <Import Project="$(SolutionDir)netfx.props" />
   <PropertyGroup>
-    <TargetFrameworks>net471;netstandard2.0</TargetFrameworks>
+    <TargetFramework>net472</TargetFramework>
     <OutputPath>$(SolutionDir)build\$(Configuration)\</OutputPath>
     <OutputType>Exe</OutputType>        
     <RepositoryUrl>https://github.com/jpbruyere/Crow</RepositoryUrl>
@@ -15,7 +15,7 @@
               
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugType>full</DebugType>
-    <DefineConstants>TRACE;NETSTANDARD2_0;DEBUG;NETCOREAPP2_0</DefineConstants>
+    <DefineConstants>TRACE;DEBUG</DefineConstants>
   </PropertyGroup>
 
   <ItemGroup>
       <LogicalName>Crow.%(Filename).template</LogicalName>
     </EmbeddedResource>
         
-    <EmbeddedResource Include="IDE.style" />
+    <EmbeddedResource Include="IDE.style" />    
   </ItemGroup>
+       
+       <ItemGroup>
+               <PackageReference Include="Microsoft.Build" Version="16.0.461" />
+               <PackageReference Include="Microsoft.CodeAnalysis" Version="3.3.0-beta3-19401-01" />
+               <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.3.0-beta3-19401-01" />
+               <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="3.3.0-beta3-19401-01" />
+               <PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="3.3.0-beta3-19401-01" />
+               <PackageReference Include="Microsoft.CodeAnalysis.Features" Version="3.3.0-beta3-19401-01" />
+               <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Features" Version="3.3.0-beta3-19401-01" />
+               <PackageReference Include="Microsoft.Build.Utilities.Core" Version="16.0.461" />                
+       </ItemGroup>
     
   <ItemGroup>
     <Folder Include="src\msbuild\" />
index 5b5054ab3a6f1557d95b734f9e6d93c25465aecd..95a821fe1207d2d18bba02010c10de68b555b9fe 100644 (file)
@@ -1,5 +1,6 @@
-Label {    
-    Foreground="Black";
+//test
+Label {    
+    Foreground="White";
 }
 icon {
        Width="14";
@@ -60,5 +61,5 @@ Splitter {
        Background="RoyalBlue";
 }
 DockWindow {
-    Background="0.98,0.98,0.99,0.9";
+    Background="0.18,0.18,0.18,0.9";
 }
index a135e46686a9e18576956df9693479e357437923..0aa743b2246e262df2f2c52817ae11b22207e1ac 100644 (file)
@@ -112,17 +112,17 @@ namespace Crow.Coding
                {
                        using (app = new CrowIDE ()) {
                                MainIFace = app;
-
                                //app.Keyboard.KeyDown += App_KeyboardKeyDown;
-                               app.initIde ();
-
-                               app.reloadWinConfigs ();
-
                                app.Run ();
 
                                app.saveWinConfigs ();
                        }
                }
+               protected override void Startup ()
+               {
+                       initIde ();
+                       reloadWinConfigs ();
+               }
 
                static void App_KeyboardKeyDown (object sender, KeyEventArgs e)
                {
@@ -142,7 +142,7 @@ namespace Crow.Coding
                }
 
                Instantiator instFileDlg;
-               Solution currentSolution;
+               Workspace currentSolution;
                Project currentProject;
                DockStack mainDock;
 
@@ -159,9 +159,9 @@ namespace Crow.Coding
                        mainDock = go.FindByName ("mainDock") as DockStack;
 
                        if (ReopenLastSolution && !string.IsNullOrEmpty (LastOpenSolution)) {
-                               CurrentSolution = Solution.LoadSolution (LastOpenSolution);
+                               CurrentSolution = new Workspace (LastOpenSolution);
                                //lock(MainIFace.UpdateMutex)
-                               CurrentSolution.ReopenItemsSavedInUserConfig ();
+                               //      CurrentSolution.ReopenItemsSavedInUserConfig ();
                        }
 
                        instFileDlg = Instantiator.CreateFromImlFragment
@@ -197,7 +197,7 @@ namespace Crow.Coding
                                Crow.Configuration.Global.Set ("CurrentDirectory", value);
                        }
                }
-               public Solution CurrentSolution {
+               public Workspace CurrentSolution {
                        get { return currentSolution; }
                        set {
                                if (currentSolution == value)
@@ -257,7 +257,7 @@ namespace Crow.Coding
                        try {
                                string ext = Path.GetExtension (filePath);
                                if (string.Equals (ext, ".sln", StringComparison.InvariantCultureIgnoreCase)) {                                 
-                                       CurrentSolution = Solution.LoadSolution (filePath);
+                                       CurrentSolution = new Workspace (filePath);
                                        LastOpenSolution = filePath;
 //                             }else if (string.Equals (ext, ".csproj", StringComparison.InvariantCultureIgnoreCase)) {
 //                                     currentProject = new Project (filePath);
index ae9af80cc3fc7aec958a86df372b158f61a13796..241e80eeb9dc4f4f956a0c4c901bc0ed0a88b47b 100644 (file)
@@ -30,7 +30,7 @@ using System.Threading;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.IO;
-using Cairo;
+using Crow.Cairo;
 
 namespace Crow.Coding
 {
@@ -56,10 +56,21 @@ namespace Crow.Coding
 
                public DesignInterface () : base()
                {
+                       surf = new ImageSurface (Format.Argb32, 100, 100);
+
+                       loadStyling ();
                }
+               public override void InterfaceThread ()
+               {
 
-               public ProjectFile ProjFile;
+                       //running = true;
+                       //while (running) {
+                       //      Update ();
+                       //      Thread.Sleep (5);
+                       //}
+               }
 
+               public ProjectFile ProjFile;
 
 
                public override Widget CreateInstance (string path)
@@ -80,10 +91,7 @@ namespace Crow.Coding
                        throw new Exception ($"In Design File not found: {path}");
                }
 
-               protected override void InitBackend ()
-               {
-                       surf = new ImageSurface (Format.Argb32, 100, 100);
-               }
+
                public override void ProcessResize (Rectangle bounds)
                {
                        if (bounds == clientRectangle)
index b60617c14fd819414a01210f245436cc77d44454..3dec9c9c88a1ac63e3bc80a8d44d91279dde6ab6 100644 (file)
@@ -28,7 +28,7 @@ using System;
 using System.Xml.Serialization;
 using System.ComponentModel;
 using System.Collections;
-using Cairo;
+using Crow.Cairo;
 using System.Text;
 using System.Collections.Generic;
 using System.Text.RegularExpressions;
index 616d9a6b4a8c9aa4b480d03fa3cc5b4aad242cf5..291541027e2e64e80b77607b61bdda461f5136c3 100644 (file)
@@ -29,7 +29,7 @@ using Crow.IML;
 using System.Text;
 using System.Xml;
 using System.Diagnostics;
-using Cairo;
+using Crow.Cairo;
 
 namespace Crow.Coding
 {
index e574d6604e9a9a3598e5ee2f8371f5c01e2d3bb7..e800e002f0de7f995f755c71c6fd43d59385ae26 100644 (file)
@@ -26,7 +26,7 @@
 
 using System;
 using System.ComponentModel;
-using Cairo;
+using Crow.Cairo;
 using System.Collections.Generic;
 using System.Diagnostics;
 
index 97b19603741e5edbd1555212e3c0b913aac43338..fbfafb7d4177156445373827b952c4ac3c266cf0 100644 (file)
@@ -25,7 +25,7 @@
 // THE SOFTWARE.
 using System;
 using System.ComponentModel;
-using Cairo;
+using Crow.Cairo;
 
 namespace Crow.Coding
 {
index e5d620a642bd4011f3999aa24f7243243eee30fa..e996ce3edab10b7f0e247dab8ceb2bcb95d1c639 100644 (file)
@@ -24,7 +24,7 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 using System;
-using Cairo;
+using Crow.Cairo;
 
 namespace Crow.Coding
 {
index bd6ad1448f47d58f254c78658f0160be951cd436..27d1e025e0674cc9ffe3e647a3d9190114343cb7 100644 (file)
@@ -25,7 +25,7 @@ using System.ComponentModel;
 using System.Reflection;
 using System.Collections.Generic;
 using System.Linq;
-using Cairo;
+using Crow.Cairo;
 
 namespace Crow.Coding
 {      
index 4d043ab42ae887a21b255bc8338ab67f42db296c..f8e71d3dd3bfeb9817c99f41926f788d88890259 100644 (file)
@@ -200,6 +200,7 @@ namespace Crow.Coding
                                return;
                        FileLocation fl = g.design_style_locations [Name];
                        ProjectFile pf;
+                       /*
                        if (!mview.ProjectNode.Project.TryGetProjectFileFromPath ("#" + fl.FilePath, out pf))
                                return;
 
@@ -209,7 +210,7 @@ namespace Crow.Coding
                        pf.CurrentLine = fl.Line;
                        pf.CurrentColumn = fl.Column;
 
-                       pf.IsSelected = true;
+                       pf.IsSelected = true;*/
 
                }
 
index c916095b0b6cc04fb34a3e49d697801ec909b7d1..b12d67c81b178455b343a8f1b2e0efeca23027c1 100644 (file)
@@ -32,6 +32,7 @@ using Microsoft.CSharp;
 using System.CodeDom.Compiler;
 using Crow;
 using System.Text.RegularExpressions;
+using Microsoft.Build.Construction;
 
 namespace Crow.Coding {
     public class Project : IValueChange {
@@ -43,21 +44,21 @@ namespace Crow.Coding {
         #endregion
 
         bool isLoaded = false;
-        bool isExpanded;
-        XmlDocument xmlDoc;
-        XmlNode nodeProject;
-        XmlNode nodeProps;
-        XmlNodeList nodesItems;
-        SolutionProject solutionProject;
-        Crow.Command cmdSave, cmdOpen, cmdCompile, cmdSetAsStartProj, cmdNewFile;
+        bool isExpanded;        
+        ProjectInSolution solutionProject;
+               Microsoft.Build.Evaluation.Project project;
+
+               Crow.Command cmdSave, cmdOpen, cmdCompile, cmdSetAsStartProj, cmdNewFile;
 
         #region CTOR
-        public Project (Solution sol, SolutionProject sp) {
+        public Project (Workspace sol, ProjectInSolution sp) {
             solutionProject = sp;
-
             solution = sol;
 
-            cmdSave = new Crow.Command (new Action (() => Save ())) { Caption = "Save", Icon = new SvgPicture ("#CrowIDE.icons.save.svg"), CanExecute = true };
+                       ProjectRootElement projectRootElt = ProjectRootElement.Open (solutionProject.AbsolutePath);
+                       project = new Microsoft.Build.Evaluation.Project (projectRootElt, null, "15.0");
+
+                       cmdSave = new Crow.Command (new Action (() => Save ())) { Caption = "Save", Icon = new SvgPicture ("#CrowIDE.icons.save.svg"), CanExecute = true };
             cmdOpen = new Crow.Command (new Action (() => Load ())) { Caption = "Open", Icon = new SvgPicture ("#CrowIDE.icons.open.svg"), CanExecute = false };
             cmdCompile = new Crow.Command (new Action (() => Compile ())) {
                 Caption = "Compile",
@@ -78,13 +79,12 @@ namespace Crow.Coding {
         }
         #endregion
 
-        public Solution solution;
+        public Workspace solution;
         public List<Crow.Command> Commands;
         public CompilerResults CompilationResults;
         public List<Project> dependantProjects = new List<Project> ();
         public Project ParentProject = null;
-        List<ProjectNode> rootItems;
-        List<ProjectNode> flattenNodes;
+        List<ProjectNode> rootItems;        
 
         public string Name {
             get { return solutionProject.ProjectName; }
@@ -111,147 +111,60 @@ namespace Crow.Coding {
             get { return solution.StartupProject == this; }
         }
         public string Path {
-            get { return System.IO.Path.Combine (solution.SolutionFolder, solutionProject.RelativePath.Replace ('\\', '/')); }
+            get { return System.IO.Path.Combine (project.DirectoryPath.Replace ('\\', '/')); }
         }
         public string RootDir {
             get { return System.IO.Path.GetDirectoryName (Path); }
         }
 
-
-
         public List<ProjectNode> RootItems {
             get { return rootItems; }
         }
-
-        void buildTreeNodes () {
-            ProjectNode root = new ProjectNode (this, ItemType.VirtualGroup, RootNamespace);
-            List<ProjectItem> items = new List<ProjectItem> ();
-            foreach (XmlNode i in nodesItems) {
-                foreach (XmlNode f in i.ChildNodes) {
-                    items.Add (new ProjectItem (this, f));
-                }
-            }
-
-            flattenNodes = new List<ProjectNode> ();
-
-            ProjectNode refs = new ProjectNode (this, ItemType.ReferenceGroup, "References");
-            root.AddChild (refs);
-
-            foreach (ProjectItem pn in items) {
-                switch (pn.Type) {
-                    case ItemType.Reference:
-                        refs.AddChild (pn);
-                        flattenNodes.Add (pn);
-                        break;
-                    case ItemType.ProjectReference:
-                        ProjectReference pr = new ProjectReference (pn);
-                        refs.AddChild (pr);
-                        flattenNodes.Add (pr);
-                        break;
-                    case ItemType.Compile:
-                    case ItemType.None:
-                    case ItemType.EmbeddedResource:
-                        ProjectNode curNode = root;
-                        string[] folds = pn.Path.Split ('/');
-                        for (int i = 0; i < folds.Length - 1; i++) {
-                            ProjectNode nextNode = curNode.ChildNodes.FirstOrDefault (n => n.DisplayName == folds[i] && n.Type == ItemType.VirtualGroup);
-                            if (nextNode == null) {
-                                nextNode = new ProjectNode (this, ItemType.VirtualGroup, folds[i]);
-                                curNode.AddChild (nextNode);
-                            }
-                            curNode = nextNode;
-                        }
-                        ProjectNode f = null;
-                        switch (pn.Extension) {
-                            /*case ".cs":
-                                f = new CSProjectFile (pn);
-                                break;*/
-                            case ".crow":
-                            case ".template":
-                            case ".goml":
-                            case ".itemp":
-                            case ".imtl":
-                                f = new ImlProjectItem (pn);
-                                break;
-                            case ".style":
-                                f = new StyleProjectItem (pn);
-                                break;
-                            default:
-                                f = new ProjectFile (pn);
-                                break;
-                        }
-                        curNode.AddChild (f);
-                        flattenNodes.Add (f);
-                        break;
-                }
-            }
-            root.SortChilds ();
-
-            rootItems = root.ChildNodes;
-        }
-
+        
         #region Project properties
         public string ToolsVersion {
-            get { return nodeProject?.Attributes["ToolsVersion"]?.Value; }
+            get { return project.ToolsVersion; }
         }
         public string DefaultTargets {
-            get { return nodeProject?.Attributes["DefaultTargets"]?.Value; }
+            get { return project.Xml.DefaultTargets; }
         }
         public string ProjectGuid {
             get { return solutionProject.ProjectGuid; }
         }
-        public string AssemblyName {
-            get { return nodeProps["AssemblyName"]?.InnerText; }
-        }
-        public string OutputType {
-            get { return nodeProps["OutputType"]?.InnerText; }
-        }
-        public string RootNamespace {
-            get { return nodeProps["RootNamespace"]?.InnerText; }
-        }
+        public string AssemblyName => project.AllEvaluatedProperties.Where(p=>p.Name =="AssemblyName").FirstOrDefault().EvaluatedValue;
+        public string OutputType => project.AllEvaluatedProperties.Where (p => p.Name == "OutputType").FirstOrDefault ().EvaluatedValue;
+        public string RootNamespace => project.AllEvaluatedProperties.Where (p => p.Name == "RootNamespace").FirstOrDefault ().EvaluatedValue;
         public bool AllowUnsafeBlocks {
             get {
-                return nodeProps["AllowUnsafeBlocks"] == null ? false :
-               bool.Parse (nodeProps["AllowUnsafeBlocks"]?.InnerText);
+                               return false;
+                /*return nodeProps["AllowUnsafeBlocks"] == null ? false :
+               bool.Parse (nodeProps["AllowUnsafeBlocks"]?.InnerText);*/
             }
         }
         public bool NoStdLib {
             get {
-                return nodeProps["NoStdLib"] == null ? false :
-              bool.Parse (nodeProps["NoStdLib"]?.InnerText);
+                               return false;
+                /*return nodeProps["NoStdLib"] == null ? false :
+              bool.Parse (nodeProps["NoStdLib"]?.InnerText);*/
             }
         }
         public bool TreatWarningsAsErrors {
             get {
-                return nodeProps["TreatWarningsAsErrors"] == null ? false :
-              bool.Parse (nodeProps["TreatWarningsAsErrors"]?.InnerText);
+                               return false;
+                /*return nodeProps["TreatWarningsAsErrors"] == null ? false :
+              bool.Parse (nodeProps["TreatWarningsAsErrors"]?.InnerText);*/
             }
         }
         public bool SignAssembly {
-            get { return bool.Parse (nodeProps["SignAssembly"]?.InnerText); }
-        }
-        public string TargetFrameworkVersion {
-            get { return nodeProps["TargetFrameworkVersion"]?.InnerText; }
-        }
-        public string Description {
-            get { return nodeProps["Description"]?.InnerText; }
-        }
-        public string OutputPath {
-            get { return nodeProps["OutputPath"]?.InnerText; }
-        }
-        public string IntermediateOutputPath {
-            get { return nodeProps["IntermediateOutputPath"]?.InnerText; }
-        }
-        public string StartupObject {
-            get { return nodeProps["StartupObject"]?.InnerText; }
-        }
-        public bool DebugSymbols {
-            get { return nodeProps["DebugSymbols"] == null ? false : bool.Parse (nodeProps["DebugSymbols"]?.InnerText); }
-        }
-        public int WarningLevel {
-            get { return nodeProps["WarningLevel"] == null ? 0 : int.Parse (nodeProps["WarningLevel"]?.InnerText); }
-        }
-
+                       get { return false; }// projectRootElt.Properties.Where (p => p.Name == "SignAssembly").FirstOrDefault ().Value; }
+        }
+        public string TargetFrameworkVersion => project.AllEvaluatedProperties.Where (p => p.Name == "TargetFrameworkVersion").FirstOrDefault ().EvaluatedValue;
+        public string Description => project.AllEvaluatedProperties.Where (p => p.Name == "Description").FirstOrDefault ().EvaluatedValue;
+        public string OutputPath => project.AllEvaluatedProperties.Where (p => p.Name == "OutputPath").FirstOrDefault ().EvaluatedValue;
+        public string IntermediateOutputPath => project.AllEvaluatedProperties.Where (p => p.Name == "IntermediateOutputPath").FirstOrDefault ().EvaluatedValue;
+        public string StartupObject => project.AllEvaluatedProperties.Where (p => p.Name == "StartupObject").FirstOrDefault ().EvaluatedValue;
+               public bool DebugSymbols => false;// nodeProps["DebugSymbols"] == null ? false : bool.Parse (nodeProps["DebugSymbols"]?.InnerText); }        
+               public int WarningLevel => 0;
         #endregion
 
 
@@ -261,26 +174,67 @@ namespace Crow.Coding {
 
         public void Load () {
 
-            xmlDoc = new XmlDocument ();
-            using (Stream ins = new FileStream (this.Path, FileMode.Open)) {
-                xmlDoc.Load (new XmlTextReader (ins) { Namespaces = false });
-            }
-
-            nodeProject = xmlDoc.SelectSingleNode ("Project");
-            XmlNodeList nodesProps = xmlDoc.SelectNodes ("/Project/PropertyGroup");
-
-            foreach (XmlNode n in nodesProps) {
-                if (n.Attributes["Condition"] == null)
-                    nodeProps = n;
-            }
-            nodesItems = xmlDoc.SelectNodes ("/Project/ItemGroup");
-
-            if (ProjectGuid != solutionProject.ProjectGuid)
-                throw new Exception ("Project GUID not matching with solution");
-
-            buildTreeNodes ();
-
-            IsLoaded = true;
+                       ProjectNode root = new ProjectNode (this, ItemType.VirtualGroup, RootNamespace);
+                       ProjectNode refs = new ProjectNode (this, ItemType.ReferenceGroup, "References");
+                       root.AddChild (refs);
+
+                       foreach (Microsoft.Build.Evaluation.ProjectItem pn in project.AllEvaluatedItems) {
+                               switch (pn.ItemType) {
+                               case "Reference":
+                                       refs.AddChild (new ProjectItem(this, pn));
+                                       break;
+                               case "ProjectReference":
+                                       ProjectReference pr = new ProjectReference (this, pn);
+                                       refs.AddChild (pr);
+                                       break;
+                               case "Compile":
+                               case "None":
+                               case "EmbeddedResource":
+
+                                       ProjectNode curNode = root;
+                                       try {
+                                               string file = pn.EvaluatedInclude.Replace ('\\', '/');                                                                          
+                                               string [] folds = file.Split ('/');
+                                               for (int i = 0; i < folds.Length - 1; i++) {
+                                                       ProjectNode nextNode = curNode.ChildNodes.FirstOrDefault (n => n.DisplayName == folds [i] && n.Type == ItemType.VirtualGroup);
+                                                       if (nextNode == null) {
+                                                               nextNode = new ProjectNode (this, ItemType.VirtualGroup, folds [i]);
+                                                               curNode.AddChild (nextNode);
+                                                       }
+                                                       curNode = nextNode;
+                                               }
+                                               ProjectItem pi = new ProjectItem (this, pn);
+
+                                               switch (System.IO.Path.GetExtension (file)) {
+                                               /*case ".cs":
+                                                       f = new CSProjectFile (pn);
+                                                       break;*/
+                                               case ".crow":
+                                               case ".template":
+                                               case ".goml":
+                                               case ".itemp":
+                                               case ".imtl":
+                                                       pi = new ImlProjectItem (pi);
+                                                       break;
+                                               case ".style":
+                                                       pi = new StyleProjectItem (pi);
+                                                       break;
+                                               default:
+                                                       pi = new ProjectFile (pi);
+                                                       break;
+                                               }
+                                               curNode.AddChild (pi);
+
+                                       } catch (Exception ex) {
+
+                                       }
+
+                                       break;
+                               }
+                       }
+                       root.SortChilds ();
+                       rootItems = root.ChildNodes;
+                       IsLoaded = true;
         }
 
         public void Save () {
@@ -311,164 +265,164 @@ namespace Crow.Coding {
             return tmp;
         }
         public string Compile () {
-            if (ParentProject != null)
-                ParentProject.Compile ();
-
-            CSharpCodeProvider cp = new CSharpCodeProvider ();
-            CompilerParameters parameters = new CompilerParameters ();
-
-            foreach (ProjectReference pr in flattenNodes.OfType<ProjectReference> ()) {
-                Project p = solution.Projects.FirstOrDefault (pp => pp.ProjectGuid == pr.ProjectGUID);
-                if (p == null)
-                    throw new Exception ("referenced project not found");
-                parameters.ReferencedAssemblies.Add (p.Compile ());
-            }
-
-            string outputDir = getDirectoryWithTokens (this.OutputPath);
-            string objDir = getDirectoryWithTokens (this.IntermediateOutputPath);
-
-            Directory.CreateDirectory (outputDir);
-            Directory.CreateDirectory (objDir);
-
-            parameters.OutputAssembly = System.IO.Path.Combine (outputDir, this.AssemblyName);
-
-            // True - exe file generation, false - dll file generation
-            if (this.OutputType == "Library") {
-                parameters.GenerateExecutable = false;
-                parameters.CompilerOptions += " /target:library";
-                parameters.OutputAssembly += ".dll";
-            } else {
-                parameters.GenerateExecutable = true;
-                parameters.CompilerOptions += " /target:exe";
-                parameters.OutputAssembly += ".exe";
-                parameters.MainClass = this.StartupObject;
-            }
-
-            parameters.GenerateInMemory = false;
-            parameters.IncludeDebugInformation = this.DebugSymbols;
-            parameters.TreatWarningsAsErrors = this.TreatWarningsAsErrors;
-            parameters.WarningLevel = this.WarningLevel;
-            parameters.CompilerOptions += " /noconfig";
-            if (this.AllowUnsafeBlocks)
-                parameters.CompilerOptions += " /unsafe";
-            parameters.CompilerOptions += " /delaysign+";
-            parameters.CompilerOptions += " /debug:full /debug+";
-            parameters.CompilerOptions += " /optimize-";
-            parameters.CompilerOptions += " /define:\"DEBUG;TRACE\"";
-            parameters.CompilerOptions += " /nostdlib";
-
-
-
-            foreach (ProjectItem pi in flattenNodes.Where (p => p.Type == ItemType.Reference)) {
-
-                if (string.IsNullOrEmpty (pi.HintPath)) {
-                    parameters.CompilerOptions += " /reference:/usr/lib/mono/4.5/" + pi.Path + ".dll";
-                    continue;
-                }
-                parameters.ReferencedAssemblies.Add (pi.Path);
-                string fullHintPath = System.IO.Path.GetFullPath (System.IO.Path.Combine (RootDir, pi.HintPath.Replace ('\\', '/')));
-                if (File.Exists (fullHintPath)) {
-                    string outPath = System.IO.Path.Combine (outputDir, System.IO.Path.GetFileName (fullHintPath));
-                    if (!File.Exists (outPath))
-                        File.Copy (fullHintPath, outPath);
-                }
-            }
-            parameters.CompilerOptions += " /reference:/usr/lib/mono/4.5/System.Core.dll";
-            parameters.CompilerOptions += " /reference:/usr/lib/mono/4.5/mscorlib.dll";
-            //parameters.ReferencedAssemblies.Add ("System.Core");
-            //parameters.ReferencedAssemblies.Add ("mscorlib.dll");
-
-
-            IEnumerable<ProjectFile> pfs = flattenNodes.OfType<ProjectFile> ();
-
-            foreach (ProjectFile pi in pfs.Where (p => p.Type == ItemType.EmbeddedResource)) {
-
-                string absPath = pi.AbsolutePath;
-                string logicName = pi.LogicalName;
-                if (string.IsNullOrEmpty (logicName))
-                    parameters.CompilerOptions += string.Format (" /resource:{0},{1}", absPath, this.Name + "." + pi.Path.Replace ('/', '.'));
-                else
-                    parameters.CompilerOptions += string.Format (" /resource:{0},{1}", absPath, logicName);
-            }
-            foreach (ProjectFile pi in pfs.Where (p => p.Type == ItemType.None)) {
-                if (pi.CopyToOutputDirectory == CopyToOutputState.Never)
-                    continue;
-                string source = pi.AbsolutePath;
-                string target = System.IO.Path.Combine (outputDir, pi.Path);
-                Directory.CreateDirectory (System.IO.Path.GetDirectoryName (target));
-
-                if (File.Exists (target)) {
-                    if (pi.CopyToOutputDirectory == CopyToOutputState.PreserveNewest) {
-                        if (DateTime.Compare (
-                                System.IO.File.GetLastWriteTime (source),
-                                System.IO.File.GetLastWriteTime (target)) < 0)
-                            continue;
-                    }
-                    File.Delete (target);
-                }
-                System.Diagnostics.Debug.WriteLine ("copy " + source + " to " + target);
-                File.Copy (source, target);
-            }
-            string[] files = pfs.Where (p => p.Type == ItemType.Compile).Select (p => p.AbsolutePath).ToArray ();
-
-            System.Diagnostics.Debug.WriteLine ("---- start compilation of :" + parameters.OutputAssembly);
-            System.Diagnostics.Debug.WriteLine (parameters.CompilerOptions);
-
-            CompilationResults = cp.CompileAssemblyFromFile (parameters, files);
-
-            solution.UpdateErrorList ();
-
-            return parameters.OutputAssembly;
-        }
-
-        public bool TryGetProjectFileFromAbsolutePath (string absolutePath, out ProjectFile pi) {
-            pi = flattenNodes.OfType<ProjectFile> ().FirstOrDefault
-                (pp => pp.AbsolutePath == absolutePath);
-            return pi != null;
-        }
-        public bool TryGetProjectFileFromPath (string path, out ProjectFile pi) {
-            if (path.StartsWith ("#", StringComparison.Ordinal))
-                pi = flattenNodes.OfType<ProjectFile> ().FirstOrDefault
-                    (pp => pp.Type == ItemType.EmbeddedResource && pp.ResourceID == path.Substring (1));
-            else
-                pi = flattenNodes.OfType<ProjectFile> ().FirstOrDefault (pp => pp.Path == path);
-
-            if (pi != null)
-                return true;
-
-            foreach (ProjectReference pr in flattenNodes.OfType<ProjectReference> ()) {
-                Project p = solution.Projects.FirstOrDefault (pp => pp.ProjectGuid == pr.ProjectGUID);
-                if (p == null)
-                    throw new Exception ("referenced project not found");
-                if (p.TryGetProjectFileFromPath (path, out pi))
-                    return true;
-            }
-            //TODO: search referenced assemblies
-            return false;
+        //    if (ParentProject != null)
+        //        ParentProject.Compile ();
+
+        //    CSharpCodeProvider cp = new CSharpCodeProvider ();
+        //    CompilerParameters parameters = new CompilerParameters ();
+
+        //    foreach (ProjectReference pr in flattenNodes.OfType<ProjectReference> ()) {
+        //        Project p = solution.Projects.FirstOrDefault (pp => pp.ProjectGuid == pr.ProjectGUID);
+        //        if (p == null)
+        //            throw new Exception ("referenced project not found");
+        //        parameters.ReferencedAssemblies.Add (p.Compile ());
+        //    }
+
+        //    string outputDir = getDirectoryWithTokens (this.OutputPath);
+        //    string objDir = getDirectoryWithTokens (this.IntermediateOutputPath);
+
+        //    Directory.CreateDirectory (outputDir);
+        //    Directory.CreateDirectory (objDir);
+
+        //    parameters.OutputAssembly = System.IO.Path.Combine (outputDir, this.AssemblyName);
+
+        //    // True - exe file generation, false - dll file generation
+        //    if (this.OutputType == "Library") {
+        //        parameters.GenerateExecutable = false;
+        //        parameters.CompilerOptions += " /target:library";
+        //        parameters.OutputAssembly += ".dll";
+        //    } else {
+        //        parameters.GenerateExecutable = true;
+        //        parameters.CompilerOptions += " /target:exe";
+        //        parameters.OutputAssembly += ".exe";
+        //        parameters.MainClass = this.StartupObject;
+        //    }
+
+        //    parameters.GenerateInMemory = false;
+        //    parameters.IncludeDebugInformation = this.DebugSymbols;
+        //    parameters.TreatWarningsAsErrors = this.TreatWarningsAsErrors;
+        //    parameters.WarningLevel = this.WarningLevel;
+        //    parameters.CompilerOptions += " /noconfig";
+        //    if (this.AllowUnsafeBlocks)
+        //        parameters.CompilerOptions += " /unsafe";
+        //    parameters.CompilerOptions += " /delaysign+";
+        //    parameters.CompilerOptions += " /debug:full /debug+";
+        //    parameters.CompilerOptions += " /optimize-";
+        //    parameters.CompilerOptions += " /define:\"DEBUG;TRACE\"";
+        //    parameters.CompilerOptions += " /nostdlib";
+
+
+
+        //    foreach (ProjectItem pi in flattenNodes.Where (p => p.Type == ItemType.Reference)) {
+
+        //        if (string.IsNullOrEmpty (pi.HintPath)) {
+        //            parameters.CompilerOptions += " /reference:/usr/lib/mono/4.5/" + pi.Path + ".dll";
+        //            continue;
+        //        }
+        //        parameters.ReferencedAssemblies.Add (pi.Path);
+        //        string fullHintPath = System.IO.Path.GetFullPath (System.IO.Path.Combine (RootDir, pi.HintPath.Replace ('\\', '/')));
+        //        if (File.Exists (fullHintPath)) {
+        //            string outPath = System.IO.Path.Combine (outputDir, System.IO.Path.GetFileName (fullHintPath));
+        //            if (!File.Exists (outPath))
+        //                File.Copy (fullHintPath, outPath);
+        //        }
+        //    }
+        //    parameters.CompilerOptions += " /reference:/usr/lib/mono/4.5/System.Core.dll";
+        //    parameters.CompilerOptions += " /reference:/usr/lib/mono/4.5/mscorlib.dll";
+        //    //parameters.ReferencedAssemblies.Add ("System.Core");
+        //    //parameters.ReferencedAssemblies.Add ("mscorlib.dll");
+
+
+        //    IEnumerable<ProjectFile> pfs = flattenNodes.OfType<ProjectFile> ();
+
+        //    foreach (ProjectFile pi in pfs.Where (p => p.Type == ItemType.EmbeddedResource)) {
+
+        //        string absPath = pi.AbsolutePath;
+        //        string logicName = pi.LogicalName;
+        //        if (string.IsNullOrEmpty (logicName))
+        //            parameters.CompilerOptions += string.Format (" /resource:{0},{1}", absPath, this.Name + "." + pi.Path.Replace ('/', '.'));
+        //        else
+        //            parameters.CompilerOptions += string.Format (" /resource:{0},{1}", absPath, logicName);
+        //    }
+        //    foreach (ProjectFile pi in pfs.Where (p => p.Type == ItemType.None)) {
+        //        if (pi.CopyToOutputDirectory == CopyToOutputState.Never)
+        //            continue;
+        //        string source = pi.AbsolutePath;
+        //        string target = System.IO.Path.Combine (outputDir, pi.Path);
+        //        Directory.CreateDirectory (System.IO.Path.GetDirectoryName (target));
+
+        //        if (File.Exists (target)) {
+        //            if (pi.CopyToOutputDirectory == CopyToOutputState.PreserveNewest) {
+        //                if (DateTime.Compare (
+        //                        System.IO.File.GetLastWriteTime (source),
+        //                        System.IO.File.GetLastWriteTime (target)) < 0)
+        //                    continue;
+        //            }
+        //            File.Delete (target);
+        //        }
+        //        System.Diagnostics.Debug.WriteLine ("copy " + source + " to " + target);
+        //        File.Copy (source, target);
+        //    }
+        //    string[] files = pfs.Where (p => p.Type == ItemType.Compile).Select (p => p.AbsolutePath).ToArray ();
+
+        //    System.Diagnostics.Debug.WriteLine ("---- start compilation of :" + parameters.OutputAssembly);
+        //    System.Diagnostics.Debug.WriteLine (parameters.CompilerOptions);
+
+        //    CompilationResults = cp.CompileAssemblyFromFile (parameters, files);
+
+        //    solution.UpdateErrorList ();
+
+        //    return parameters.OutputAssembly;
+        //}
+
+        //public bool TryGetProjectFileFromAbsolutePath (string absolutePath, out ProjectFile pi) {
+        //    pi = flattenNodes.OfType<ProjectFile> ().FirstOrDefault
+        //        (pp => pp.AbsolutePath == absolutePath);
+        //    return pi != null;
+        //}
+        //public bool TryGetProjectFileFromPath (string path, out ProjectFile pi) {
+            //if (path.StartsWith ("#", StringComparison.Ordinal))
+            //    pi = flattenNodes.OfType<ProjectFile> ().FirstOrDefault
+            //        (pp => pp.Type == ItemType.EmbeddedResource && pp.ResourceID == path.Substring (1));
+            //else
+            //    pi = flattenNodes.OfType<ProjectFile> ().FirstOrDefault (pp => pp.Path == path);
+
+            //if (pi != null)
+            //    return true;
+
+            //foreach (ProjectReference pr in flattenNodes.OfType<ProjectReference> ()) {
+            //    Project p = solution.Projects.FirstOrDefault (pp => pp.ProjectGuid == pr.ProjectGUID);
+            //    if (p == null)
+            //        throw new Exception ("referenced project not found");
+            //    if (p.TryGetProjectFileFromPath (path, out pi))
+            //        return true;
+            //}
+            ////TODO: search referenced assemblies
+            return "";
         }
 
         public void GetDefaultTemplates () {
-            IEnumerable<ProjectFile> tmpFiles =
-                flattenNodes.OfType<ProjectFile> ().Where (pp => pp.Extension == ".template");
-
-            foreach (ProjectFile pi in tmpFiles.Where (
-                pp => pp.Type == ItemType.None && pp.CopyToOutputDirectory != CopyToOutputState.Never)) {
-
-                string clsName = System.IO.Path.GetFileNameWithoutExtension (pi.Path);
-                if (solution.DefaultTemplates.ContainsKey (clsName))
-                    continue;
-                solution.DefaultTemplates[clsName] = pi.AbsolutePath;
-            }
-            foreach (ProjectFile pi in tmpFiles.Where (pp => pp.Type == ItemType.EmbeddedResource)) {
-                string resId = pi.ResourceID;
-                string clsName = resId.Substring (0, resId.Length - 9);
-                if (solution.DefaultTemplates.ContainsKey (clsName))
-                    continue;
-                solution.DefaultTemplates[clsName] = pi.Path;
-            }
-
-            foreach (Project p in ReferencedProjects)
-                p.GetDefaultTemplates ();
+            //IEnumerable<ProjectFile> tmpFiles =
+            //    flattenNodes.OfType<ProjectFile> ().Where (pp => pp.Extension == ".template");
+
+            //foreach (ProjectFile pi in tmpFiles.Where (
+            //    pp => pp.Type == ItemType.None && pp.CopyToOutputDirectory != CopyToOutputState.Never)) {
+
+            //    string clsName = System.IO.Path.GetFileNameWithoutExtension (pi.Path);
+            //    if (solution.DefaultTemplates.ContainsKey (clsName))
+            //        continue;
+            //    solution.DefaultTemplates[clsName] = pi.AbsolutePath;
+            //}
+            //foreach (ProjectFile pi in tmpFiles.Where (pp => pp.Type == ItemType.EmbeddedResource)) {
+            //    string resId = pi.ResourceID;
+            //    string clsName = resId.Substring (0, resId.Length - 9);
+            //    if (solution.DefaultTemplates.ContainsKey (clsName))
+            //        continue;
+            //    solution.DefaultTemplates[clsName] = pi.Path;
+            //}
+
+            //foreach (Project p in ReferencedProjects)
+                //p.GetDefaultTemplates ();
         }
         //             void searchTemplatesIn(Assembly assembly){
         //                     if (assembly == null)
@@ -486,17 +440,17 @@ namespace Crow.Coding {
         public List<Project> ReferencedProjects {
             get {
                 List<Project> tmp = new List<Project> ();
-                foreach (ProjectReference pr in flattenNodes.OfType<ProjectReference> ()) {
+                /*foreach (ProjectReference pr in flattenNodes.OfType<ProjectReference> ()) {
                     Project p = solution.Projects.FirstOrDefault (pp => pp.ProjectGuid == pr.ProjectGUID);
                     if (p != null)
                         tmp.Add (p);
-                }
+                }*/
                 return tmp;
             }
         }
 
         public void GetStyling () {
-            try {
+            /*try {
                 foreach (ProjectFile pi in flattenNodes.OfType<ProjectFile> ().Where (pp => pp.Type == ItemType.EmbeddedResource && pp.Extension == ".style")) {
                     using (Stream s = new MemoryStream (System.Text.Encoding.UTF8.GetBytes (pi.Source))) {
                         new StyleReader (solution.Styling, s, pi.ResourceID);
@@ -510,7 +464,7 @@ namespace Crow.Coding {
                 if (p != null)
                     //throw new Exception ("referenced project not found");
                        p.GetStyling ();
-            }
+            }*/
 
             //TODO:get styling from referenced assemblies
         }
index 294a28f55c954b6ee1abff1e1ea2c0542afe6b57..24a31b9724053c3dd4099cc1491d421f791b38be 100644 (file)
@@ -77,16 +77,16 @@ namespace Crow.Coding {
                }
 
                public string ResourceID {
-                       get {                           
-                               return Type != ItemType.EmbeddedResource ? null :
+                       get {
+                               return "todo";/* Type != ItemType.EmbeddedResource ? null :
                                        node.SelectSingleNode ("LogicalName") == null ?
                                        Project.Name + "." + Path.Replace ('/', '.') :
-                                       LogicalName;
+                                       LogicalName;*/
                        }
                }
                public string LogicalName {
                        get {
-                               return node.SelectSingleNode ("LogicalName")?.InnerText;
+                               return "todo";// node.SelectSingleNode ("LogicalName")?.InnerText;
                        }
                }
                public bool IsOpened {
@@ -214,9 +214,10 @@ namespace Crow.Coding {
 
                public CopyToOutputState CopyToOutputDirectory {
                        get {
-                               XmlNode xn = node.SelectSingleNode ("CopyToOutputDirectory");
+                               return CopyToOutputState.Never;
+                               /*XmlNode xn = node.SelectSingleNode ("CopyToOutputDirectory");
                                return xn == null ? CopyToOutputState.Never :
-                                       (CopyToOutputState)Enum.Parse (typeof(CopyToOutputState), xn.InnerText, true);
+                                       (CopyToOutputState)Enum.Parse (typeof(CopyToOutputState), xn.InnerText, true);*/
                        }
                }
 
index afa3e3edd92a76ca383d838bd8415545bddffeb9..5c274a132982239e2e8c63e55fc6f0d8ee83a640 100644 (file)
@@ -30,18 +30,19 @@ using System.Xml;
 using System.IO;
 using Crow;
 using System.Threading;
+using Microsoft.Build.Construction;
 
 namespace Crow.Coding
 {      
        public class ProjectItem : ProjectNode {
                #region CTOR
                public ProjectItem() {}
-               public ProjectItem (Project project, XmlNode _node) : base (project){
+               public ProjectItem (Project project, Microsoft.Build.Evaluation.ProjectItem _node) : base (project){
                        node = _node;
                }
                #endregion
 
-               public XmlNode node;
+               public Microsoft.Build.Evaluation.ProjectItem node;
 
         public override Picture Icon {
             get {
@@ -64,17 +65,17 @@ namespace Crow.Coding
                }
                public string Path {
                        get {
-                               return node.Attributes["Include"]?.Value.Replace('\\','/');
+                               return node.EvaluatedInclude?.Replace('\\','/');
                        }
                }
                public string AbsolutePath {
                        get {
-                               return System.IO.Path.Combine (Project.RootDir, Path);
+                               return System.IO.Path.Combine (Project.Path, Path);
                        }
                }
                public override ItemType Type {
                        get { 
-                               return (ItemType)Enum.Parse (typeof(ItemType), node.Name, true);
+                               return (ItemType)Enum.Parse (typeof(ItemType), node.ItemType, true);
                        }
                }
                public override string DisplayName {
@@ -85,7 +86,7 @@ namespace Crow.Coding
                        }
                }
                public string HintPath {
-                       get { return node.SelectSingleNode ("HintPath")?.InnerText; }
+                       get { return "HintPath?"; }
                }
 
                public override bool IsSelected {
index 84870746cbcaa893927e3bbfe0b61c1becf7b9a9..a1993b05bea26d7a8e1217c98465f70037af3227 100644 (file)
@@ -30,20 +30,21 @@ using System.Xml;
 using System.IO;
 using Crow;
 using System.Threading;
+using Microsoft.Build.Construction;
 
 namespace Crow.Coding
 {      
        public class ProjectReference : ProjectItem {
-               public ProjectReference (ProjectItem pi) : base (pi.Project, pi.node){
+               public ProjectReference (Project proj, Microsoft.Build.Evaluation.ProjectItem pi) : base (proj, pi){
                }
                public string ProjectGUID {
                        get {
-                               return node.SelectSingleNode ("Project")?.InnerText;
+                               return "todo"; //node.SelectSingleNode ("Project")?.InnerText;
                        }
                }
                public override string DisplayName {
                        get {
-                               return node.SelectSingleNode ("Name").InnerText;
+                               return "project Ref"; // node.SelectSingleNode ("Name").InnerText;
                        }
                }
        }
diff --git a/CrowIDE/src/Solution.cs b/CrowIDE/src/Solution.cs
deleted file mode 100644 (file)
index e69cc5e..0000000
+++ /dev/null
@@ -1,540 +0,0 @@
-//
-// Solution.cs
-//
-//code taken in project https://sourceforge.net/projects/syncproj/
-// no licence info was included, I took the liberty to modify it.
-// Author:
-//             tarmopikaro
-//      2018 Jean-Philippe Bruyère
-//MIT-licenced
-
-using Microsoft.Win32;
-using System;
-using System.Collections.Generic;
-using System.Diagnostics.CodeAnalysis;
-using System.Globalization;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Xml.Serialization;
-using Crow;
-
-namespace Crow.Coding{ 
-       public class SolutionProject {
-               public string ProjectHostGuid;
-               public string ProjectName;
-               public string RelativePath;
-               public string ProjectGuid;
-       }
-       public class StyleItemContainer {
-               public object Value;
-               public string Name;
-               public StyleItemContainer(string name, object _value){
-                       Name = name;
-                       Value = _value;
-               }
-       }
-       public class StyleContainer : IValueChange {
-               #region IValueChange implementation
-               public event EventHandler<ValueChangeEventArgs> ValueChanged;
-               public virtual void NotifyValueChanged(string MemberName, object _value)
-               {
-                       ValueChanged.Raise(this, new ValueChangeEventArgs(MemberName, _value));
-               }
-               #endregion
-
-               Style style;
-               bool isExpanded;
-
-               public string Name;
-               public List<StyleItemContainer> Items;
-               public bool IsExpanded
-               {
-                       get { return isExpanded; }
-                       set
-                       {
-                               if (value == isExpanded)
-                                       return;
-                               isExpanded = value;
-                               NotifyValueChanged ("IsExpanded", isExpanded);
-                       }
-               }
-               public StyleContainer(string name, Style _style){
-                       Name = name;
-                       style = _style;
-
-                       Items = new List<StyleItemContainer> ();
-                       foreach (string k in style.Keys) {
-                               Items.Add(new StyleItemContainer(k, style[k]));
-                       }
-               }
-       }
-
-
-       /// <summary>
-/// .sln loaded into class.
-/// </summary>
-       public class Solution: IValueChange
-       {
-               #region IValueChange implementation
-               public event EventHandler<ValueChangeEventArgs> ValueChanged;
-               public virtual void NotifyValueChanged(string MemberName, object _value)
-               {
-                       ValueChanged.Raise(this, new ValueChangeEventArgs(MemberName, _value));
-               }
-               #endregion
-
-               ProjectItem selectedItem = null;
-               object selectedItemElement = null;
-               ObservableList<ProjectItem> openedItems = new ObservableList<ProjectItem>();
-               ObservableList<GraphicObjectDesignContainer> toolboxItems;
-
-               public Dictionary<string, Style> Styling;
-               public Dictionary<string, string> DefaultTemplates;
-
-               public List<Style> Styles { get { return Styling.Values.ToList(); }}
-               public List<StyleContainer> StylingContainers;
-               //TODO: check project dependencies if no startup proj
-
-               public void ReloadStyling () {
-                       Styling = new Dictionary<string, Style> ();
-                       if (StartupProject != null)
-                               StartupProject.GetStyling ();
-                       StylingContainers = new List<StyleContainer> ();
-                       foreach (string k in Styling.Keys) 
-                               StylingContainers.Add (new StyleContainer (k, Styling [k]));
-                       foreach (ImlProjectItem pf in openedItems.OfType<ImlProjectItem>()) {
-                               pf.SignalEditorOfType<ImlVisualEditor> ();
-                       }
-               }
-               public string[] AvailaibleStyles {
-                       get { return Styling == null ? new string[] {} : Styling.Keys.ToArray();}
-               }
-               public void ReloadDefaultTemplates () {
-                       DefaultTemplates = new Dictionary<string, string>();
-                       if (StartupProject != null)
-                               StartupProject.GetDefaultTemplates ();
-               }
-               public void updateToolboxItems () {
-                       Type[] crowItems = AppDomain.CurrentDomain.GetAssemblies ()
-                               .SelectMany (t => t.GetTypes ())
-                               .Where (t => t.IsClass && !t.IsAbstract && t.IsPublic &&                                        
-                                       t.Namespace == "Crow" && t.IsSubclassOf(typeof(Widget)) &&
-                                       t.GetCustomAttribute<DesignIgnore>(false) == null).ToArray ();
-                       ToolboxItems = new ObservableList<GraphicObjectDesignContainer> ();
-                       foreach (Type ci in crowItems) {
-                               toolboxItems.AddElement(new GraphicObjectDesignContainer(ci));
-                       }
-               }
-               public bool GetProjectFileFromPath (string path, out ProjectFile pi){
-                       pi = null;
-                       return StartupProject == null ? false :
-                               StartupProject.TryGetProjectFileFromPath (path, out pi);
-               }
-
-               public ObservableList<ProjectItem> OpenedItems {
-                       get { return openedItems; }
-                       set {
-                               if (openedItems == value)
-                                       return;
-                               openedItems = value;
-                               NotifyValueChanged ("OpenedItems", openedItems);
-                       }
-               }
-
-               public ObservableList<GraphicObjectDesignContainer> ToolboxItems {
-                       get { return toolboxItems; }
-                       set {
-                               if (toolboxItems == value)
-                                       return;
-                               toolboxItems = value;
-                               NotifyValueChanged ("ToolboxItems", toolboxItems);
-                       }                       
-               }
-               public ProjectItem SelectedItem {
-                       get { return selectedItem; }
-                       set {
-                               if (selectedItem == value)
-                                       return;
-                               if (SelectedItem != null)
-                                       SelectedItem.IsSelected = false;
-                               selectedItem = value;
-                               if (SelectedItem != null) 
-                                       SelectedItem.IsSelected = true;
-
-                               UserConfig.Set ("SelectedProjItems", SelectedItem?.AbsolutePath);
-
-                               NotifyValueChanged ("SelectedItem", selectedItem);
-                       }
-               }
-               public object SelectedItemElement {
-                       get { return selectedItemElement; }
-                       set {
-                               if (selectedItemElement == value)
-                                       return;
-                               selectedItemElement = value;
-                               NotifyValueChanged ("SelectedItemElement", selectedItemElement);
-                       }
-               }
-               public string DisplayName {
-                       get { return name; }
-               }
-               /// <summary>
-               /// Gets solution path
-               /// </summary>
-               public String SolutionFolder
-               {
-                       get { return Path.GetDirectoryName (path); }
-               }
-
-//             public System.CodeDom.Compiler.CompilerErrorCollection CompilationErrors {
-//                     get {
-//                             System.CodeDom.Compiler.CompilerErrorCollection tmp = Projects.SelectMany<Project>
-//                                     (p => p.CompilationResults.Errors);
-//                             return tmp;
-//                     }
-//             }
-               public List<System.CodeDom.Compiler.CompilerError> CompilerErrors {
-                       get {
-                               int errCount = 0;
-                               for (int i = 0; i < Projects.Count; i++) {
-                                       if (Projects [i].CompilationResults != null)
-                                               errCount += Projects [i].CompilationResults.Errors.Count;
-                               }
-                               System.CodeDom.Compiler.CompilerError[] tmp = new System.CodeDom.Compiler.CompilerError[errCount];
-
-                               int ptr = 0;
-                               for (int i = 0; i < Projects.Count; i++) {
-                                       if (Projects [i].CompilationResults == null)
-                                               continue;
-                                       Projects [i].CompilationResults.Errors.CopyTo (tmp,ptr);
-                                       ptr += Projects [i].CompilationResults.Errors.Count;
-                               }
-                               return new List<System.CodeDom.Compiler.CompilerError>(tmp);
-                       }
-               }
-
-               public void UpdateErrorList () {
-                       NotifyValueChanged ("CompilerErrors", CompilerErrors);
-               }
-
-               void saveOpenedItemsInUserConfig (){
-                       if (openedItems.Count == 0)
-                               UserConfig.Set ("OpenedItems", "");
-                       else
-                               UserConfig.Set ("OpenedItems", openedItems.Select(o => o.AbsolutePath).Aggregate((a,b)=>a + ";" + b));
-               }
-               public void ReopenItemsSavedInUserConfig () {
-                       string tmp = UserConfig.Get<string> ("OpenedItems");
-                       string sel = UserConfig.Get<string> ("SelectedProjItems");
-                       ProjectFile selItem = null;
-                       if (string.IsNullOrEmpty (tmp))
-                               return;
-                       foreach (string f in tmp.Split(';')) {
-                               foreach (Project p in Projects) {
-                                       ProjectFile pi;
-                                       if (p.TryGetProjectFileFromAbsolutePath (f, out pi)) {
-                                               pi.Open ();
-                                               if (pi.AbsolutePath == sel)
-                                                       selItem = pi;
-                                               break;
-                                       }
-                               }
-                       }
-                       if (selItem == null)
-                               return;
-                       selItem.IsSelected = true;
-               }
-
-               /*void onSelectedItemChanged (object sender, SelectionChangeEventArgs e){                                                       
-                       SelectedItem = e.NewValue as ProjectItem;
-                       UserConfig.Set ("SelectedProjItems", SelectedItem?.AbsolutePath);
-               }*/
-
-               public void OpenItem (ProjectItem pi) {
-                       if (!openedItems.Contains (pi)) {
-                               openedItems.AddElement (pi);
-                               saveOpenedItemsInUserConfig ();
-                       }
-               }
-               public void CloseItem (ProjectItem pi) {                        
-                       openedItems.RemoveElement (pi);
-                       saveOpenedItemsInUserConfig ();
-               }
-
-               public void CloseSolution () {
-                       while (openedItems.Count > 0) {
-                               openedItems.RemoveElement (openedItems [0]);
-                       }
-                       while (toolboxItems.Count > 0) {
-                               toolboxItems.RemoveElement (toolboxItems [0]);
-                       }
-                       NotifyValueChanged ("Projects", null);
-               }
-           /// <summary>
-           /// Solution name
-           /// </summary>
-           String name;
-               /// <summary>
-               /// File path from where solution was loaded.
-               /// </summary>
-               [XmlIgnore]
-               String path;
-
-           /// <summary>
-           /// Solution name for debugger.
-           /// </summary>
-           [ExcludeFromCodeCoverage]
-           public override string ToString()
-           {
-               return "Solution: " + name;
-           }
-                       
-               #region Solution properties
-           double slnVer;                                      // 11.00 - vs2010, 12.00 - vs2015
-
-           /// <summary>
-           /// Visual studio version information used for generation, for example 2010, 2012, 2015 and so on...
-           /// </summary>
-           public int fileFormatVersion;
-
-           /// <summary>
-           /// null for old visual studio's
-           /// </summary>
-           public String VisualStudioVersion;
-           
-           /// <summary>
-           /// null for old visual studio's
-           /// </summary>
-           public String MinimumVisualStudioVersion;
-
-           /// <summary>
-           /// List of project included into solution.
-           /// </summary>
-           public List<Project> Projects = new List<Project>();
-
-           /// <summary>
-           /// List of configuration list, in form "{Configuration}|{Platform}", for example "Release|Win32".
-           /// To extract individual platforms / configuration list, use following functions.
-           /// </summary>
-           public List<String> configurations = new List<string>();
-
-           /// <summary>
-           /// Extracts platfroms supported by solution
-           /// </summary>
-           public IEnumerable<String> getPlatforms()
-           {
-               return configurations.Select(x => x.Split('|')[1]).Distinct();
-           }
-
-           /// <summary>
-           /// Extracts configuration names supported by solution
-           /// </summary>
-           public IEnumerable<String> getConfigurations()
-           {
-               return configurations.Select(x => x.Split('|')[0]).Distinct();
-           }
-               #endregion
-
-               public Configuration UserConfig;
-
-               public Project StartupProject {
-                       get { return Projects?.FirstOrDefault (p => p.ProjectGuid == UserConfig.Get<string> ("StartupProject")); }
-                       set {
-                               if (value == StartupProject)
-                                       return;
-                               if (value == null)
-                                       UserConfig.Set ("StartupProject", "");
-                               else {
-                                       UserConfig.Set ("StartupProject", value.ProjectGuid);
-                                       value.NotifyValueChanged("IsStartupProject", true);
-                               }
-                               NotifyValueChanged ("StartupProject", StartupProject);
-                               ReloadStyling ();
-                               ReloadDefaultTemplates ();
-                       }
-               }
-
-               #region CTOR
-           /// <summary>
-           /// Creates new solution.
-           /// </summary>
-           public Solution() { 
-               }
-
-               #endregion
-
-
-               #region Loading from SLN file   
-           /// <summary>
-           /// Loads visual studio .sln solution
-           /// </summary>
-           /// <exception cref="System.IO.FileNotFoundException">The file specified in path was not found.</exception>
-           static public Solution LoadSolution(string path)
-           {
-               Solution s = new Solution();
-               s.path = path;
-
-               String slnTxt = File.ReadAllText(path);
-               //
-               //  Extra line feed is used by Visual studio, cmake does not generate extra line feed.
-               //
-               s.slnVer = Double.Parse(Regex.Match(slnTxt, "[\r\n]?Microsoft Visual Studio Solution File, Format Version ([0-9.]+)", RegexOptions.Multiline).Groups[1].Value, CultureInfo.InvariantCulture);
-
-               int vsNumber = Int32.Parse(Regex.Match(slnTxt, "^\\# Visual Studio (Express )?([0-9]+)", RegexOptions.Multiline).Groups[2].Value);
-               if (vsNumber > 2000)
-                   s.fileFormatVersion = vsNumber;
-               else
-                   s.fileFormatVersion = vsNumber - 14 + 2015;     // Visual Studio 14 => vs2015, formula might not be applicable for future vs versions.
-
-               foreach (String line in new String[] { "VisualStudioVersion", "MinimumVisualStudioVersion" })
-               {
-                   var m = Regex.Match(slnTxt, "^" + line + " = ([0-9.]+)", RegexOptions.Multiline);
-                   String v = null;
-                   if (m.Success)
-                       v = m.Groups[1].Value;
-
-                   s.GetType().GetField(line).SetValue(s, v);
-               }
-
-               Regex reProjects = new Regex(
-                   "Project\\(\"(?<ProjectHostGuid>{[A-F0-9-]+})\"\\) = \"(?<ProjectName>.*?)\", \"(?<RelativePath>.*?)\", \"(?<ProjectGuid>{[A-F0-9-]+})\"[\r\n]*(?<dependencies>.*?)EndProject[\r\n]+",
-                   RegexOptions.Singleline);
-
-
-               reProjects.Replace(slnTxt, new MatchEvaluator(m =>
-               {
-                   SolutionProject p = new SolutionProject ();
-
-                   foreach (String g in reProjects.GetGroupNames())
-                   {
-                       if (g == "0")   //"0" - RegEx special kind of group
-                           continue;
-
-                       //
-                       // ProjectHostGuid, ProjectName, RelativePath, ProjectGuid fields/properties are set here.
-                       //
-                       String v = m.Groups[g].ToString();
-                       if (g != "dependencies")
-                       {
-                           FieldInfo fi = p.GetType().GetField(g);
-                           if (fi != null)
-                           {
-                               fi.SetValue(p, v);
-                           }
-                           else
-                           {
-                               p.GetType().GetProperty(g).SetValue(p, v);
-                           }
-                           continue;
-                       }
-
-                       if (v == "")    // No dependencies set
-                           continue;
-
-                       String depsv = new Regex("ProjectSection\\(ProjectDependencies\\)[^\r\n]*?[\r\n]+" + "(.*?)" + "EndProjectSection", RegexOptions.Singleline).Match(v).Groups[1].Value;
-
-                       //
-                       // key is always equal to it's value.
-                       // http://stackoverflow.com/questions/5629981/question-about-visual-studio-sln-file-format
-                       //
-                       var ProjectDependencies = new Regex("\\s*?({[A-F0-9-]+}) = ({[A-F0-9-]+})[\r\n]+", RegexOptions.Multiline).Matches(depsv).Cast<Match>().Select(x => x.Groups[1].Value).ToList();
-                   } //foreach
-                               s.Projects.Add(new Project (s, p));
-                   return "";
-               }
-               )
-               );
-
-               new Regex("GlobalSection\\(SolutionConfigurationPlatforms\\).*?[\r\n]+(.*?)EndGlobalSection[\r\n]+", RegexOptions.Singleline).Replace(slnTxt, new MatchEvaluator(m2 =>
-               {
-                   s.configurations = new Regex("\\s*(.*)\\s+=").Matches(m2.Groups[1].ToString()).Cast<Match>().Select(x => x.Groups[1].Value).ToList();
-                   return "";
-               }
-               ));
-
-                       Console.WriteLine ("******** CONFIG ***************");
-
-               new Regex("GlobalSection\\(ProjectConfigurationPlatforms\\).*?[\r\n]+(.*?)EndGlobalSection[\r\n]+", RegexOptions.Singleline).Replace(slnTxt, new MatchEvaluator(m2 =>
-               {
-                   foreach (Match m3 in new Regex("\\s*({[A-F0-9-]+})\\.(.*?)\\.(.*?)\\s+=\\s+(.*?)[\r\n]+").Matches(m2.Groups[1].ToString()))
-                   {
-                       String guid = m3.Groups[1].Value;
-                       String solutionConfig = m3.Groups[2].Value;
-                       String action = m3.Groups[3].Value;
-                       String projectConfig = m3.Groups[4].Value;
-
-                       Project p = s.Projects.Where(x => x.ProjectGuid == guid).FirstOrDefault();
-                       if (p == null)
-                           continue;
-
-                                               Console.WriteLine ("{0},{1},{2},{3}",guid,solutionConfig,action,projectConfig);
-
-                       int iConfigIndex = s.configurations.IndexOf(solutionConfig);
-                       if (iConfigIndex == -1)
-                           continue;
-
-//                     while (p.slnConfigurations.Count < s.configurations.Count)
-//                     {
-//                         p.slnConfigurations.Add(null);
-//                         p.slnBuildProject.Add(false);
-//                     }
-//
-//                     if (action == "ActiveCfg")
-//                     {
-//                         p.slnConfigurations[iConfigIndex] = projectConfig;
-//                     }
-//                     else
-//                     {
-//                         if (action.StartsWith("Build"))
-//                         {
-//                             p.slnBuildProject[iConfigIndex] = true;
-//                         }
-//                         else
-//                         {
-//                             if (action.StartsWith("Deploy"))
-//                             {
-//                                 if (p.slnDeployProject == null) p.slnDeployProject = new List<bool?>();
-//
-//                                 while (p.slnDeployProject.Count < s.configurations.Count)
-//                                     p.slnDeployProject.Add(null);
-//
-//                                 p.slnDeployProject[iConfigIndex] = true;
-//                             }
-//                         }
-//                     } //if-esle
-                   }
-                   return "";
-               }
-               ));
-
-               //
-               // Initializes parent-child relationship.
-               //
-               new Regex("GlobalSection\\(NestedProjects\\).*?[\r\n]+(.*?)EndGlobalSection[\r\n]+", RegexOptions.Singleline).Replace(slnTxt, new MatchEvaluator(m4 =>
-               {
-                   String v = m4.Groups[1].Value;
-                   new Regex("\\s*?({[A-F0-9-]+}) = ({[A-F0-9-]+})[\r\n]+", RegexOptions.Multiline).Replace(v, new MatchEvaluator(m5 =>
-                   {
-                       String[] args = m5.Groups.Cast<System.Text.RegularExpressions.Group>().Skip(1).Select(x => x.Value).ToArray();
-                       Project child = s.Projects.Where(x => args[0] == x.ProjectGuid).FirstOrDefault();
-                       Project parent = s.Projects.Where(x => args[1] == x.ProjectGuid).FirstOrDefault();
-                       parent.dependantProjects.Add(child);
-                       child.ParentProject = parent;
-                       return "";
-                   }));
-                   return "";
-               }
-               ));
-
-                       s.UserConfig = new Configuration (s.path + ".user");
-                       s.ReloadStyling ();
-                       s.ReloadDefaultTemplates ();
-                       s.updateToolboxItems ();
-               return s;
-           } //LoadSolution
-               #endregion
-       } 
-}
diff --git a/CrowIDE/src/Workspace.cs b/CrowIDE/src/Workspace.cs
new file mode 100644 (file)
index 0000000..a28d0fc
--- /dev/null
@@ -0,0 +1,384 @@
+//
+// Solution.cs
+//
+//code taken in project https://sourceforge.net/projects/syncproj/
+// no licence info was included, I took the liberty to modify it.
+// Author:
+//             tarmopikaro
+//      2018 Jean-Philippe Bruyère
+//MIT-licenced
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using Microsoft.Build.Construction;
+
+namespace Crow.Coding
+{
+       public class StyleItemContainer {
+               public object Value;
+               public string Name;
+               public StyleItemContainer(string name, object _value){
+                       Name = name;
+                       Value = _value;
+               }
+       }
+       public class StyleContainer : IValueChange {
+               #region IValueChange implementation
+               public event EventHandler<ValueChangeEventArgs> ValueChanged;
+               public virtual void NotifyValueChanged(string MemberName, object _value)
+               {
+                       ValueChanged.Raise(this, new ValueChangeEventArgs(MemberName, _value));
+               }
+               #endregion
+
+               Style style;
+               bool isExpanded;
+
+               public string Name;
+               public List<StyleItemContainer> Items;
+               public bool IsExpanded
+               {
+                       get { return isExpanded; }
+                       set
+                       {
+                               if (value == isExpanded)
+                                       return;
+                               isExpanded = value;
+                               NotifyValueChanged ("IsExpanded", isExpanded);
+                       }
+               }
+               public StyleContainer(string name, Style _style){
+                       Name = name;
+                       style = _style;
+
+                       Items = new List<StyleItemContainer> ();
+                       foreach (string k in style.Keys) {
+                               Items.Add(new StyleItemContainer(k, style[k]));
+                       }
+               }
+       }
+
+
+       /// <summary>
+/// .sln loaded into class.
+/// </summary>
+       public class Workspace: IValueChange
+       {
+               #region IValueChange implementation
+               public event EventHandler<ValueChangeEventArgs> ValueChanged;
+               public virtual void NotifyValueChanged(string MemberName, object _value)
+               {
+                       ValueChanged.Raise(this, new ValueChangeEventArgs(MemberName, _value));
+               }
+               #endregion
+
+               SolutionFile solutionFile;
+
+               ProjectItem selectedItem = null;
+               object selectedItemElement = null;
+               ObservableList<ProjectItem> openedItems = new ObservableList<ProjectItem>();
+               ObservableList<GraphicObjectDesignContainer> toolboxItems;
+
+               public Dictionary<string, Style> Styling;
+               public Dictionary<string, string> DefaultTemplates;
+
+               public List<Style> Styles { get { return Styling.Values.ToList(); }}
+               public List<StyleContainer> StylingContainers;
+               //TODO: check project dependencies if no startup proj
+
+               public void ReloadStyling () {
+                       Styling = new Dictionary<string, Style> ();
+                       if (StartupProject != null)
+                               StartupProject.GetStyling ();
+                       StylingContainers = new List<StyleContainer> ();
+                       foreach (string k in Styling.Keys) 
+                               StylingContainers.Add (new StyleContainer (k, Styling [k]));
+                       foreach (ImlProjectItem pf in openedItems.OfType<ImlProjectItem>()) {
+                               pf.SignalEditorOfType<ImlVisualEditor> ();
+                       }
+               }
+               public string[] AvailaibleStyles {
+                       get { return Styling == null ? new string[] {} : Styling.Keys.ToArray();}
+               }
+               public void ReloadDefaultTemplates () {
+                       DefaultTemplates = new Dictionary<string, string>();
+                       if (StartupProject != null)
+                               StartupProject.GetDefaultTemplates ();
+               }
+               public void updateToolboxItems () {
+                       Type[] crowItems = AppDomain.CurrentDomain.GetAssemblies ()
+                               .SelectMany (t => t.GetTypes ())
+                               .Where (t => t.IsClass && !t.IsAbstract && t.IsPublic &&                                        
+                                       t.Namespace == "Crow" && t.IsSubclassOf(typeof(Widget)) &&
+                                       t.GetCustomAttribute<DesignIgnore>(false) == null).ToArray ();
+                       ToolboxItems = new ObservableList<GraphicObjectDesignContainer> ();
+                       foreach (Type ci in crowItems) {
+                               toolboxItems.AddElement(new GraphicObjectDesignContainer(ci));
+                       }
+               }
+               public bool GetProjectFileFromPath (string path, out ProjectFile pi){
+                       pi = null;
+                       return false;/* StartupProject == null ? false :
+                               StartupProject.TryGetProjectFileFromPath (path, out pi);*/
+               }
+
+               public ObservableList<ProjectItem> OpenedItems {
+                       get { return openedItems; }
+                       set {
+                               if (openedItems == value)
+                                       return;
+                               openedItems = value;
+                               NotifyValueChanged ("OpenedItems", openedItems);
+                       }
+               }
+
+               public ObservableList<GraphicObjectDesignContainer> ToolboxItems {
+                       get { return toolboxItems; }
+                       set {
+                               if (toolboxItems == value)
+                                       return;
+                               toolboxItems = value;
+                               NotifyValueChanged ("ToolboxItems", toolboxItems);
+                       }                       
+               }
+               public ProjectItem SelectedItem {
+                       get { return selectedItem; }
+                       set {
+                               if (selectedItem == value)
+                                       return;
+                               if (SelectedItem != null)
+                                       SelectedItem.IsSelected = false;
+                               selectedItem = value;
+                               if (SelectedItem != null) 
+                                       SelectedItem.IsSelected = true;
+
+                               //UserConfig.Set ("SelectedProjItems", SelectedItem?.AbsolutePath);
+
+                               NotifyValueChanged ("SelectedItem", selectedItem);
+                       }
+               }
+               public object SelectedItemElement {
+                       get { return selectedItemElement; }
+                       set {
+                               if (selectedItemElement == value)
+                                       return;
+                               selectedItemElement = value;
+                               NotifyValueChanged ("SelectedItemElement", selectedItemElement);
+                       }
+               }
+               public string DisplayName {
+                       get { return name; }
+               }
+               /// <summary>
+               /// Gets solution path
+               /// </summary>
+               public String SolutionFolder
+               {
+                       get { return Path.GetDirectoryName (path); }
+               }
+
+//             public System.CodeDom.Compiler.CompilerErrorCollection CompilationErrors {
+//                     get {
+//                             System.CodeDom.Compiler.CompilerErrorCollection tmp = Projects.SelectMany<Project>
+//                                     (p => p.CompilationResults.Errors);
+//                             return tmp;
+//                     }
+//             }
+               public List<System.CodeDom.Compiler.CompilerError> CompilerErrors {
+                       get {
+                               int errCount = 0;
+                               for (int i = 0; i < Projects.Count; i++) {
+                                       if (Projects [i].CompilationResults != null)
+                                               errCount += Projects [i].CompilationResults.Errors.Count;
+                               }
+                               System.CodeDom.Compiler.CompilerError[] tmp = new System.CodeDom.Compiler.CompilerError[errCount];
+
+                               int ptr = 0;
+                               for (int i = 0; i < Projects.Count; i++) {
+                                       if (Projects [i].CompilationResults == null)
+                                               continue;
+                                       Projects [i].CompilationResults.Errors.CopyTo (tmp,ptr);
+                                       ptr += Projects [i].CompilationResults.Errors.Count;
+                               }
+                               return new List<System.CodeDom.Compiler.CompilerError>(tmp);
+                       }
+               }
+
+               public void UpdateErrorList () {
+                       NotifyValueChanged ("CompilerErrors", CompilerErrors);
+               }
+
+               void saveOpenedItemsInUserConfig (){
+                       if (openedItems.Count == 0)
+                               UserConfig.Set ("OpenedItems", "");
+                       else
+                               UserConfig.Set ("OpenedItems", openedItems.Select(o => o.AbsolutePath).Aggregate((a,b)=>a + ";" + b));
+               }
+               public void ReopenItemsSavedInUserConfig () {
+                       string tmp = UserConfig.Get<string> ("OpenedItems");
+                       string sel = UserConfig.Get<string> ("SelectedProjItems");
+                       ProjectFile selItem = null;
+                       if (string.IsNullOrEmpty (tmp))
+                               return;
+                       foreach (string f in tmp.Split(';')) {
+                               foreach (Project p in Projects) {
+                                       ProjectFile pi;
+                                       /*if (p.TryGetProjectFileFromAbsolutePath (f, out pi)) {
+                                               pi.Open ();
+                                               if (pi.AbsolutePath == sel)
+                                                       selItem = pi;
+                                               break;
+                                       }*/
+                               }
+                       }
+                       if (selItem == null)
+                               return;
+                       selItem.IsSelected = true;
+               }
+
+               /*void onSelectedItemChanged (object sender, SelectionChangeEventArgs e){                                                       
+                       SelectedItem = e.NewValue as ProjectItem;
+                       UserConfig.Set ("SelectedProjItems", SelectedItem?.AbsolutePath);
+               }*/
+
+               public void OpenItem (ProjectItem pi) {
+                       if (!openedItems.Contains (pi)) {
+                               openedItems.AddElement (pi);
+                               saveOpenedItemsInUserConfig ();
+                       }
+               }
+               public void CloseItem (ProjectItem pi) {                        
+                       openedItems.RemoveElement (pi);
+                       saveOpenedItemsInUserConfig ();
+               }
+
+               public void CloseSolution () {
+                       while (openedItems.Count > 0) {
+                               openedItems.RemoveElement (openedItems [0]);
+                       }
+                       while (toolboxItems?.Count > 0) {
+                               toolboxItems.RemoveElement (toolboxItems [0]);
+                       }
+                       NotifyValueChanged ("Projects", null);
+               }
+           /// <summary>
+           /// Solution name
+           /// </summary>
+           String name;
+               /// <summary>
+               /// File path from where solution was loaded.
+               /// </summary>
+               [XmlIgnore]
+               String path;
+
+           /// <summary>
+           /// Solution name for debugger.
+           /// </summary>
+           [ExcludeFromCodeCoverage]
+           public override string ToString()
+           {
+               return "Solution: " + name;
+           }
+                       
+               #region Solution properties
+           double slnVer;                                      // 11.00 - vs2010, 12.00 - vs2015
+
+           /// <summary>
+           /// Visual studio version information used for generation, for example 2010, 2012, 2015 and so on...
+           /// </summary>
+           public int fileFormatVersion;
+
+           /// <summary>
+           /// null for old visual studio's
+           /// </summary>
+           public String VisualStudioVersion;
+           
+           /// <summary>
+           /// null for old visual studio's
+           /// </summary>
+           public String MinimumVisualStudioVersion;
+
+           /// <summary>
+           /// List of project included into solution.
+           /// </summary>
+           public List<Project> Projects = new List<Project>();
+
+           /// <summary>
+           /// List of configuration list, in form "{Configuration}|{Platform}", for example "Release|Win32".
+           /// To extract individual platforms / configuration list, use following functions.
+           /// </summary>
+           public List<String> configurations = new List<string>();
+
+           /// <summary>
+           /// Extracts platfroms supported by solution
+           /// </summary>
+           public IEnumerable<String> getPlatforms()
+           {
+               return configurations.Select(x => x.Split('|')[1]).Distinct();
+           }
+
+           /// <summary>
+           /// Extracts configuration names supported by solution
+           /// </summary>
+           public IEnumerable<String> getConfigurations()
+           {
+               return configurations.Select(x => x.Split('|')[0]).Distinct();
+           }
+               #endregion
+
+               public Configuration UserConfig;
+
+               public Project StartupProject {
+                       get { return null; }// Projects?.FirstOrDefault (p => p.ProjectGuid == UserConfig.Get<string> ("StartupProject")); }
+                       set {
+                               if (value == StartupProject)
+                                       return;
+                               if (value == null)
+                                       UserConfig.Set ("StartupProject", "");
+                               else {
+                                       UserConfig.Set ("StartupProject", value.ProjectGuid);
+                                       value.NotifyValueChanged("IsStartupProject", true);
+                               }
+                               NotifyValueChanged ("StartupProject", StartupProject);
+                               ReloadStyling ();
+                               ReloadDefaultTemplates ();
+                       }
+               }
+
+               #region CTOR
+               /// <summary>
+               /// Creates new solution.
+               /// </summary>
+               public Workspace (string path)
+               {
+                       this.path = path;
+                       solutionFile = SolutionFile.Parse (path);
+                       UserConfig = new Configuration (path + ".user");
+
+                       foreach (ProjectInSolution pis in solutionFile.ProjectsInOrder) {
+                               switch (pis.ProjectType) {
+                               case SolutionProjectType.Unknown:
+                                       break;
+                               case SolutionProjectType.KnownToBeMSBuildFormat:
+                                       Projects.Add (new Project (this, pis));
+                                       break;
+                               case SolutionProjectType.SolutionFolder:
+                                       break;
+                               case SolutionProjectType.WebProject:
+                                       break;
+                               case SolutionProjectType.WebDeploymentProject:
+                                       break;
+                               case SolutionProjectType.EtpSubProject:
+                                       break;
+                               case SolutionProjectType.SharedProject:
+                                       break;
+                               }
+                       }
+               }
+               #endregion
+       }
+}
index a9d48fc98b9b5c58e1eb35eb6a141862de754fb0..14a1a2adcbbfb386f87312e3aba21a3d3cfdaa2e 100644 (file)
@@ -1,13 +1,42 @@
-using Crow;
+using System;
+using Crow;
 
 namespace HelloWorld
 {
        class Program : Interface {
+               Command CMDQuit;
                static void Main (string[] args) {
                        using (Program vke = new Program ()) {
-                               vke.Load ("#HelloWorld.helloworld.crow");
                                vke.Run ();
                        }
                }
+               protected override void Startup ()
+               {
+                       CMDQuit = new Command (new Action (() => running = false)) { Caption = "Quit", Icon = new SvgPicture ("#Crow.Icons.exit-symbol.svg") };
+
+                       Widget w = Load ("#HelloWorld.helloworld.crow");
+                       w.KeyPress += W_KeyPress;
+                       w.DataSource = this;
+               }
+
+               Color [] colors = { Color.Blue, Color.DarkGoldenRod, Color.Red, Color.Azure, Color.Brown, Color.Black, Color.White, Color.Pink };
+               int ptr = 0;
+
+               void W_KeyPress (object sender, KeyPressEventArgs e)
+               {
+                       switch (e.KeyChar) {
+                       case 'w':
+                               LoadIMLFragment ($"<DockWindow Name='win{ptr}' Left='450' Top='450' Width='150' Height='150' Background='{colors [ptr]}'/>");
+                               break;
+                       case 'x':
+                               LoadIMLFragment ($"<Window Name='win{ptr}' Left='450' Top='450' Width='150' Height='150' Background='{colors [ptr]}'/>");
+                               break;
+                       }
+
+                       ptr++;
+                       if (ptr == colors.Length)
+                               ptr = 0;
+               }
+
        }
 }
index c6ffc40877919f289c9496c89dc3fe5b28d87104..a2b263fe25f7beaf247b530858ff0a2004793c52 100644 (file)
@@ -45,18 +45,22 @@ namespace tests
                        using (Showcase app = new Showcase ()) {
                                //app.Keyboard.KeyDown += App_KeyboardKeyDown;
 
-                               Widget g = app.Load ("#ShowCase.showcase.crow");
-                               g.DataSource = app;
-                               app.crowContainer = g.FindByName ("CrowContainer") as Container;
-                               //I set an empty object as datasource at this level to force update when new
-                               //widgets are added to the interface
-                               app.crowContainer.DataSource = new object ();
-                               app.hideError ();
                                app.Run ();
 
                        }
                }
 
+               protected override void Startup ()
+               {
+                       Widget g = Load ("#ShowCase.showcase.crow");
+                       g.DataSource = this;
+                       crowContainer = g.FindByName ("CrowContainer") as Container;
+                       //I set an empty object as datasource at this level to force update when new
+                       //widgets are added to the interface
+                       crowContainer.DataSource = new object ();
+                       hideError ();
+               }
+
                static void App_KeyboardKeyDown (object sender, KeyEventArgs e)
                {
 #if DEBUG_LOG
index 19af5237fabeecd0a11d06121f4b1fde4801cfdc..df935b1dbf91ed34d2ef43f4afef09c72e8251d0 100755 (executable)
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<Container Background="Yellow" Margin="10" Width="90%" Height="90%">
-       <Widget Margin="10" Width="50%" Height="50%" Background="Yellow"
+<Container Background="Blue" Margin="1" Width="90%" Height="90%">
+       <Widget Margin="1" Width="50%" Height="50%" Background="Red"
                        MinimumSize="50,50"/>
 </Container>
\ No newline at end of file
index 94655ca3c807f4f574c358e690fc33463ddebdd4..5ca515a86066a368c4f454d716112b153322463b 100755 (executable)
@@ -1,4 +1,4 @@
 <?xml version="1.0"?>
-<Container Background="DimGrey" Margin="10" Fit="true">
-       <Label Text="{fps}" Margin="10" Fit="true" Background="SeaGreen"/>
+<Container Background="Blue" Margin="10" Fit="true">
+       <Label Text="tes" Margin="10" Fit="true" Background="SeaGreen"/>
 </Container>
\ No newline at end of file
index d8991c71f8f4754836dcf7a89e93a001d56cd70b..5d8f226cb3234a0a61dfaa81b5c2dd3858bc8e5b 100755 (executable)
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
 <VerticalStack Fit="true">
        <TextBox Text="{Datas}" Width="100" />
-       <Button Text="Set Text to Null" MouseClick="onSetDataToNull"/>
+       <Button Caption="Set Text to Null" MouseClick="onSetDataToNull"/>
 </VerticalStack>
\ No newline at end of file
index 47adb8ceb1396f024ce2f1c91c53a6b845a9fbf9..90fccf4f785ccfde3ff1af3ffca59af705dc8e35 100755 (executable)
@@ -6,7 +6,7 @@
                <Label Text="{Hover}" Background="DarkGreen"/>
                <Button Caption="Clear" Width="Stretched" MouseClick="OnClear"/>
                <ListBox Name="ColorList" Data="{TestList}"  Width="200" Height="200" 
-                                        ItemTemplate="#Tests.Interfaces.colorItem.crow">                       
+                                        ItemTemplate="Interfaces/colorItem.crow">                      
                </ListBox>
                <Button Caption="Load list" Width="Stretched" MouseClick="OnLoadList"/>
        </VerticalStack>
index 4363986e79f4d50088f2ee72a5b0d0d79af22d5d..4bfb41fbdf0f9398eac9292b3a0f185b7f1bf13f 100755 (executable)
@@ -1,4 +1,4 @@
 <?xml version="1.0"?>
 <Container Background="DimGrey" Width="300">
-       <ComboBox  Data="{TestList}" ItemTemplate="#Tests.Interfaces.colorItem.crow"/>
+       <ComboBox  Data="{TestList}" ItemTemplate="Interfaces/colorItem.crow"/>
 </Container>
\ No newline at end of file