]> O.S.I.I.S - jp/crow.git/commitdiff
update with msbuild
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Thu, 6 Feb 2020 06:51:27 +0000 (07:51 +0100)
committerj-p <jp_bruyere@hotmail.com>
Sat, 9 May 2020 22:50:02 +0000 (00:50 +0200)
29 files changed:
Crow.sln
Crow/Crow.csproj
Crow/Icons/crowproj.svg
Crow/src/Interface.cs
Crow/src/ObservableList.cs
Crow/src/StyleReader.cs
Crow/src/Widgets/DockWindow.cs
Crow/src/Widgets/Group.cs
Crow/src/Widgets/ScrollingObject.cs
Directory.Build.props
Samples/BasicTests/BasicTests.cs
Samples/BasicTests/BasicTests.csproj
Samples/common/ui/Interfaces/Group/5.crow [new file with mode: 0644]
Samples/common/ui/templates/CheckBox2.imlt [new file with mode: 0644]
Samples/common/ui/templates/TabItem.template [new file with mode: 0644]
Samples/common/ui/templates/TmpExpandable.goml [new file with mode: 0644]
Samples/common/ui/templates/colorItem.crow [new file with mode: 0644]
Samples/common/ui/templates/colorItem2.crow [new file with mode: 0644]
Samples/common/ui/templates/itemTmp.goml [new file with mode: 0644]
Samples/common/ui/templates/log.xml [new file with mode: 0644]
Samples/common/ui/templates/perfMsr.crow [new file with mode: 0644]
Samples/common/ui/templates/test.style [new file with mode: 0644]
Samples/common/ui/templates/testMeter.goml [new file with mode: 0644]
Samples/common/ui/templates/testWindow.goml.sav [new file with mode: 0644]
Samples/common/ui/templates/tmpDirItem.goml [new file with mode: 0644]
Samples/common/ui/templates/tmpMembers.goml [new file with mode: 0644]
Samples/common/ui/templates/treeList.crow [new file with mode: 0644]
Samples/testMSBuild/Program.cs [new file with mode: 0644]
Samples/testMSBuild/testMSBuild.csproj [new file with mode: 0644]

