diff --git a/.ncrunch/Avalonia.Animation.UnitTests.net47.v3.ncrunchproject b/.ncrunch/Avalonia.Animation.UnitTests.net47.v3.ncrunchproject new file mode 100644 index 0000000000..e9d39b0c74 --- /dev/null +++ b/.ncrunch/Avalonia.Animation.UnitTests.net47.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Animation.UnitTests.netcoreapp2.0.v3.ncrunchproject b/.ncrunch/Avalonia.Animation.UnitTests.netcoreapp2.0.v3.ncrunchproject new file mode 100644 index 0000000000..e9d39b0c74 --- /dev/null +++ b/.ncrunch/Avalonia.Animation.UnitTests.netcoreapp2.0.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Animation.v3.ncrunchproject b/.ncrunch/Avalonia.Animation.v3.ncrunchproject index 6800b4a3fe..e12537d535 100644 --- a/.ncrunch/Avalonia.Animation.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Animation.v3.ncrunchproject @@ -1,5 +1,8 @@  + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Base.UnitTests.net47.v3.ncrunchproject b/.ncrunch/Avalonia.Base.UnitTests.net47.v3.ncrunchproject new file mode 100644 index 0000000000..e9d39b0c74 --- /dev/null +++ b/.ncrunch/Avalonia.Base.UnitTests.net47.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Base.UnitTests.netcoreapp2.0.v3.ncrunchproject b/.ncrunch/Avalonia.Base.UnitTests.netcoreapp2.0.v3.ncrunchproject new file mode 100644 index 0000000000..e9d39b0c74 --- /dev/null +++ b/.ncrunch/Avalonia.Base.UnitTests.netcoreapp2.0.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Base.v3.ncrunchproject b/.ncrunch/Avalonia.Base.v3.ncrunchproject index 6800b4a3fe..e12537d535 100644 --- a/.ncrunch/Avalonia.Base.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Base.v3.ncrunchproject @@ -1,5 +1,8 @@  + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Benchmarks.v3.ncrunchproject b/.ncrunch/Avalonia.Benchmarks.v3.ncrunchproject index 6800b4a3fe..e12537d535 100644 --- a/.ncrunch/Avalonia.Benchmarks.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Benchmarks.v3.ncrunchproject @@ -1,5 +1,8 @@  + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Build.Tasks.v3.ncrunchproject b/.ncrunch/Avalonia.Build.Tasks.v3.ncrunchproject new file mode 100644 index 0000000000..319cd523ce --- /dev/null +++ b/.ncrunch/Avalonia.Build.Tasks.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + True + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Controls.DataGrid.v3.ncrunchproject b/.ncrunch/Avalonia.Controls.DataGrid.v3.ncrunchproject new file mode 100644 index 0000000000..e9d39b0c74 --- /dev/null +++ b/.ncrunch/Avalonia.Controls.DataGrid.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Controls.UnitTests.net47.v3.ncrunchproject b/.ncrunch/Avalonia.Controls.UnitTests.net47.v3.ncrunchproject new file mode 100644 index 0000000000..e9d39b0c74 --- /dev/null +++ b/.ncrunch/Avalonia.Controls.UnitTests.net47.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Controls.UnitTests.netcoreapp2.0.v3.ncrunchproject b/.ncrunch/Avalonia.Controls.UnitTests.netcoreapp2.0.v3.ncrunchproject new file mode 100644 index 0000000000..e9d39b0c74 --- /dev/null +++ b/.ncrunch/Avalonia.Controls.UnitTests.netcoreapp2.0.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Controls.v3.ncrunchproject b/.ncrunch/Avalonia.Controls.v3.ncrunchproject index 6800b4a3fe..e12537d535 100644 --- a/.ncrunch/Avalonia.Controls.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Controls.v3.ncrunchproject @@ -1,5 +1,8 @@  + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Designer.HostApp.net461.v3.ncrunchproject b/.ncrunch/Avalonia.Designer.HostApp.net461.v3.ncrunchproject new file mode 100644 index 0000000000..e9d39b0c74 --- /dev/null +++ b/.ncrunch/Avalonia.Designer.HostApp.net461.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Designer.HostApp.netcoreapp2.0.v3.ncrunchproject b/.ncrunch/Avalonia.Designer.HostApp.netcoreapp2.0.v3.ncrunchproject new file mode 100644 index 0000000000..e9d39b0c74 --- /dev/null +++ b/.ncrunch/Avalonia.Designer.HostApp.netcoreapp2.0.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.DesignerSupport.v3.ncrunchproject b/.ncrunch/Avalonia.DesignerSupport.v3.ncrunchproject index 6800b4a3fe..e12537d535 100644 --- a/.ncrunch/Avalonia.DesignerSupport.v3.ncrunchproject +++ b/.ncrunch/Avalonia.DesignerSupport.v3.ncrunchproject @@ -1,5 +1,8 @@  + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.DesktopRuntime.net461.v3.ncrunchproject b/.ncrunch/Avalonia.DesktopRuntime.net461.v3.ncrunchproject new file mode 100644 index 0000000000..e9d39b0c74 --- /dev/null +++ b/.ncrunch/Avalonia.DesktopRuntime.net461.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.DesktopRuntime.netcoreapp2.0.v3.ncrunchproject b/.ncrunch/Avalonia.DesktopRuntime.netcoreapp2.0.v3.ncrunchproject new file mode 100644 index 0000000000..e9d39b0c74 --- /dev/null +++ b/.ncrunch/Avalonia.DesktopRuntime.netcoreapp2.0.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Diagnostics.v3.ncrunchproject b/.ncrunch/Avalonia.Diagnostics.v3.ncrunchproject index 6800b4a3fe..e12537d535 100644 --- a/.ncrunch/Avalonia.Diagnostics.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Diagnostics.v3.ncrunchproject @@ -1,5 +1,8 @@  + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Direct2D1.RenderTests.v3.ncrunchproject b/.ncrunch/Avalonia.Direct2D1.RenderTests.v3.ncrunchproject index 2627a59093..0846098ce5 100644 --- a/.ncrunch/Avalonia.Direct2D1.RenderTests.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Direct2D1.RenderTests.v3.ncrunchproject @@ -4,6 +4,9 @@ ..\TestFiles\Direct2D1\**.* 3000 + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Direct2D1.UnitTests.v3.ncrunchproject b/.ncrunch/Avalonia.Direct2D1.UnitTests.v3.ncrunchproject index 6800b4a3fe..e12537d535 100644 --- a/.ncrunch/Avalonia.Direct2D1.UnitTests.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Direct2D1.UnitTests.v3.ncrunchproject @@ -1,5 +1,8 @@  + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Direct2D1.v3.ncrunchproject b/.ncrunch/Avalonia.Direct2D1.v3.ncrunchproject index 6800b4a3fe..e12537d535 100644 --- a/.ncrunch/Avalonia.Direct2D1.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Direct2D1.v3.ncrunchproject @@ -1,5 +1,8 @@  + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Gtk3.v3.ncrunchproject b/.ncrunch/Avalonia.Gtk3.v3.ncrunchproject index 95a483b433..e9d39b0c74 100644 --- a/.ncrunch/Avalonia.Gtk3.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Gtk3.v3.ncrunchproject @@ -1,3 +1,7 @@  - + + + MissingOrIgnoredProjectReference + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Input.UnitTests.net47.v3.ncrunchproject b/.ncrunch/Avalonia.Input.UnitTests.net47.v3.ncrunchproject new file mode 100644 index 0000000000..e9d39b0c74 --- /dev/null +++ b/.ncrunch/Avalonia.Input.UnitTests.net47.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Input.UnitTests.netcoreapp2.0.v3.ncrunchproject b/.ncrunch/Avalonia.Input.UnitTests.netcoreapp2.0.v3.ncrunchproject new file mode 100644 index 0000000000..e9d39b0c74 --- /dev/null +++ b/.ncrunch/Avalonia.Input.UnitTests.netcoreapp2.0.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Input.v3.ncrunchproject b/.ncrunch/Avalonia.Input.v3.ncrunchproject index 6800b4a3fe..e12537d535 100644 --- a/.ncrunch/Avalonia.Input.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Input.v3.ncrunchproject @@ -1,5 +1,8 @@  + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Interactivity.UnitTests.v3.ncrunchproject b/.ncrunch/Avalonia.Interactivity.UnitTests.v3.ncrunchproject index 6800b4a3fe..e12537d535 100644 --- a/.ncrunch/Avalonia.Interactivity.UnitTests.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Interactivity.UnitTests.v3.ncrunchproject @@ -1,5 +1,8 @@  + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Interactivity.v3.ncrunchproject b/.ncrunch/Avalonia.Interactivity.v3.ncrunchproject index 6800b4a3fe..e12537d535 100644 --- a/.ncrunch/Avalonia.Interactivity.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Interactivity.v3.ncrunchproject @@ -1,5 +1,8 @@  + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Layout.UnitTests.v3.ncrunchproject b/.ncrunch/Avalonia.Layout.UnitTests.v3.ncrunchproject index 6800b4a3fe..e12537d535 100644 --- a/.ncrunch/Avalonia.Layout.UnitTests.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Layout.UnitTests.v3.ncrunchproject @@ -1,5 +1,8 @@  + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Layout.v3.ncrunchproject b/.ncrunch/Avalonia.Layout.v3.ncrunchproject index 6800b4a3fe..e12537d535 100644 --- a/.ncrunch/Avalonia.Layout.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Layout.v3.ncrunchproject @@ -1,5 +1,8 @@  + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.LeakTests.v3.ncrunchproject b/.ncrunch/Avalonia.LeakTests.v3.ncrunchproject index 6800b4a3fe..e12537d535 100644 --- a/.ncrunch/Avalonia.LeakTests.v3.ncrunchproject +++ b/.ncrunch/Avalonia.LeakTests.v3.ncrunchproject @@ -1,5 +1,8 @@  + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.LinuxFramebuffer.v3.ncrunchproject b/.ncrunch/Avalonia.LinuxFramebuffer.v3.ncrunchproject index 6800b4a3fe..e12537d535 100644 --- a/.ncrunch/Avalonia.LinuxFramebuffer.v3.ncrunchproject +++ b/.ncrunch/Avalonia.LinuxFramebuffer.v3.ncrunchproject @@ -1,5 +1,8 @@  + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Logging.Serilog.v3.ncrunchproject b/.ncrunch/Avalonia.Logging.Serilog.v3.ncrunchproject index 6800b4a3fe..e12537d535 100644 --- a/.ncrunch/Avalonia.Logging.Serilog.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Logging.Serilog.v3.ncrunchproject @@ -1,5 +1,8 @@  + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Markup.UnitTests.net47.v3.ncrunchproject b/.ncrunch/Avalonia.Markup.UnitTests.net47.v3.ncrunchproject new file mode 100644 index 0000000000..e9d39b0c74 --- /dev/null +++ b/.ncrunch/Avalonia.Markup.UnitTests.net47.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Markup.UnitTests.netcoreapp2.0.v3.ncrunchproject b/.ncrunch/Avalonia.Markup.UnitTests.netcoreapp2.0.v3.ncrunchproject new file mode 100644 index 0000000000..e9d39b0c74 --- /dev/null +++ b/.ncrunch/Avalonia.Markup.UnitTests.netcoreapp2.0.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Markup.Xaml.UnitTests.net47.v3.ncrunchproject b/.ncrunch/Avalonia.Markup.Xaml.UnitTests.net47.v3.ncrunchproject new file mode 100644 index 0000000000..e9d39b0c74 --- /dev/null +++ b/.ncrunch/Avalonia.Markup.Xaml.UnitTests.net47.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Markup.Xaml.UnitTests.netcoreapp2.0.v3.ncrunchproject b/.ncrunch/Avalonia.Markup.Xaml.UnitTests.netcoreapp2.0.v3.ncrunchproject new file mode 100644 index 0000000000..e9d39b0c74 --- /dev/null +++ b/.ncrunch/Avalonia.Markup.Xaml.UnitTests.netcoreapp2.0.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Markup.Xaml.v3.ncrunchproject b/.ncrunch/Avalonia.Markup.Xaml.v3.ncrunchproject index 6800b4a3fe..e12537d535 100644 --- a/.ncrunch/Avalonia.Markup.Xaml.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Markup.Xaml.v3.ncrunchproject @@ -1,5 +1,8 @@  + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Markup.v3.ncrunchproject b/.ncrunch/Avalonia.Markup.v3.ncrunchproject index 6800b4a3fe..e12537d535 100644 --- a/.ncrunch/Avalonia.Markup.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Markup.v3.ncrunchproject @@ -1,5 +1,8 @@  + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.OpenGL.v3.ncrunchproject b/.ncrunch/Avalonia.OpenGL.v3.ncrunchproject new file mode 100644 index 0000000000..e9d39b0c74 --- /dev/null +++ b/.ncrunch/Avalonia.OpenGL.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.ReactiveUI.UnitTests.v3.ncrunchproject b/.ncrunch/Avalonia.ReactiveUI.UnitTests.v3.ncrunchproject new file mode 100644 index 0000000000..e9d39b0c74 --- /dev/null +++ b/.ncrunch/Avalonia.ReactiveUI.UnitTests.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.ReactiveUI.v3.ncrunchproject b/.ncrunch/Avalonia.ReactiveUI.v3.ncrunchproject index 6800b4a3fe..e12537d535 100644 --- a/.ncrunch/Avalonia.ReactiveUI.v3.ncrunchproject +++ b/.ncrunch/Avalonia.ReactiveUI.v3.ncrunchproject @@ -1,5 +1,8 @@  + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Skia.RenderTests.v3.ncrunchproject b/.ncrunch/Avalonia.Skia.RenderTests.v3.ncrunchproject index 7fe2430013..2966be8f73 100644 --- a/.ncrunch/Avalonia.Skia.RenderTests.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Skia.RenderTests.v3.ncrunchproject @@ -4,6 +4,9 @@ ..\TestFiles\Skia\**.* 3000 + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Skia.UnitTests.v3.ncrunchproject b/.ncrunch/Avalonia.Skia.UnitTests.v3.ncrunchproject new file mode 100644 index 0000000000..e9d39b0c74 --- /dev/null +++ b/.ncrunch/Avalonia.Skia.UnitTests.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Skia.v3.ncrunchproject b/.ncrunch/Avalonia.Skia.v3.ncrunchproject index 95a483b433..e9d39b0c74 100644 --- a/.ncrunch/Avalonia.Skia.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Skia.v3.ncrunchproject @@ -1,3 +1,7 @@  - + + + MissingOrIgnoredProjectReference + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Styling.UnitTests.net47.v3.ncrunchproject b/.ncrunch/Avalonia.Styling.UnitTests.net47.v3.ncrunchproject new file mode 100644 index 0000000000..e9d39b0c74 --- /dev/null +++ b/.ncrunch/Avalonia.Styling.UnitTests.net47.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Styling.UnitTests.netcoreapp2.0.v3.ncrunchproject b/.ncrunch/Avalonia.Styling.UnitTests.netcoreapp2.0.v3.ncrunchproject new file mode 100644 index 0000000000..e9d39b0c74 --- /dev/null +++ b/.ncrunch/Avalonia.Styling.UnitTests.netcoreapp2.0.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Styling.v3.ncrunchproject b/.ncrunch/Avalonia.Styling.v3.ncrunchproject index 6800b4a3fe..e12537d535 100644 --- a/.ncrunch/Avalonia.Styling.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Styling.v3.ncrunchproject @@ -1,5 +1,8 @@  + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Themes.Default.v3.ncrunchproject b/.ncrunch/Avalonia.Themes.Default.v3.ncrunchproject index 6800b4a3fe..e12537d535 100644 --- a/.ncrunch/Avalonia.Themes.Default.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Themes.Default.v3.ncrunchproject @@ -1,5 +1,8 @@  + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.UnitTests.v3.ncrunchproject b/.ncrunch/Avalonia.UnitTests.v3.ncrunchproject index 6800b4a3fe..e12537d535 100644 --- a/.ncrunch/Avalonia.UnitTests.v3.ncrunchproject +++ b/.ncrunch/Avalonia.UnitTests.v3.ncrunchproject @@ -1,5 +1,8 @@  + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Visuals.UnitTests.net47.v3.ncrunchproject b/.ncrunch/Avalonia.Visuals.UnitTests.net47.v3.ncrunchproject new file mode 100644 index 0000000000..e9d39b0c74 --- /dev/null +++ b/.ncrunch/Avalonia.Visuals.UnitTests.net47.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Visuals.UnitTests.netcoreapp2.0.v3.ncrunchproject b/.ncrunch/Avalonia.Visuals.UnitTests.netcoreapp2.0.v3.ncrunchproject new file mode 100644 index 0000000000..e9d39b0c74 --- /dev/null +++ b/.ncrunch/Avalonia.Visuals.UnitTests.netcoreapp2.0.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.Visuals.v3.ncrunchproject b/.ncrunch/Avalonia.Visuals.v3.ncrunchproject index 6800b4a3fe..e12537d535 100644 --- a/.ncrunch/Avalonia.Visuals.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Visuals.v3.ncrunchproject @@ -1,5 +1,8 @@  + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Win32.Interop.v3.ncrunchproject b/.ncrunch/Avalonia.Win32.Interop.v3.ncrunchproject index 6800b4a3fe..e12537d535 100644 --- a/.ncrunch/Avalonia.Win32.Interop.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Win32.Interop.v3.ncrunchproject @@ -1,5 +1,8 @@  + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.Win32.v3.ncrunchproject b/.ncrunch/Avalonia.Win32.v3.ncrunchproject index 6800b4a3fe..e12537d535 100644 --- a/.ncrunch/Avalonia.Win32.v3.ncrunchproject +++ b/.ncrunch/Avalonia.Win32.v3.ncrunchproject @@ -1,5 +1,8 @@  + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/Avalonia.X11.v3.ncrunchproject b/.ncrunch/Avalonia.X11.v3.ncrunchproject new file mode 100644 index 0000000000..e9d39b0c74 --- /dev/null +++ b/.ncrunch/Avalonia.X11.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.netcoreapp2.0.v3.ncrunchproject b/.ncrunch/Avalonia.netcoreapp2.0.v3.ncrunchproject new file mode 100644 index 0000000000..3f3c53a7fd --- /dev/null +++ b/.ncrunch/Avalonia.netcoreapp2.0.v3.ncrunchproject @@ -0,0 +1,8 @@ + + + + DerivedFilesIncludedInWorkspace + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/.ncrunch/Avalonia.netstandard2.0.v3.ncrunchproject b/.ncrunch/Avalonia.netstandard2.0.v3.ncrunchproject new file mode 100644 index 0000000000..3f3c53a7fd --- /dev/null +++ b/.ncrunch/Avalonia.netstandard2.0.v3.ncrunchproject @@ -0,0 +1,8 @@ + + + + DerivedFilesIncludedInWorkspace + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/.ncrunch/Direct3DInteropSample.v3.ncrunchproject b/.ncrunch/Direct3DInteropSample.v3.ncrunchproject index 6800b4a3fe..e12537d535 100644 --- a/.ncrunch/Direct3DInteropSample.v3.ncrunchproject +++ b/.ncrunch/Direct3DInteropSample.v3.ncrunchproject @@ -1,5 +1,8 @@  + + MissingOrIgnoredProjectReference + True \ No newline at end of file diff --git a/.ncrunch/PlatformSanityChecks.v3.ncrunchproject b/.ncrunch/PlatformSanityChecks.v3.ncrunchproject new file mode 100644 index 0000000000..e9d39b0c74 --- /dev/null +++ b/.ncrunch/PlatformSanityChecks.v3.ncrunchproject @@ -0,0 +1,7 @@ + + + + MissingOrIgnoredProjectReference + + + \ No newline at end of file diff --git a/samples/ControlCatalog.Desktop/Program.cs b/samples/ControlCatalog.Desktop/Program.cs index b7aa34f5ba..2a8d288614 100644 --- a/samples/ControlCatalog.Desktop/Program.cs +++ b/samples/ControlCatalog.Desktop/Program.cs @@ -26,8 +26,7 @@ namespace ControlCatalog => AppBuilder.Configure() .LogToDebug() .UsePlatformDetect() - .UseReactiveUI() - .UseDataGrid(); + .UseReactiveUI(); private static void ConfigureAssetAssembly(AppBuilder builder) { diff --git a/samples/ControlCatalog.NetCore/Program.cs b/samples/ControlCatalog.NetCore/Program.cs index c8f3fb9921..93f5611ec4 100644 --- a/samples/ControlCatalog.NetCore/Program.cs +++ b/samples/ControlCatalog.NetCore/Program.cs @@ -47,8 +47,7 @@ namespace ControlCatalog.NetCore => AppBuilder.Configure() .UsePlatformDetect() .UseSkia() - .UseReactiveUI() - .UseDataGrid(); + .UseReactiveUI(); static void ConsoleSilencer() { diff --git a/samples/ControlCatalog/SideBar.xaml b/samples/ControlCatalog/SideBar.xaml index 3bae7edb00..3047b1e519 100644 --- a/samples/ControlCatalog/SideBar.xaml +++ b/samples/ControlCatalog/SideBar.xaml @@ -56,7 +56,7 @@ - + diff --git a/samples/RenderDemo/SideBar.xaml b/samples/RenderDemo/SideBar.xaml index 3af90f1844..e37b9bb5fc 100644 --- a/samples/RenderDemo/SideBar.xaml +++ b/samples/RenderDemo/SideBar.xaml @@ -47,7 +47,7 @@ - + diff --git a/samples/interop/WindowsInteropTest/Program.cs b/samples/interop/WindowsInteropTest/Program.cs index 9f005b942d..fac06d74b0 100644 --- a/samples/interop/WindowsInteropTest/Program.cs +++ b/samples/interop/WindowsInteropTest/Program.cs @@ -15,7 +15,7 @@ namespace WindowsInteropTest { System.Windows.Forms.Application.EnableVisualStyles(); System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false); - AppBuilder.Configure().UseWin32().UseDirect2D1().UseDataGrid().SetupWithoutStarting(); + AppBuilder.Configure().UseWin32().UseDirect2D1().SetupWithoutStarting(); System.Windows.Forms.Application.Run(new SelectorForm()); } } diff --git a/src/Avalonia.Animation/Animatable.cs b/src/Avalonia.Animation/Animatable.cs index 4b0f76c5d5..3a3d00b94a 100644 --- a/src/Avalonia.Animation/Animatable.cs +++ b/src/Avalonia.Animation/Animatable.cs @@ -7,7 +7,7 @@ using System.Linq; using System.Reactive.Linq; using Avalonia.Collections; using Avalonia.Data; -using Avalonia.Animation.Animators; +using Avalonia.Animation.Animators; namespace Avalonia.Animation { @@ -36,13 +36,27 @@ namespace Avalonia.Animation private Transitions _transitions; + private Dictionary _previousTransitions; + /// /// Gets or sets the property transitions for the control. /// public Transitions Transitions { - get { return _transitions ?? (_transitions = new Transitions()); } - set { SetAndRaise(TransitionsProperty, ref _transitions, value); } + get + { + if (_transitions == null) + _transitions = new Transitions(); + + if (_previousTransitions == null) + _previousTransitions = new Dictionary(); + + return _transitions; + } + set + { + SetAndRaise(TransitionsProperty, ref _transitions, value); + } } /// @@ -52,13 +66,18 @@ namespace Avalonia.Animation /// The event args. protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs e) { - if (e.Priority != BindingPriority.Animation && Transitions != null) + if (e.Priority != BindingPriority.Animation && Transitions != null && _previousTransitions != null) { var match = Transitions.FirstOrDefault(x => x.Property == e.Property); if (match != null) { - match.Apply(this, Clock ?? Avalonia.Animation.Clock.GlobalClock, e.OldValue, e.NewValue); + if (_previousTransitions.TryGetValue(e.Property, out var dispose)) + dispose.Dispose(); + + var instance = match.Apply(this, Clock ?? Avalonia.Animation.Clock.GlobalClock, e.OldValue, e.NewValue); + + _previousTransitions[e.Property] = instance; } } } diff --git a/src/Avalonia.Animation/Properties/AssemblyInfo.cs b/src/Avalonia.Animation/Properties/AssemblyInfo.cs index 985a8e5bfe..eb38a66a84 100644 --- a/src/Avalonia.Animation/Properties/AssemblyInfo.cs +++ b/src/Avalonia.Animation/Properties/AssemblyInfo.cs @@ -3,7 +3,10 @@ using Avalonia.Metadata; using System.Reflection; +using System.Runtime.CompilerServices; [assembly: XmlnsDefinition("https://github.com/avaloniaui", "Avalonia.Animation")] [assembly: XmlnsDefinition("https://github.com/avaloniaui", "Avalonia.Animation.Easings")] -[assembly: XmlnsDefinition("https://github.com/avaloniaui", "Avalonia.Animation.Animators")] \ No newline at end of file +[assembly: XmlnsDefinition("https://github.com/avaloniaui", "Avalonia.Animation.Animators")] + +[assembly: InternalsVisibleTo("Avalonia.LeakTests")] diff --git a/src/Avalonia.Animation/TransitionInstance.cs b/src/Avalonia.Animation/TransitionInstance.cs index eff2c4e9f3..10ea6bf523 100644 --- a/src/Avalonia.Animation/TransitionInstance.cs +++ b/src/Avalonia.Animation/TransitionInstance.cs @@ -30,13 +30,16 @@ namespace Avalonia.Animation { var interpVal = (double)t.Ticks / _duration.Ticks; - if (interpVal > 1d || interpVal < 0d) + // Clamp interpolation value. + if (interpVal >= 1d | interpVal < 0d) { + PublishNext(1d); PublishCompleted(); - return; } - - PublishNext(interpVal); + else + { + PublishNext(interpVal); + } } protected override void Unsubscribed() diff --git a/src/Avalonia.Controls.DataGrid/AppBuilderExtensions.cs b/src/Avalonia.Controls.DataGrid/AppBuilderExtensions.cs deleted file mode 100644 index bdb9bf182c..0000000000 --- a/src/Avalonia.Controls.DataGrid/AppBuilderExtensions.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) The Avalonia Project. All rights reserved. -// Licensed under the MIT license. See licence.md file in the project root for full license information. - -using Avalonia.Controls; -using Avalonia.Threading; - -namespace Avalonia -{ - public static class AppBuilderExtensions - { - public static TAppBuilder UseDataGrid(this TAppBuilder builder) - where TAppBuilder : AppBuilderBase, new() - { - // Portable.Xaml doesn't correctly load referenced assemblies and so doesn't - // find `DataGrid` when loading XAML. Call this method from AppBuilder as a - // temporary workaround until we fix XAML. - return builder; - } - } -} diff --git a/src/Avalonia.Controls/AppBuilderBase.cs b/src/Avalonia.Controls/AppBuilderBase.cs index a26b7d7405..419064b051 100644 --- a/src/Avalonia.Controls/AppBuilderBase.cs +++ b/src/Avalonia.Controls/AppBuilderBase.cs @@ -148,13 +148,20 @@ namespace Avalonia.Controls public delegate void AppMainDelegate(Application app, string[] args); + public void Start() + { + Setup(); + BeforeStartCallback(Self); + Instance.Run(); + } + public void Start(AppMainDelegate main, string[] args) { Setup(); BeforeStartCallback(Self); main(Instance, args); } - + /// /// Sets up the platform-specific services for the application, but does not run it. /// @@ -220,13 +227,13 @@ namespace Avalonia.Controls /// /// Sets the shutdown mode of the application. /// - /// The shutdown mode. + /// The shutdown mode. /// - public TAppBuilder SetExitMode(ExitMode exitMode) + public TAppBuilder SetShutdownMode(ShutdownMode shutdownMode) { - Instance.ExitMode = exitMode; + Instance.ShutdownMode = shutdownMode; return Self; - } + } protected virtual bool CheckSetup => true; diff --git a/src/Avalonia.Controls/Application.cs b/src/Avalonia.Controls/Application.cs index 1d4e4cbeaa..bbea3693cc 100644 --- a/src/Avalonia.Controls/Application.cs +++ b/src/Avalonia.Controls/Application.cs @@ -43,8 +43,8 @@ namespace Avalonia private readonly Styler _styler = new Styler(); private Styles _styles; private IResourceDictionary _resources; - private CancellationTokenSource _mainLoopCancellationTokenSource; + private int _exitCode; /// /// Initializes a new instance of the class. @@ -52,10 +52,14 @@ namespace Avalonia public Application() { Windows = new WindowCollection(this); - - OnExit += OnExiting; } + /// + public event EventHandler Startup; + + /// + public event EventHandler Exit; + /// public event EventHandler ResourcesChanged; @@ -164,14 +168,14 @@ namespace Avalonia IResourceNode IResourceNode.ResourceParent => null; /// - /// Gets or sets the . This property indicates whether the application exits explicitly or implicitly. - /// If is set to OnExplicitExit the application is only closes if Exit is called. + /// Gets or sets the . This property indicates whether the application is shutdown explicitly or implicitly. + /// If is set to OnExplicitShutdown the application is only closes if Shutdown is called. /// The default is OnLastWindowClose /// /// /// The shutdown mode. /// - public ExitMode ExitMode { get; set; } + public ShutdownMode ShutdownMode { get; set; } /// /// Gets or sets the main window of the application. @@ -190,108 +194,171 @@ namespace Avalonia public WindowCollection Windows { get; } /// - /// Gets or sets a value indicating whether this instance is existing. + /// Gets or sets a value indicating whether this instance is shutting down. /// /// - /// true if this instance is existing; otherwise, false. + /// true if this instance is shutting down; otherwise, false. /// - internal bool IsExiting { get; set; } + internal bool IsShuttingDown { get; private set; } /// /// Initializes the application by loading XAML etc. /// - public virtual void Initialize() + public virtual void Initialize() { } + + /// + /// Runs the application's main loop. + /// + /// + /// This will return when the condition is met + /// or was called. + /// + /// The application's exit code that is returned to the operating system on termination. + public int Run() { + return Run(new CancellationTokenSource()); } /// - /// Runs the application's main loop until the is closed. + /// Runs the application's main loop. /// - /// The closable to track - public void Run(ICloseable closable) + /// + /// This will return when the condition is met + /// or was called. + /// This also returns when is closed. + /// + /// The closable to track. + /// The application's exit code that is returned to the operating system on termination. + public int Run(ICloseable closable) { - if (_mainLoopCancellationTokenSource != null) + closable.Closed += (s, e) => _mainLoopCancellationTokenSource?.Cancel(); + + return Run(new CancellationTokenSource()); + } + + /// + /// Runs the application's main loop. + /// + /// + /// This will return when the condition is met + /// or was called. + /// + /// The window that is used as + /// when the isn't already set. + /// The application's exit code that is returned to the operating system on termination. + public int Run(Window mainWindow) + { + if (mainWindow == null) { - throw new Exception("Run should only called once"); + throw new ArgumentNullException(nameof(mainWindow)); } - closable.Closed += (s, e) => Exit(); - - _mainLoopCancellationTokenSource = new CancellationTokenSource(); + if (MainWindow == null) + { + Dispatcher.UIThread.Post(() => + { + if (!mainWindow.IsVisible) + { + mainWindow.Show(); + } - Dispatcher.UIThread.MainLoop(_mainLoopCancellationTokenSource.Token); + MainWindow = mainWindow; + }); + } - // Make sure we call OnExit in case an error happened and Exit() wasn't called explicitly - if (!IsExiting) - { - OnExit?.Invoke(this, EventArgs.Empty); - } + return Run(new CancellationTokenSource()); } - /// - /// Runs the application's main loop until some condition occurs that is specified by ExitMode. + /// Runs the application's main loop. /// - /// The main window - public void Run(Window mainWindow) + /// + /// This will return when the condition is met + /// or was called. + /// This also returns when the is canceled. + /// + /// The application's exit code that is returned to the operating system on termination. + /// The token to track. + public int Run(CancellationToken token) { - if (_mainLoopCancellationTokenSource != null) + return Run(CancellationTokenSource.CreateLinkedTokenSource(token)); + } + + private int Run(CancellationTokenSource tokenSource) + { + if (IsShuttingDown) { - throw new Exception("Run should only called once"); + throw new InvalidOperationException("Application is shutting down."); } - _mainLoopCancellationTokenSource = new CancellationTokenSource(); - - if (MainWindow == null) + if (_mainLoopCancellationTokenSource != null) { - if (mainWindow == null) - { - throw new ArgumentNullException(nameof(mainWindow)); - } + throw new InvalidOperationException("Application is already running."); + } - if (!mainWindow.IsVisible) - { - mainWindow.Show(); - } + _mainLoopCancellationTokenSource = tokenSource; - MainWindow = mainWindow; - } + Dispatcher.UIThread.Post(() => OnStartup(new StartupEventArgs()), DispatcherPriority.Send); Dispatcher.UIThread.MainLoop(_mainLoopCancellationTokenSource.Token); - // Make sure we call OnExit in case an error happened and Exit() wasn't called explicitly - if (!IsExiting) + if (!IsShuttingDown) { - OnExit?.Invoke(this, EventArgs.Empty); + Shutdown(_exitCode); } + + return _exitCode; } /// - /// Runs the application's main loop until the is canceled. + /// Raises the event. /// - /// The token to track - public void Run(CancellationToken token) + /// A that contains the event data. + protected virtual void OnStartup(StartupEventArgs e) { - Dispatcher.UIThread.MainLoop(token); - - // Make sure we call OnExit in case an error happened and Exit() wasn't called explicitly - if (!IsExiting) - { - OnExit?.Invoke(this, EventArgs.Empty); - } + Startup?.Invoke(this, e); } /// - /// Exits the application + /// Raises the event. /// - public void Exit() + /// A that contains the event data. + protected virtual void OnExit(ExitEventArgs e) { - IsExiting = true; + Exit?.Invoke(this, e); + } + + /// + public void Shutdown(int exitCode = 0) + { + if (IsShuttingDown) + { + throw new InvalidOperationException("Application is already shutting down."); + } + + _exitCode = exitCode; + + IsShuttingDown = true; Windows.Clear(); - OnExit?.Invoke(this, EventArgs.Empty); + try + { + var e = new ExitEventArgs { ApplicationExitCode = _exitCode }; + + OnExit(e); + + _exitCode = e.ApplicationExitCode; + } + finally + { + _mainLoopCancellationTokenSource?.Cancel(); + + _mainLoopCancellationTokenSource = null; + + IsShuttingDown = false; - _mainLoopCancellationTokenSource?.Cancel(); + Environment.ExitCode = _exitCode; + } } /// @@ -302,20 +369,6 @@ namespace Avalonia Styles.TryGetResource(key, out value); } - /// - /// Sent when the application is exiting. - /// - public event EventHandler OnExit; - - /// - /// Called when the application is exiting. - /// - /// - /// - protected virtual void OnExiting(object sender, EventArgs e) - { - } - /// /// Register's the services needed by Avalonia. /// diff --git a/src/Avalonia.Controls/ExitEventArgs.cs b/src/Avalonia.Controls/ExitEventArgs.cs new file mode 100644 index 0000000000..c99f7fe047 --- /dev/null +++ b/src/Avalonia.Controls/ExitEventArgs.cs @@ -0,0 +1,18 @@ +// Copyright (c) The Avalonia Project. All rights reserved. +// Licensed under the MIT license. See licence.md file in the project root for full license information. + +using System; + +namespace Avalonia.Controls +{ + /// + /// Contains the arguments for the event. + /// + public class ExitEventArgs : EventArgs + { + /// + /// Gets or sets the exit code that an application returns to the operating system when the application exits. + /// + public int ApplicationExitCode { get; set; } + } +} diff --git a/src/Avalonia.Controls/IApplicationLifecycle.cs b/src/Avalonia.Controls/IApplicationLifecycle.cs index 51f554c078..a3c6599b20 100644 --- a/src/Avalonia.Controls/IApplicationLifecycle.cs +++ b/src/Avalonia.Controls/IApplicationLifecycle.cs @@ -7,14 +7,20 @@ namespace Avalonia.Controls /// public interface IApplicationLifecycle { + /// + /// Sent when the application is starting up. + /// + event EventHandler Startup; + /// /// Sent when the application is exiting. /// - event EventHandler OnExit; + event EventHandler Exit; /// - /// Exits the application. + /// Shuts down the application and sets the exit code that is returned to the operating system when the application exits. /// - void Exit(); + /// An integer exit code for an application. The default exit code is 0. + void Shutdown(int exitCode = 0); } } diff --git a/src/Avalonia.Controls/ExitMode.cs b/src/Avalonia.Controls/ShutdownMode.cs similarity index 54% rename from src/Avalonia.Controls/ExitMode.cs rename to src/Avalonia.Controls/ShutdownMode.cs index b73fe4a963..46e27ff4e1 100644 --- a/src/Avalonia.Controls/ExitMode.cs +++ b/src/Avalonia.Controls/ShutdownMode.cs @@ -1,26 +1,26 @@ // Copyright (c) The Avalonia Project. All rights reserved. // Licensed under the MIT license. See licence.md file in the project root for full license information. -namespace Avalonia +namespace Avalonia.Controls { /// - /// Enum for ExitMode + /// Describes the possible values for . /// - public enum ExitMode + public enum ShutdownMode { /// - /// Indicates an implicit call to Application.Exit when the last window closes. + /// Indicates an implicit call to Application.Shutdown when the last window closes. /// OnLastWindowClose, /// - /// Indicates an implicit call to Application.Exit when the main window closes. + /// Indicates an implicit call to Application.Shutdown when the main window closes. /// OnMainWindowClose, /// - /// Indicates that the application only exits on an explicit call to Application.Exit. + /// Indicates that the application only exits on an explicit call to Application.Shutdown. /// - OnExplicitExit + OnExplicitShutdown } -} \ No newline at end of file +} diff --git a/src/Avalonia.Controls/StartupEventArgs.cs b/src/Avalonia.Controls/StartupEventArgs.cs new file mode 100644 index 0000000000..0e12f5c01a --- /dev/null +++ b/src/Avalonia.Controls/StartupEventArgs.cs @@ -0,0 +1,36 @@ +// Copyright (c) The Avalonia Project. All rights reserved. +// Licensed under the MIT license. See licence.md file in the project root for full license information. + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Avalonia.Controls +{ + /// + /// Contains the arguments for the event. + /// + public class StartupEventArgs : EventArgs + { + private string[] _args; + + /// + /// Gets the command line arguments that were passed to the application. + /// + public IReadOnlyList Args => _args ?? (_args = GetArgs()); + + private static string[] GetArgs() + { + try + { + var args = Environment.GetCommandLineArgs(); + + return args.Length > 1 ? args.Skip(1).ToArray() : new string[0]; + } + catch (NotSupportedException) + { + return new string[0]; + } + } + } +} diff --git a/src/Avalonia.Controls/TopLevel.cs b/src/Avalonia.Controls/TopLevel.cs index b08d55ff18..21bd0e4e57 100644 --- a/src/Avalonia.Controls/TopLevel.cs +++ b/src/Avalonia.Controls/TopLevel.cs @@ -127,7 +127,7 @@ namespace Avalonia.Controls if (_applicationLifecycle != null) { - _applicationLifecycle.OnExit += OnApplicationExiting; + _applicationLifecycle.Exit += OnApplicationExiting; } if (((IStyleHost)this).StylingParent is IResourceProvider applicationResources) @@ -281,7 +281,7 @@ namespace Avalonia.Controls Closed?.Invoke(this, EventArgs.Empty); Renderer?.Dispose(); Renderer = null; - _applicationLifecycle.OnExit -= OnApplicationExiting; + _applicationLifecycle.Exit -= OnApplicationExiting; } /// diff --git a/src/Avalonia.Controls/Window.cs b/src/Avalonia.Controls/Window.cs index e40e114769..01c9a3a110 100644 --- a/src/Avalonia.Controls/Window.cs +++ b/src/Avalonia.Controls/Window.cs @@ -250,7 +250,7 @@ namespace Avalonia.Controls /// /// Fired before a window is closed. /// - public event EventHandler Closing; + public event EventHandler Closing; private static void AddWindow(Window window) { @@ -440,7 +440,7 @@ namespace Avalonia.Controls /// public Task ShowDialog(IWindowImpl owner) { - if(owner == null) + if (owner == null) throw new ArgumentNullException(nameof(owner)); if (IsVisible) diff --git a/src/Avalonia.Controls/WindowCollection.cs b/src/Avalonia.Controls/WindowCollection.cs index df79c3e3c8..328bb9f147 100644 --- a/src/Avalonia.Controls/WindowCollection.cs +++ b/src/Avalonia.Controls/WindowCollection.cs @@ -107,24 +107,24 @@ namespace Avalonia return; } - if (_application.IsExiting) + if (_application.IsShuttingDown) { return; } - switch (_application.ExitMode) + switch (_application.ShutdownMode) { - case ExitMode.OnLastWindowClose: + case ShutdownMode.OnLastWindowClose: if (Count == 0) { - _application.Exit(); + _application.Shutdown(); } break; - case ExitMode.OnMainWindowClose: + case ShutdownMode.OnMainWindowClose: if (window == _application.MainWindow) { - _application.Exit(); + _application.Shutdown(); } break; diff --git a/tests/Avalonia.Animation.UnitTests/TransitionsTests.cs b/tests/Avalonia.Animation.UnitTests/TransitionsTests.cs new file mode 100644 index 0000000000..f1b4b0d071 --- /dev/null +++ b/tests/Avalonia.Animation.UnitTests/TransitionsTests.cs @@ -0,0 +1,73 @@ +using System; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Avalonia.Animation; +using Avalonia.Controls; +using Avalonia.Styling; +using Avalonia.UnitTests; +using Avalonia.Data; +using Xunit; +using Avalonia.Animation.Easings; + +namespace Avalonia.Animation.UnitTests +{ + public class TransitionsTests + { + [Fact] + public void Check_Transitions_Interpolation_Negative_Bounds_Clamp() + { + var clock = new MockGlobalClock(); + + using (UnitTestApplication.Start(new TestServices(globalClock: clock))) + { + var border = new Border + { + Transitions = + { + new DoubleTransition + { + Duration = TimeSpan.FromSeconds(1), + Property = Border.OpacityProperty, + } + } + }; + + border.Opacity = 0; + + clock.Pulse(TimeSpan.FromSeconds(0)); + clock.Pulse(TimeSpan.FromSeconds(-0.5)); + + Assert.Equal(0, border.Opacity); + } + } + + [Fact] + public void Check_Transitions_Interpolation_Positive_Bounds_Clamp() + { + var clock = new MockGlobalClock(); + + using (UnitTestApplication.Start(new TestServices(globalClock: clock))) + { + var border = new Border + { + Transitions = + { + new DoubleTransition + { + Duration = TimeSpan.FromSeconds(1), + Property = Border.OpacityProperty, + } + } + }; + + border.Opacity = 0; + + clock.Pulse(TimeSpan.FromSeconds(0)); + clock.Pulse(TimeSpan.FromMilliseconds(1001)); + + Assert.Equal(0, border.Opacity); + } + } + } +} diff --git a/tests/Avalonia.Controls.UnitTests/ApplicationTests.cs b/tests/Avalonia.Controls.UnitTests/ApplicationTests.cs index df14c808db..b7d752dfe3 100644 --- a/tests/Avalonia.Controls.UnitTests/ApplicationTests.cs +++ b/tests/Avalonia.Controls.UnitTests/ApplicationTests.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using Avalonia.Threading; using Avalonia.UnitTests; using Xunit; @@ -15,7 +16,11 @@ namespace Avalonia.Controls.UnitTests { using (UnitTestApplication.Start(TestServices.StyledWindow)) { - Application.Current.ExitMode = ExitMode.OnMainWindowClose; + Application.Current.ShutdownMode = ShutdownMode.OnMainWindowClose; + + var hasExit = false; + + Application.Current.Exit += (s, e) => hasExit = true; var mainWindow = new Window(); @@ -29,7 +34,7 @@ namespace Avalonia.Controls.UnitTests mainWindow.Close(); - Assert.True(Application.Current.IsExiting); + Assert.True(hasExit); } } @@ -38,7 +43,11 @@ namespace Avalonia.Controls.UnitTests { using (UnitTestApplication.Start(TestServices.StyledWindow)) { - Application.Current.ExitMode = ExitMode.OnLastWindowClose; + Application.Current.ShutdownMode = ShutdownMode.OnLastWindowClose; + + var hasExit = false; + + Application.Current.Exit += (s, e) => hasExit = true; var windowA = new Window(); @@ -50,11 +59,11 @@ namespace Avalonia.Controls.UnitTests windowA.Close(); - Assert.False(Application.Current.IsExiting); + Assert.False(hasExit); windowB.Close(); - Assert.True(Application.Current.IsExiting); + Assert.True(hasExit); } } @@ -63,7 +72,11 @@ namespace Avalonia.Controls.UnitTests { using (UnitTestApplication.Start(TestServices.StyledWindow)) { - Application.Current.ExitMode = ExitMode.OnExplicitExit; + Application.Current.ShutdownMode = ShutdownMode.OnExplicitShutdown; + + var hasExit = false; + + Application.Current.Exit += (s, e) => hasExit = true; var windowA = new Window(); @@ -75,15 +88,15 @@ namespace Avalonia.Controls.UnitTests windowA.Close(); - Assert.False(Application.Current.IsExiting); + Assert.False(hasExit); windowB.Close(); - Assert.False(Application.Current.IsExiting); + Assert.False(hasExit); - Application.Current.Exit(); + Application.Current.Shutdown(); - Assert.True(Application.Current.IsExiting); + Assert.True(hasExit); } } @@ -99,7 +112,7 @@ namespace Avalonia.Controls.UnitTests window.Show(); } - Application.Current.Exit(); + Application.Current.Shutdown(); Assert.Empty(Application.Current.Windows); } @@ -129,5 +142,18 @@ namespace Avalonia.Controls.UnitTests Assert.True(raised); } } + + [Fact] + public void Should_Set_ExitCode_After_Shutdown() + { + using (UnitTestApplication.Start(TestServices.MockThreadingInterface)) + { + Application.Current.Shutdown(1337); + + var exitCode = Application.Current.Run(); + + Assert.Equal(1337, exitCode); + } + } } } diff --git a/tests/Avalonia.Controls.UnitTests/TopLevelTests.cs b/tests/Avalonia.Controls.UnitTests/TopLevelTests.cs index 014bf458ea..aa99d31cff 100644 --- a/tests/Avalonia.Controls.UnitTests/TopLevelTests.cs +++ b/tests/Avalonia.Controls.UnitTests/TopLevelTests.cs @@ -215,7 +215,7 @@ namespace Avalonia.Controls.UnitTests var impl = new Mock(); impl.SetupAllProperties(); var target = new TestTopLevel(impl.Object); - UnitTestApplication.Current.Exit(); + UnitTestApplication.Current.Shutdown(); Assert.True(target.IsClosed); } } diff --git a/tests/Avalonia.LeakTests/TransitionTests.cs b/tests/Avalonia.LeakTests/TransitionTests.cs new file mode 100644 index 0000000000..c7add1fe11 --- /dev/null +++ b/tests/Avalonia.LeakTests/TransitionTests.cs @@ -0,0 +1,60 @@ +using System; +using Avalonia.Animation; +using Avalonia.Controls; +using Avalonia.UnitTests; +using JetBrains.dotMemoryUnit; +using Xunit; +using Xunit.Abstractions; + +namespace Avalonia.LeakTests +{ + [DotMemoryUnit(FailIfRunWithoutSupport = false)] + public class TransitionTests + { + public TransitionTests(ITestOutputHelper atr) + { + DotMemoryUnitTestOutput.SetOutputMethod(atr.WriteLine); + } + + [Fact(Skip = "TODO: Fix this leak")] + public void Transition_On_StyledProperty_Is_Freed() + { + var clock = new MockGlobalClock(); + + using (UnitTestApplication.Start(new TestServices(globalClock: clock))) + { + Func run = () => + { + var border = new Border + { + Transitions = + { + new DoubleTransition + { + Duration = TimeSpan.FromSeconds(1), + Property = Border.OpacityProperty, + } + } + }; + + border.Opacity = 0; + + clock.Pulse(TimeSpan.FromSeconds(0)); + clock.Pulse(TimeSpan.FromSeconds(0.5)); + + Assert.Equal(0.5, border.Opacity); + + clock.Pulse(TimeSpan.FromSeconds(1)); + + Assert.Equal(0, border.Opacity); + return border; + }; + + var result = run(); + + dotMemory.Check(memory => + Assert.Equal(0, memory.GetObjects(where => where.Type.Is()).ObjectsCount)); + } + } + } +} diff --git a/tests/Avalonia.UnitTests/MockGlobalClock.cs b/tests/Avalonia.UnitTests/MockGlobalClock.cs new file mode 100644 index 0000000000..b53e5acc01 --- /dev/null +++ b/tests/Avalonia.UnitTests/MockGlobalClock.cs @@ -0,0 +1,10 @@ +using System; +using Avalonia.Animation; + +namespace Avalonia.UnitTests +{ + public class MockGlobalClock : ClockBase, IGlobalClock + { + public new void Pulse(TimeSpan systemTime) => base.Pulse(systemTime); + } +} diff --git a/tests/Avalonia.UnitTests/TestServices.cs b/tests/Avalonia.UnitTests/TestServices.cs index d68f1d167a..f7a878feba 100644 --- a/tests/Avalonia.UnitTests/TestServices.cs +++ b/tests/Avalonia.UnitTests/TestServices.cs @@ -16,6 +16,7 @@ using System.Reactive.Concurrency; using System.Collections.Generic; using Avalonia.Controls; using System.Reflection; +using Avalonia.Animation; namespace Avalonia.UnitTests { @@ -58,6 +59,7 @@ namespace Avalonia.UnitTests public TestServices( IAssetLoader assetLoader = null, IFocusManager focusManager = null, + IGlobalClock globalClock = null, IInputManager inputManager = null, Func keyboardDevice = null, IKeyboardNavigationHandler keyboardNavigation = null, @@ -75,6 +77,7 @@ namespace Avalonia.UnitTests { AssetLoader = assetLoader; FocusManager = focusManager; + GlobalClock = globalClock; InputManager = inputManager; KeyboardDevice = keyboardDevice; KeyboardNavigation = keyboardNavigation; @@ -93,6 +96,7 @@ namespace Avalonia.UnitTests public IAssetLoader AssetLoader { get; } public IInputManager InputManager { get; } public IFocusManager FocusManager { get; } + public IGlobalClock GlobalClock { get; } public Func KeyboardDevice { get; } public IKeyboardNavigationHandler KeyboardNavigation { get; } public Func MouseDevice { get; } @@ -109,6 +113,7 @@ namespace Avalonia.UnitTests public TestServices With( IAssetLoader assetLoader = null, IFocusManager focusManager = null, + IGlobalClock globalClock = null, IInputManager inputManager = null, Func keyboardDevice = null, IKeyboardNavigationHandler keyboardNavigation = null, @@ -127,6 +132,7 @@ namespace Avalonia.UnitTests return new TestServices( assetLoader: assetLoader ?? AssetLoader, focusManager: focusManager ?? FocusManager, + globalClock: globalClock ?? GlobalClock, inputManager: inputManager ?? InputManager, keyboardDevice: keyboardDevice ?? KeyboardDevice, keyboardNavigation: keyboardNavigation ?? KeyboardNavigation, diff --git a/tests/Avalonia.UnitTests/UnitTestApplication.cs b/tests/Avalonia.UnitTests/UnitTestApplication.cs index 4802278c1e..3578471397 100644 --- a/tests/Avalonia.UnitTests/UnitTestApplication.cs +++ b/tests/Avalonia.UnitTests/UnitTestApplication.cs @@ -12,6 +12,7 @@ using Avalonia.Threading; using System.Reactive.Disposables; using System.Reactive.Concurrency; using Avalonia.Input.Platform; +using Avalonia.Animation; namespace Avalonia.UnitTests { @@ -52,6 +53,7 @@ namespace Avalonia.UnitTests AvaloniaLocator.CurrentMutable .Bind().ToConstant(Services.AssetLoader) .Bind().ToConstant(Services.FocusManager) + .Bind().ToConstant(Services.GlobalClock) .BindToSelf(this) .Bind().ToConstant(Services.InputManager) .Bind().ToConstant(Services.KeyboardDevice?.Invoke())