index 0d0f0d238f0911c57960996c526f2b553152bc02..18b3f358723a38f92458a42f0679c01889bb8838 100644 (file)
--- a/Crow.sln
+++ b/Crow.sln
@@ -1,6 +1,12 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 15
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "global", "global", "{7285454A-930F-4536-AB84-C076B44C0C80}"
+       ProjectSection(SolutionItems) = preProject
+               Directory.Build.props = Directory.Build.props
+               README.md = README.md
+       EndProjectSection
+EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crow", "Crow\Crow.csproj", "{C2980F9B-4798-4C05-99E2-E174810F7C7B}"
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}"
@@ -17,6 +23,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "unitTests", "unitTests\unit
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BasicTests", "Samples\BasicTests\BasicTests.csproj", "{7AEB6DD5-916E-4415-84E1-78EC6E5881CE}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "testMSBuild", "Samples\testMSBuild\testMSBuild.csproj", "{B912DD88-F41B-428A-9784-E2CF265CE3DD}"
+EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|Any CPU = Debug|Any CPU
@@ -39,6 +47,7 @@ Global
                {91F1CE07-EECE-4F1D-A3EE-7239B563654A}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {1E5C7065-28F9-4A1A-A2FB-DB5E03A63CB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {1E5C7065-28F9-4A1A-A2FB-DB5E03A63CB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {1E5C7065-28F9-4A1A-A2FB-DB5E03A63CB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {0CC6DFAB-2E4A-4786-976C-89053D5EA6A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
                {0CC6DFAB-2E4A-4786-976C-89053D5EA6A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {0CC6DFAB-2E4A-4786-976C-89053D5EA6A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
@@ -47,6 +56,10 @@ Global
                {7AEB6DD5-916E-4415-84E1-78EC6E5881CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {7AEB6DD5-916E-4415-84E1-78EC6E5881CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {7AEB6DD5-916E-4415-84E1-78EC6E5881CE}.Release|Any CPU.Build.0 = Release|Any CPU
+               {B912DD88-F41B-428A-9784-E2CF265CE3DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {B912DD88-F41B-428A-9784-E2CF265CE3DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {B912DD88-F41B-428A-9784-E2CF265CE3DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {B912DD88-F41B-428A-9784-E2CF265CE3DD}.Release|Any CPU.Build.0 = Release|Any CPU
        EndGlobalSection
        GlobalSection(MonoDevelopProperties) = preSolution
                Policies = $0
@@ -91,5 +104,6 @@ Global
                {56329D48-D382-4850-93DE-59C453894E8A} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
                {91F1CE07-EECE-4F1D-A3EE-7239B563654A} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
                {7AEB6DD5-916E-4415-84E1-78EC6E5881CE} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
+               {B912DD88-F41B-428A-9784-E2CF265CE3DD} = {B2C7855A-2878-47FD-AD32-9A83DB4AB8C6}
        EndGlobalSection
 EndGlobal
index 185412b003ba827394c8c77e8d4cf86415de684e..27feb880c221cf7e4ba8acd0a0b72e40cf8beaab 100644 (file)
@@ -3,18 +3,18 @@
        <PropertyGroup>
                <TargetFramework>netstandard2.0</TargetFramework>
                
-               <ReleaseVersion>0.8.0</ReleaseVersion>
-               <AssemblyVersion>$(ReleaseVersion)</AssemblyVersion>            
+               <ReleaseVersion>$(CrowVersion)</ReleaseVersion>
+               <AssemblyVersion>$(CrowVersion)</AssemblyVersion>
                
                <Title>C# Rapid Open Widget Toolkit</Title>
                <Description>C.R.O.W. is a widget toolkit and rendering engine developed in C# with templates, styles, compositing, and bindings.</Description>
                <License>MIT</License>
                <Authors>Jean-Philippe Bruyère</Authors>
-               
                <RepositoryUrl>https://github.com/jpbruyere/Crow</RepositoryUrl>
                
+               <PackageVersion>$(CrowPackageVersion)</PackageVersion>
                <PackageTags>GUI Widget toolkit Interface C# .Net Mono</PackageTags>
-               <PackageVersion>$(AssemblyVersion)-beta</PackageVersion>
+               
                <PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
                <PackageProjectUrl>https://github.com/jpbruyere/Crow/wiki</PackageProjectUrl>
                <PackageLicense>https://opensource.org/licenses/MIT</PackageLicense>
                        still untested. Next beta will have a glfw backend.
                </PackageReleaseNotes>
                
-               <GeneratePackageOnBuild>True</GeneratePackageOnBuild>           
+               <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
                
-               <GenerateDocumentationFile>true</GenerateDocumentationFile>    
+               <GenerateDocumentationFile>true</GenerateDocumentationFile>
                <NoWarn>$(NoWarn);1591;1587;1570;1572;1573;1574</NoWarn>
-
-               <DefineConstants>DESIGN_MODE</DefineConstants>                          
                
+               <DefineConstants>DESIGN_MODE</DefineConstants>
                <EnableDefaultItems>false</EnableDefaultItems>
                <EnableDefaultCompileItems>false</EnableDefaultCompileItems>
-
        </PropertyGroup>
-       
        <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
                <DebugType>full</DebugType>
-               <DefineConstants>DEBUG;TRACE;_DEBUG_DISPOSE;_DEBUG_BINDING;DESIGN_MODE;_DEBUG_CLIP_RECTANGLE;_DEBUG_FOCUS;_DEBUG_DRAGNDROP;_DEBUG_LOG</DefineConstants>
+               <DefineConstants>DEBUG;TRACE;MEASURE_TIME;_DEBUG_DISPOSE;_DEBUG_BINDING;DESIGN_MODE;_DEBUG_CLIP_RECTANGLE;_DEBUG_FOCUS;_DEBUG_DRAGNDROP;_DEBUG_LOG</DefineConstants>
                <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
        </PropertyGroup>
        <ItemGroup Condition="$(TargetFramework.StartsWith('netstandard'))">
@@ -47,8 +44,8 @@
                <PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.6.0" />
                <!--<PackageReference Include="glfw-sharp" Version="0.2.0" />-->
        </ItemGroup>
-    <ItemGroup>
-        <Content Include="$(SolutionDir)Images/crow.png" Pack="true" PackagePath="" />
+       <ItemGroup>
+               <Content Include="$(SolutionDir)Images/crow.png" Pack="true" PackagePath="" />
                <Compile Include="src\**\*.cs" Exclude="src\Mono.Cairo\NativeMethods-internal.cs;src\backends\win32\User32\Structs\RawInputDevice.cs" />
                <EmbeddedResource Include="Templates\*.*">
                        <LogicalName>Crow.%(Filename).template</LogicalName>
@@ -56,4 +53,4 @@
                <EmbeddedResource Include="Default.style" />
                <EmbeddedResource Include="Icons\*.*" />
        </ItemGroup>
-</Project>
+</Project>
\ No newline at end of file
index b0f6b860e0c2cc8d571755ba288f916e1daef6a0..c45b36c61b61a8769d5cbfd5730939c28045a48b 100644 (file)
@@ -1,8 +1,8 @@
 <svg width="64" height="64" xmlns="http://www.w3.org/2000/svg">
  <!-- Created with Method Draw - http://github.com/duopixel/Method-Draw/ -->
  <g>
-  <rect opacity="1.0" rx="5" id="svg_1" height="59" width="59" y="2.5" x="2.5" stroke-width="6" stroke="#111111" fill="#bbbbcc"/>
-  <rect opacity="1.0" rx="5" id="svg_1" height="22" width="59" y="2.5" x="2.5" stroke-width="6" stroke="#111111" fill="#4455aa"/>
+  <rect opacity="1.0" rx="0" id="svg_1" height="59" width="59" y="2.5" x="2.5" stroke-width="2" stroke="#111111" fill="#bbbbcc"/>
+  <rect opacity="1.0" rx="0" id="svg_1" height="22" width="59" y="2.5" x="2.5" stroke-width="2" stroke="#111111" fill="#4455aa"/>
 <!--  <line stroke-linecap="undefined" stroke-linejoin="undefined" id="svg_2" y2="24.5" x2="61.5" y1="24.5" x1="2.5" stroke-width="6" stroke="#bbbbbb" fill="none"/>-->
  </g>
-</svg>
\ No newline at end of file
+</svg>
index d201a71446be99893136bb3e5f87e0dc892fbf25..a71e4825729d8c642801c38a203202329a819242 100644 (file)
@@ -121,7 +121,11 @@ namespace Crow
 
                        while (running) {
                                Update ();
-                               Thread.Sleep (5);
+                               Thread.Sleep (UPDATE_INTERVAL);
+#if MEASURE_TIME
+                               foreach (PerformanceMeasure m in PerfMeasures) 
+                                       m.NotifyChanges ();
+#endif
                        }
                }
                protected virtual void Startup ()
@@ -212,6 +216,8 @@ namespace Crow
                }*/
 
                #region Static and constants
+               /// <summary>Time interval in milisecond between Updates of the interface</summary>
+               public static int UPDATE_INTERVAL = 5;
                /// <summary>Crow configuration root path</summary>
                public static string CROW_CONFIG_ROOT;
                /// <summary>If true, mouse focus is given when mouse is over control</summary>
index 52ada9acfc6f643ce1d65d8d7bef645dacd04ee6..0087ea5ea5d9fa52b6f006a84878a26d94b73147 100644 (file)
@@ -20,6 +20,7 @@ namespace Crow
                public event EventHandler<ListChangedEventArg> ListAdd;
                public event EventHandler<ListChangedEventArg> ListRemove;
                public event EventHandler<ListChangedEventArg> ListEdit;
+               public event EventHandler<ListChangedEventArg> ListClear;
                #endregion
 
                public ObservableList() : base () {}
@@ -58,6 +59,11 @@ namespace Crow
                        base.RemoveAt (idx);
                        ListRemove.Raise (this, new ListChangedEventArg (idx, elem));
                }
+               public new void Clear ()
+               {
+                       base.Clear ();
+                       ListClear.Raise (this, null);
+               }
                public void Remove () {
                        if (selectedIndex < 0)
                                return;
index 16a70b80996e7a9beb73a062e0676d736da9b71c..77b8967d3697b53fd949d8cca1261cd804eb8d4e 100644 (file)
@@ -1,28 +1,6 @@
-//
-// StyleReader.cs
+// Copyright (c) 2013-2020  Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
 //
-// Author:
-//       Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
-//
-// Copyright (c) 2013-2017 Jean-Philippe Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
 
 using System;
 using System.Collections.Generic;
index 4be23adb26ef918741c9138157bb4522ce08a57d..44df3078fb8428257db179703455fd4dce9960e6 100644 (file)
@@ -1,28 +1,7 @@
-//
-// DockingView.cs
+// Copyright (c) 2013-2020  Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
 //
-// Author:
-//       Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
-//
-// Copyright (c) 2013-2017 Jean-Philippe Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
+
 using System;
 using System.Xml.Serialization;
 
index 3e3997344786a4f1a8ab2eb3f529949eab609512..6db541d6bf34333cbac54e8c2d8da1c9ce24a4ff 100644 (file)
@@ -228,19 +228,19 @@ namespace Crow
                                if (lt == LayoutingType.Width) {
                                        if (largestChild == null)
                                                searchLargestChild ();
-                                       if (largestChild == null) {
+                                       /*if (largestChild == null) {
                                                //if still null, not possible to determine a width
                                                //because all children are stretched, force first one to fit
                                                Children [0].Width = Measure.Fit;
                                                return -1;//cancel actual sizing to let child computation take place
-                                       }
+                                       }*/
                                } else {
                                        if (tallestChild == null)
                                                searchTallestChild ();
-                                       if (tallestChild == null) {
+                                       /*if (tallestChild == null) {
                                                Children [0].Height = Measure.Fit;
                                                return -1;
-                                       }
+                                       }*/
                                }
                        }
                        return base.measureRawSize (lt);
index 12804899dfc7baed69b784ca5789716ea3c0954d..579abb1ac177ba3134a6341ac7e08edc577f24ab 100644 (file)
@@ -105,11 +105,11 @@ namespace Crow
                                if (maxScrollX == value)
                                        return;
 
-                               maxScrollX = value;
+                               maxScrollX = Math.Max(0, value);
 
                                if (scrollX > maxScrollX)
                                        ScrollX = maxScrollX;
-                               
+
                                NotifyValueChanged ("MaxScrollX", maxScrollX);
                                RegisterForGraphicUpdate ();
                        }
@@ -122,7 +122,7 @@ namespace Crow
                                if (maxScrollY == value)
                                        return;
 
-                               maxScrollY = value;
+                               maxScrollY = Math.Max (0, value);
 
                                if (scrollY > maxScrollY)
                                        ScrollY = maxScrollY;
index 1f04e9b382199c34a63de78f6174f1002c98a535..719386c5aac767485e7dbc4faa5dc502491114ca 100644 (file)
@@ -6,5 +6,8 @@
                <License>MIT</License>
                <Authors>Jean-Philippe Bruyère</Authors>           
                <LangVersion>7.2</LangVersion>
+               
+               <CrowVersion>0.8.6</CrowVersion>
+               <CrowPackageVersion>$(CrowVersion)-beta</CrowPackageVersion>
        </PropertyGroup>
 </Project>
index 1360b652f81d975c171109fbc3c27f3e1fefbd6f..059bf8521778c0644a1970caa76966de174b5ae3 100644 (file)
@@ -29,8 +29,9 @@ namespace tests
                        // += KeyboardKeyDown1;
 
                        //testFiles = new string [] { @"Interfaces/Experimental/testDock.crow" };
-                       testFiles = new string [] { @"Interfaces/Divers/welcome.crow" };
-                       //testFiles = new string [] { @"Interfaces/Divers/testSlider.crow" };
+                       //testFiles = new string [] { @"Interfaces/Divers/welcome.crow" };
+                       testFiles = new string [] { @"Interfaces/Group/5.crow" };
+                       //testFiles = new string [] { @"Interfaces/Divers/perfMeasures.crow" };
                        //testFiles = new string [] { @"Interfaces/Divers/colorPicker.crow" };
                        testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray ();
                        testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Container", "*.crow")).ToArray ();
index b231b25385fe8e622d82f04d58f3d9cd4821595e..e1208a4271b87a9bbc0365866837065cfeb7aaeb 100644 (file)
@@ -25,5 +25,9 @@
                        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
                        <Link>Interfaces\%(RecursiveDir)%(Filename)%(Extension)</Link>
                </None>
+               <EmbeddedResource Include="..\common\ui\templates\**\*.*">
+                       <LogicalName>ui.%(Filename)%(Extension)</LogicalName>
+                       <Link>Templates\%(Filename)%(Extension)</Link>
+               </EmbeddedResource>
        </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/Samples/common/ui/Interfaces/Group/5.crow b/Samples/common/ui/Interfaces/Group/5.crow
new file mode 100644 (file)
index 0000000..b344bc6
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<VerticalStack Background="DimGrey" Margin="10" Fit="true" MinimumSize="200,20">
+       <Label Font="droid bold,20" Text="Label1" Margin="5"  Width="Stretched" Height="Fit" Background="Jet"/> 
+       <Label Font="droid bold,20" Text="Label1" Margin="5"  Width="Stretched" Height="Fit" Background="Jet"/> 
+       <Label Font="droid bold,20" Text="Label1" Margin="5"  Width="Stretched" Height="Fit" Background="Jet"/> 
+       <Label Font="droid bold,20" Text="Label1" Margin="5"  Width="Stretched" Height="Fit" Background="Jet"/> 
+</VerticalStack>
\ No newline at end of file
diff --git a/Samples/common/ui/templates/CheckBox2.imlt b/Samples/common/ui/templates/CheckBox2.imlt
new file mode 100644 (file)
index 0000000..c2bfe8d
--- /dev/null
@@ -0,0 +1,7 @@
+<Label Font="{./Font}" Text="{./Caption}" Height="{./HeightPolicy}" Width="{./WidthPolicy}"
+       Margin="3"
+       Background="{./Background}"
+       Foreground="DimGrey"
+       TextAlignment="Center"
+       MouseEnter="{Foreground=White}"
+       MouseLeave="{Foreground=DimGrey}"/>
\ No newline at end of file
diff --git a/Samples/common/ui/templates/TabItem.template b/Samples/common/ui/templates/TabItem.template
new file mode 100644 (file)
index 0000000..fd0f310
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<GenericStack Orientation="Vertical" Spacing="0"
+               Background="{./Background}"
+               MouseEnter="{/caption.Foreground=White}"
+               MouseLeave="{/caption.Foreground=Grey}">
+       <HorizontalStack Left="{./TabOffset}"
+               Name="TabTitle"
+               HorizontalAlignment="Left"
+               Height="{./TabHeight}"
+               Width="{./TabWidth}">
+               <Label Name="caption" Text="{./Caption}" Foreground="Grey" Width="Stretched"/>
+               <Label Text="{./ViewIndex}" Foreground="Green"/>
+               <Label Text="{./TabOffset}" Foreground="Red"/>
+               <Border CornerRadius="5" BorderWidth="1" Foreground="Transparent"  Height="12" Width="12"
+                                       MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}">
+                       <Image Focusable="true" Name="Image" Margin="0" Width="Stretched" Height="Stretched" Path="#Crow.Icons.exit2.svg"
+                                MouseClick="./butCloseTabClick"/>
+               </Border>
+       </HorizontalStack>
+       <Container Margin="20">
+               <Container Background="DimGrey" Name="Content"/>
+       </Container>
+</GenericStack>
+
diff --git a/Samples/common/ui/templates/TmpExpandable.goml b/Samples/common/ui/templates/TmpExpandable.goml
new file mode 100644 (file)
index 0000000..9dddceb
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<!--<VerticalStack Height="{../HeightPolicy}" Width="{../WidthPolicy}" MouseClick="../onMouseClick">
+       <Label Text="{../../Caption}" Width="{../../WidthPolicy}"/>
+       <Container Name="Content" Visible="false" Height="{../../HeightPolicy}" Width="{../../WidthPolicy}"/>
+</VerticalStack>-->
+<Group BorderWidth="1" Foreground="LightGray" 
+               MouseClick="../onMouseClick">
+       <VerticalStack>
+               <Label Text="{../../../Caption}"/>
+               <Container Name="Content" Visible="false"/>
+       </VerticalStack>
+</Group>
\ No newline at end of file
diff --git a/Samples/common/ui/templates/colorItem.crow b/Samples/common/ui/templates/colorItem.crow
new file mode 100644 (file)
index 0000000..30bfe3d
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<Border Foreground="Transparent" Focusable="true" HorizontalAlignment="Left" Height="Fit" Width="200">
+       <HorizontalStack Margin="0"
+                               MouseEnter="{Background=hgradient|0:DarkRed|1:Transparent}"
+                               MouseLeave="{Background=Transparent}">
+               <Widget Height="12" Width="20" Background="{}" Margin="0" CornerRadius="3"/>
+               <Label Text="{}" Margin="0" Width="Stretched"/>
+       </HorizontalStack>
+</Border>
+
diff --git a/Samples/common/ui/templates/colorItem2.crow b/Samples/common/ui/templates/colorItem2.crow
new file mode 100644 (file)
index 0000000..83239b3
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<Border Foreground="Transparent" Focusable="true" HorizontalAlignment="Left" Height="Fit">
+       <HorizontalStack Margin="0"
+                               MouseEnter="{Background=CornflowerBlue}"
+                               MouseLeave="{Background=Transparent}">
+               <Widget Height="8" Width="14" Background="{}" Margin="0" CornerRadius="2"/>
+               <Label Text="{}" Margin="0" Width="Stretched" Font="mono, 8"/>
+       </HorizontalStack>
+</Border>
+
diff --git a/Samples/common/ui/templates/itemTmp.goml b/Samples/common/ui/templates/itemTmp.goml
new file mode 100644 (file)
index 0000000..fadf5e6
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<Border BorderWidth="3">
+       <Label Text="{Name}" Focusable="true" Width="Stretched" Height="Fit" Margin="0"
+                       MouseEnter="{Background=Red}"
+                       MouseLeave="{Background=Transparent}"
+       />
+</Border>
+
diff --git a/Samples/common/ui/templates/log.xml b/Samples/common/ui/templates/log.xml
new file mode 100644 (file)
index 0000000..1039f7b
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<Container Name="topContainer" HorizontalAlignment="Center" VerticalAlignment="Top"
+       Margin="2"
+       Width="600" Height="-1">
+       <Border Margin="2" BorderWidth="1" Background="0,6;0,6;0,6;0,6" Height="-1">
+               <Group Width="0" Name="logs">
+                       <VerticalStack Name="VerticalStack" Width="0" Focusable="False">
+                               <Label Name="line1" Width="0" Text="Line1" Margin="0"/>
+                               <Label Name="line2" Width="0" Text="Line2" Margin="0"/>
+                               <Label Name="line3" Width="0" Text="Line3" Margin="0"/>
+                               <Label Name="line4" Width="0" Text="Line4" Margin="0"/>
+                       </VerticalStack>
+                       <Button Name="btOk" Background="Gray" Fit="True"
+                               HorizontalAlignment="Right" VerticalAlignment="Bottom"
+                               MouseClick="BtOk_MouseClick">
+                               <Label Text="Ok" Margin="3" Foreground="White" />
+                       </Button>
+               </Group>
+       </Border>
+</Container>
+
diff --git a/Samples/common/ui/templates/perfMsr.crow b/Samples/common/ui/templates/perfMsr.crow
new file mode 100644 (file)
index 0000000..06f7ae3
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+
+       <VerticalStack Spacing="1" Height="Fit" Width="Stretched">
+               <HorizontalStack Background="DarkSlateGrey">
+                       <Label Text="{Name}" Width="Stretched" Font="doid bold, 10" Margin="2"/>
+                       <Button Caption="Reset" MouseClick="onResetClick" Height="Fit"/>
+               </HorizontalStack>
+               <HorizontalStack Height="Fit" Width="Fit" HorizontalAlignment="Left">
+                       <HorizontalStack Style="HStackMeasure">
+                               <Label Text="Cur:" Style="FpsLabel"/>
+                               <Label Text="{current}" Style="FpsDisp"/>
+                       </HorizontalStack>
+                       <HorizontalStack Style="HStackMeasure">
+                               <Label Text="Min:" Style="FpsLabel"/>
+                               <Label Text="{minimum}" Style="FpsDisp"/>
+                       </HorizontalStack>
+                       <HorizontalStack Style="HStackMeasure">
+                               <Label Text="Mean:" Style="FpsLabel"/>
+                               <Label Text="{mean}" Style="FpsDisp"/>
+                       </HorizontalStack>
+                       <HorizontalStack Style="HStackMeasure">
+                               <Label Text="Max:" Style="FpsLabel"/>
+                               <Label Text="{maximum}" Style="FpsDisp"/>
+                       </HorizontalStack>
+               </HorizontalStack>
+               <Border Foreground="White" Width="Stretched" Height="60">
+                       <Trend Background="Black" NewValue="{current}" Minimum="{minimum}" Maximum="{maximum}"/>
+               </Border>
+<!--           <HorizontalStack>
+                       <Label Text="Total:" Style="FpsLabel"/>
+                       <Label Text="{total}" Style="FpsDisp"/>
+               </HorizontalStack>
+               <HorizontalStack>
+                       <Label Text="Cpt:" Style="FpsLabel"/>
+                       <Label Text="{cptMeasures}" Style="FpsDisp"/>
+               </HorizontalStack>-->
+       </VerticalStack>
+
diff --git a/Samples/common/ui/templates/test.style b/Samples/common/ui/templates/test.style
new file mode 100644 (file)
index 0000000..6f5dc8f
--- /dev/null
@@ -0,0 +1,49 @@
+FpsLabel {
+       Width = "30";
+       Font = "droid, 10";
+       Margin = "0";
+       TextAlignment = "Center";
+}
+FpsDisp {
+       Font = "droid bold, 10";
+       Width = "60";
+       Margin = "0";
+       CornerRadius = "3";
+       TextAlignment = "Center";
+       Background = "MediumSeaGreen";
+}
+HStackMeasure {
+       Margin = "2";
+       Width = "Fit";
+       Height = "Fit";
+       Background = "DimGrey";
+}
+CheckBox2 {
+       Template= "Interfaces/CheckBox2.imlt";
+       Background = "Jet";
+       Checked="{Background=MediumSeaGreen}";
+       Unchecked = "{Background=Jet}";
+}
+RadioButton2 {
+       Template="Interfaces/CheckBox2.imlt";
+       Background = "Jet";
+       Checked = "{Background=MediumSeaGreen}";
+       Unchecked = "{Background=Jet}";
+}
+labPerf {
+       Font = "droid, 8";
+       Width = "50%";
+}
+labPerfVal{
+       Font = "droid, 8";
+       Width = "50%";
+}
+DbgLogViewer{
+       Background = "Onyx";
+       Font = "mono, 8";
+       Foreground = "LightGrey";
+       Focusable = "true";
+}
+DockWindow{
+       Background = "0.1,0.1,0.1,0.5";
+}
diff --git a/Samples/common/ui/templates/testMeter.goml b/Samples/common/ui/templates/testMeter.goml
new file mode 100644 (file)
index 0000000..2c840a8
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<AnalogMeter Width="Fit" Height="Fit" Background="White" Foreground="Black"  Value="{fps}" Minimum="Stretched" Maximum="100"/>
\ No newline at end of file
diff --git a/Samples/common/ui/templates/testWindow.goml.sav b/Samples/common/ui/templates/testWindow.goml.sav
new file mode 100644 (file)
index 0000000..42b4b74
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!--<Group>-->
+<Window Name="window1" Left="10" Top="10" Title="Test window" 
+               Width="250" Height="300" >
+       <VerticalStack Name="contentVSStack" Margin="10" Spacing="10">
+               <Slider Name="slider" Height="10" Width="0"/>
+
+               <HorizontalStack Width="0" Height="-1" Margin="10" Background="BlueCrayola">
+                       <Checkbox Height="-1" Width="80"/>
+                       <GraphicObject Width="0"/>
+                       <Checkbox Height="-1" Width="80"/>
+               </HorizontalStack>
+               <Groupbox Text="test"  Height="-1" Width="-1" Margin="5">
+                       <VerticalStack  Height="-1" Width="0" >
+                               <RadioButton  Caption="Radio 1" Background="Red" />
+                               <RadioButton  Caption="Radio 2" IsChecked="true" />
+                               <RadioButton  Caption="Radio 3" />
+                       </VerticalStack>
+               </Groupbox>
+<!--           <Checkbox Height="-1" Width="-1" Background="Red" Margin="0" VerticalAlignment="Center" HorizontalAlignment="Right"/>-->
+       </VerticalStack>
+</Window>
+<!--</Group>-->
+<!--           <Label Text="{fps}"  Background="DarkRed"/>
+               <Label Text="{fpsMin}"  />
+               <Label Text="{fpsMax}"  />-->
\ No newline at end of file
diff --git a/Samples/common/ui/templates/tmpDirItem.goml b/Samples/common/ui/templates/tmpDirItem.goml
new file mode 100644 (file)
index 0000000..41665d1
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+       <HorizontalStack Width="Fit" Height="Fit" Focusable="true"
+                       HorizontalAlignment="Left"
+                       MouseEnter="{Background=RoyalBlue}"
+                       MouseLeave="{Background=Transparent}">
+               <Image Width="16" Height="16" Path="#Tests.image.folder1.svg" SvgSub="{Attributes}"/>
+               <Label Text="{Name}" Width="Fit" Height="Fit" Margin="0"/>
+               <Label Text="{Attributes}" Width="Fit" Height="Fit" Margin="0"/>
+               <Label Text="{Extension}" Width="Fit" Height="Fit" Margin="0"/>
+       </HorizontalStack>
+
diff --git a/Samples/common/ui/templates/tmpMembers.goml b/Samples/common/ui/templates/tmpMembers.goml
new file mode 100644 (file)
index 0000000..f48d8d6
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+       <HorizontalStack Width="Stretched" Height="Fit" Focusable="true" 
+                       MouseEnter="{Background=SkyBlue}"
+                       MouseLeave="{Background=Transparent}">
+               <Image Width="8" Height="8" Path="#Crow.Images.Icons.member.svg" SvgSub="{GetIcon}"/>
+               <Label Text="{Name}" Width="Stretched" Height="Fit" Margin="1"/>
+               <Label Text="{MemberType}" Width="Fit" Height="Fit" Margin="0"/>
+       </HorizontalStack>
+
diff --git a/Samples/common/ui/templates/treeList.crow b/Samples/common/ui/templates/treeList.crow
new file mode 100644 (file)
index 0000000..ca59c17
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<VerticalStack Height="Fit" Name="List"/>
\ No newline at end of file
diff --git a/Samples/testMSBuild/Program.cs b/Samples/testMSBuild/Program.cs
new file mode 100644 (file)
index 0000000..8781473
--- /dev/null
@@ -0,0 +1,370 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Reflection;
+using Microsoft.Build.Construction;
+using Microsoft.Build.Evaluation;
+using Microsoft.Build.Execution;
+using Microsoft.Build.Framework;
+
+namespace testMSBuild
+{
+       class Program
+       {
+
+               //const string msbuildRoot = "/usr/lib/mono/msbuild/Current/bin/";
+               const string msbuildRoot = "/usr/share/dotnet/sdk/3.1.101/";
+               //const string msbuildRoot = "/mnt/data/src/microsoft/msbuild/artifacts/bin/bootstrap/netcoreapp2.1/MSBuild/";
+               const string toolsVersion = "Current";
+
+               static void Main (string [] args)
+               {
+                       /*var nativeSharedMethod = typeof (SolutionFile).Assembly.GetType ("Microsoft.Build.Shared.NativeMethodsShared");
+                       var isMonoField = nativeSharedMethod.GetField ("_isMono", BindingFlags.Static | BindingFlags.NonPublic);
+                       isMonoField.SetValue (null, true);*/
+
+                       //Environment.SetEnvironmentVariable (MSBUILD_EXE_PATH, "/usr/share/dotnet/sdk/3.1.101/MSBuild.dll");
+                       Environment.SetEnvironmentVariable ("MSBUILD_EXE_PATH", Path.Combine(msbuildRoot, "MSBuild.dll"));
+                       Environment.SetEnvironmentVariable ("MSBUILD_NUGET_PATH", "/home/jp/.nuget/packages");
+
+
+                       //Environment.SetEnvironmentVariable ("COREHOST_TRACE", "1");
+
+                       AppDomain currentDomain = AppDomain.CurrentDomain;
+                       currentDomain.AssemblyResolve += msbuildAssembliesResolve;
+
+                       compile ();
+               }
+
+               static Assembly msbuildAssembliesResolve (object sender, ResolveEventArgs args)
+               {
+                       string assemblyPath = Path.Combine (msbuildRoot, new AssemblyName (args.Name).Name + ".dll");
+                       /*Console.BackgroundColor = ConsoleColor.DarkBlue;
+                       Console.ForegroundColor = ConsoleColor.White;
+                       Console.WriteLine ($"Probing: {assemblyPath}");
+                       Console.ResetColor ();*/
+                       if (!File.Exists (assemblyPath)) return null;
+                       Assembly assembly = Assembly.LoadFrom (assemblyPath);
+                       return assembly;
+               }
+
+
+               static void compile ()
+               {
+                       //Console.WriteLine ($"{Microsoft.Build. BuildEnvironmentHelper.Instance.CurrentMSBuildExePath}");
+                       string slnPath = "/mnt/devel/glfw-sharp/glfw-sharp.sln";//<--- change here can be another VS type ex: .vcxproj
+                       //string slnPath = "/mnt/devel/vke.net/vke.net.sln";//<--- change here can be another VS type ex: .vcxproj
+                                                                                                                                       //string csprojPath = "/mnt/devel/glfw-sharp/glfw-sharp.csproj";
+                       //ILogger Logger = new BasicLogger ();
+                       ILogger Logger = new Microsoft.Build.Logging.ConsoleLogger ();
+                       Logger.Verbosity = LoggerVerbosity.Minimal;
+                       //Logger.Parameters = "V=DIAG;consoleloggerparameters:ShowEventId";
+                       ProjectCollection projectCollection = new ProjectCollection ();
+                       projectCollection.DefaultToolsVersion = toolsVersion;
+                       //projectCollection.IsBuildEnabled = false;
+                       //projectCollection.LoadProject (projectFileName);
+                       SolutionFile sln = SolutionFile.Parse (slnPath);
+
+                       /*foreach (ProjectInSolution pis in sln.ProjectsInOrder) {
+                               Console.WriteLine ($"{pis.ProjectName} {pis.RelativePath} {pis.ProjectType}");
+                       }*/
+
+
+                       //Project project = new Project (projectCollection);
+                       BuildParameters buildParams = new BuildParameters (projectCollection);
+                       buildParams.Loggers = new List<ILogger> () { Logger };
+                       //buildParams.DefaultToolsVersion = "Current";
+                       //buildParams.DetailedSummary = true;
+                       //buildParams.LogInitialPropertiesAndItems = true;
+                       //buildParams.LogTaskInputs = true;
+
+                       buildParams.ResetCaches = false;
+
+                       Dictionary<String, String> globalProperties = new Dictionary<String, String> ();
+
+                       globalProperties ["Configuration"] = sln.GetDefaultConfigurationName ();
+                       globalProperties ["Platform"] = sln.GetDefaultPlatformName ();
+
+
+                       //globalProperties ["RollForward"] = "none";
+                       //globalProperties ["_IsRollForwardSupported"] = "false";
+
+                       //globalProperties ["GenerateRuntimeConfigurationFiles"] = "true";
+
+                       //globalProperties ["NuGetPackageRoot"] = "/home/jp/.nuget/packages";
+                       //globalProperties ["RoslynTargetsPath"] = Path.Combine (msbuildRoot, "Roslyn/");
+                       //globalProperties ["MSBuildSDKsPath"] = Path.Combine (msbuildRoot, "Sdks/");
+
+                       //globalProperties ["AdditionalLibPaths"] = msbuildRoot;
+                       //globalProperties ["AssemblySearchPaths"] = msbuildRoot;
+
+
+                       //globalProperty.Add ("CSharpCoreTargetsPath", "/usr/share/dotnet/sdk/3.1.101/Roslyn/Microsoft.CSharp.Core.targets");
+
+                       /*ProjectInstance pinst = new ProjectInstance (csprojPath, globalProperties, "Current");
+                       if (pinst.Build (new String [] { "Build" }, buildParams.Loggers, out System.Collections.Generic.IDictionary<string, Microsoft.Build.Execution.TargetResult> targetOutputs))
+                               Console.WriteLine ("Success");
+                       ProjectRootElement pre = pinst.ToProjectRootElement ();*/
+
+                       //List <Project> projects = new List<Project> ();
+
+                       //projectCollection.ProjectAdded += (sender, e) => {
+                       //      //      pc = sender as ProjectCollection;
+                       //      //      Console.ForegroundColor = ConsoleColor.Yellow;
+                       //      //      Console.WriteLine ($"Proj added: {e.ProjectRootElement} {e.ProjectRootElement.FullPath}");
+                       //      //      Console.ResetColor ();
+
+                       //      Project p = new Project (e.ProjectRootElement);//, globalProperties, toolsVersion, projectCollection);
+                       //                                                                                                 //   //projects.Add (p);
+                       //      Console.WriteLine ($"\nEvaluated properties:");
+                       //      foreach (var pi in p.Properties)
+                       //              Console.WriteLine ($"\t{pi.Name} = {pi.EvaluatedValue}");
+                       //      Console.WriteLine ("");
+
+                       //      //      //foreach (ProjectItem pi in p.AllEvaluatedItems)
+                       //      //      //Console.WriteLine ($"{pi.ItemType} {pi.EvaluatedInclude}");
+                       //      //      /*foreach (GlobResult gr in p.GetAllGlobs()) {
+                       //      //              foreach (string g in gr.IncludeGlobs) {
+                       //      //                      Console.WriteLine ($"\t\t{g}");
+                       //      //              }
+                       //};
+
+                       //};
+
+                       BuildManager.DefaultBuildManager.ResetCaches ();
+
+                       //string[] targetsToBuild = { "ResolveAssemblyReferences" };
+                       string [] targetsToBuild = { "restore", "build"};
+                       //string [] targetsToBuild = { "Rebuild" };
+
+                       //globalProperties ["Configuration"] = "ReleaseSpirVTasks";
+
+                       BuildRequestData buildRequest = new BuildRequestData (slnPath, globalProperties, "Current", targetsToBuild, null);
+
+                       BuildResult buildResult = BuildManager.DefaultBuildManager.Build (buildParams, buildRequest);
+
+
+                       if (buildResult.OverallResult == BuildResultCode.Success) {
+                               Console.WriteLine ("Build succes.");
+                       } else {
+                               foreach (var item in buildResult.ResultsByTarget) {
+                                       Console.WriteLine ($"{item.Key} -> {item.Value.ResultCode} {item.Value.ToString()}");
+                               }
+
+                               Console.WriteLine ("Error: " + buildResult.Exception);
+                       }
+                       //Console.WriteLine ($"proj count: {}");
+                       //MessageBox.Show (Logger.GetLogString ());
+                       /*foreach (Project p in buildParams. ..LoadedProjects) {
+                               foreach (ProjectItem pi in p.AllEvaluatedItems) {
+                                       Console.WriteLine ($"{pi.ItemType} {pi}");      
+                               }
+                       }*/
+               }
+       }
+
+       public class FileLogger : ILogger
+       {
+               public LoggerVerbosity Verbosity { get => throw new NotImplementedException (); set => throw new NotImplementedException (); }
+               public string Parameters { get => throw new NotImplementedException (); set => throw new NotImplementedException (); }
+
+               Stream log;
+               StreamWriter sw;
+
+               public void Initialize (IEventSource eventSource)
+               {
+                       log = new FileStream ("buildlog.txt", FileMode.Create);
+                       sw = new StreamWriter (log);
+
+                       eventSource.MessageRaised += (sender, e) => sw.WriteLine ($"{e.Message}"); 
+                       eventSource.BuildStarted += (sender, e) => sw.WriteLine("Build started");
+                       eventSource.BuildFinished += (sender, e) => sw.WriteLine ("Build finished");
+               }
+
+               public void Shutdown ()
+               {
+                       log.Flush ();
+                       sw.Dispose ();
+                       log.Dispose ();
+               }
+       }
+
+       public class BasicLogger : ILogger
+       {
+               public LoggerVerbosity Verbosity { get; set; }
+               public string Parameters { get; set; }
+
+               public void Initialize (IEventSource eventSource)
+               {
+                       //eventSource.ProjectStarted += (sender, e) => Console.WriteLine ($"Building project: {e.Message}");
+                       //eventSource.ProjectFinished += (sender, e) => Console.WriteLine ($"Done project: {e.Message}");
+                       eventSource.ErrorRaised += (sender, e) => {
+                               Console.ForegroundColor = ConsoleColor.White;
+                               Console.BackgroundColor = ConsoleColor.Red;
+                               Console.WriteLine ($"{e.Message}");
+                               Console.ResetColor ();
+                       };
+                       eventSource.TargetStarted += (sender, e) => {
+                               Console.ForegroundColor = ConsoleColor.DarkYellow;
+                               Console.WriteLine ($"Target start: {e.TargetName}<-{e.ParentTarget} {e.Message}");
+                               Console.ResetColor ();
+                       };
+                       eventSource.TargetFinished += (sender, e) => {
+                               Console.ForegroundColor = ConsoleColor.DarkYellow;
+                               Console.WriteLine ($"\tDone {e.TargetName} ({e.Succeeded}) : {e.Message}");
+                               Console.ResetColor ();
+                       };
+
+                       eventSource.MessageRaised += (sender, e) => {
+                               Console.ForegroundColor = ConsoleColor.Gray;
+                               Console.WriteLine ($"{e.HelpKeyword} {e.Message}");
+                               Console.ResetColor ();
+                       };
+                       //eventSource.AnyEventRaised += (sender, e) => Console.WriteLine ($"{e.Timestamp}:{e.SenderName}=>{e.Message}"); 
+                       //eventSource.BuildStarted += (sender, e) => Console.WriteLine("Build started");
+                       eventSource.BuildFinished += (sender, e) => Console.WriteLine ("Build finished");
+               }
+
+               public void Shutdown ()
+               {
+               }
+       }
+
+       //public class BasicLogger : ILogger
+       //      {
+       //      MemoryStream streamMem = new MemoryStream ();
+       //      /// <summary>
+       //      /// Initialize is guaranteed to be called by MSBuild at the start of the build
+       //      /// before any events are raised.
+       //      /// </summary>
+       //      public override void Initialize (IEventSource eventSource)
+       //      {
+
+       //              try {
+       //                      // Open the file
+       //                      this.streamWriter = new StreamWriter (streamMem);
+       //                      //this.streamWriter = new StreamWriter(logFile);
+       //              } catch (Exception ex) {
+       //                      if
+       //                      (
+       //                              ex is UnauthorizedAccessException
+       //                              || ex is ArgumentNullException
+       //                              || ex is PathTooLongException
+       //                              || ex is DirectoryNotFoundException
+       //                              || ex is NotSupportedException
+       //                              || ex is ArgumentException
+       //                              || ex is SecurityException
+       //                              || ex is IOException
+       //                      ) {
+       //                              throw new LoggerException ("Failed to create log file: " + ex.Message);
+       //                      } else {
+       //                              // Unexpected failure
+       //                              throw;
+       //                      }
+       //              }
+
+       //              // For brevity, we'll only register for certain event types. Loggers can also
+       //              // register to handle TargetStarted/Finished and other events.
+       //              eventSource.ProjectStarted += new ProjectStartedEventHandler (eventSource_ProjectStarted);
+       //              eventSource.TaskStarted += new TaskStartedEventHandler (eventSource_TaskStarted);
+       //              eventSource.MessageRaised += new BuildMessageEventHandler (eventSource_MessageRaised);
+       //              eventSource.WarningRaised += new BuildWarningEventHandler (eventSource_WarningRaised);
+       //              eventSource.ErrorRaised += new BuildErrorEventHandler (eventSource_ErrorRaised);
+       //              eventSource.ProjectFinished += new ProjectFinishedEventHandler (eventSource_ProjectFinished);
+       //      }
+
+       //      void eventSource_ErrorRaised (object sender, BuildErrorEventArgs e)
+       //      {
+       //              // BuildErrorEventArgs adds LineNumber, ColumnNumber, File, amongst other parameters
+       //              string line = String.Format (": ERROR {0}({1},{2}): ", e.File, e.LineNumber, e.ColumnNumber);
+       //              WriteLineWithSenderAndMessage (line, e);
+       //      }
+
+       //      void eventSource_WarningRaised (object sender, BuildWarningEventArgs e)
+       //      {
+       //              // BuildWarningEventArgs adds LineNumber, ColumnNumber, File, amongst other parameters
+       //              string line = String.Format (": Warning {0}({1},{2}): ", e.File, e.LineNumber, e.ColumnNumber);
+       //              WriteLineWithSenderAndMessage (line, e);
+       //      }
+
+       //      void eventSource_MessageRaised (object sender, BuildMessageEventArgs e)
+       //      {
+       //              // BuildMessageEventArgs adds Importance to BuildEventArgs
+       //              // Let's take account of the verbosity setting we've been passed in deciding whether to log the message
+       //              if ((e.Importance == MessageImportance.High && IsVerbosityAtLeast (LoggerVerbosity.Minimal))
+       //                      || (e.Importance == MessageImportance.Normal && IsVerbosityAtLeast (LoggerVerbosity.Normal))
+       //                      || (e.Importance == MessageImportance.Low && IsVerbosityAtLeast (LoggerVerbosity.Detailed))
+       //              ) {
+       //                      WriteLineWithSenderAndMessage (String.Empty, e);
+       //              }
+       //      }
+
+       //      void eventSource_TaskStarted (object sender, TaskStartedEventArgs e)
+       //      {
+       //              // TaskStartedEventArgs adds ProjectFile, TaskFile, TaskName
+       //              // To keep this log clean, this logger will ignore these events.
+       //      }
+
+       //      void eventSource_ProjectStarted (object sender, ProjectStartedEventArgs e)
+       //      {
+       //              // ProjectStartedEventArgs adds ProjectFile, TargetNames
+       //              // Just the regular message string is good enough here, so just display that.
+       //              WriteLine (String.Empty, e);
+       //              indent++;
+       //      }
+
+       //      void eventSource_ProjectFinished (object sender, ProjectFinishedEventArgs e)
+       //      {
+       //              // The regular message string is good enough here too.
+       //              indent--;
+       //              WriteLine (String.Empty, e);
+       //      }
+
+       //      /// <summary>
+       //      /// Write a line to the log, adding the SenderName and Message
+       //      /// (these parameters are on all MSBuild event argument objects)
+       //      /// </summary>
+       //      private void WriteLineWithSenderAndMessage (string line, BuildEventArgs e)
+       //      {
+       //              if (0 == String.Compare (e.SenderName, "MSBuild", true /*ignore case*/)) {
+       //                      // Well, if the sender name is MSBuild, let's leave it out for prettiness
+       //                      WriteLine (line, e);
+       //              } else {
+       //                      WriteLine (e.SenderName + ": " + line, e);
+       //              }
+       //      }
+
+       //      /// <summary>
+       //      /// Just write a line to the log
+       //      /// </summary>
+       //      private void WriteLine (string line, BuildEventArgs e)
+       //      {
+       //              for (int i = indent; i > 0; i--) {
+       //                      streamWriter.Write ("\t");
+       //              }
+       //              streamWriter.WriteLine (line + e.Message);
+       //      }
+
+
+       //      public string GetLogString ()
+       //      {
+       //              var sr = new StreamReader (streamMem);
+       //              var myStr = sr.ReadToEnd ();
+       //              return myStr;
+       //      }
+       //      /// <summary>
+       //      /// Shutdown() is guaranteed to be called by MSBuild at the end of the build, after all 
+       //      /// events have been raised.
+       //      /// </summary>
+       //      /// 
+       //      /// 
+       //      public override void Shutdown ()
+       //      {
+       //              streamWriter.Flush ();
+       //              streamMem.Position = 0;
+       //      }
+       //      private StreamWriter streamWriter;
+       //      private int indent;
+       //}
+}
diff --git a/Samples/testMSBuild/testMSBuild.csproj b/Samples/testMSBuild/testMSBuild.csproj
new file mode 100644 (file)
index 0000000..9eff9e7
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project Sdk="Microsoft.NET.Sdk">
+       <PropertyGroup>
+               <OutputType>Exe</OutputType>
+               <!--            <TargetFramework>net472</TargetFramework>-->
+               <TargetFramework>netcoreapp3.1</TargetFramework>
+               <ReleaseVersion>0.8.0</ReleaseVersion>
+       </PropertyGroup>
+       <ItemGroup>
+               <PackageReference Include="Microsoft.Build" Version="16.*">
+                       <IncludeAssets>compile</IncludeAssets>
+               </PackageReference>
+               <PackageReference Include="Microsoft.Build.Framework" Version="16.*">
+                       <IncludeAssets>compile</IncludeAssets>
+               </PackageReference>
+               <PackageReference Include="Microsoft.Build.Tasks.Core" Version="16.*">
+                       <IncludeAssets>compile</IncludeAssets>
+               </PackageReference>
+               <PackageReference Include="Microsoft.Build.Utilities.Core" Version="16.*">
+                       <IncludeAssets>compile</IncludeAssets>
+               </PackageReference>
+       </ItemGroup>
+</Project>
\ No newline at end of file