From 0f13fa2493c360ebe0aa0fbbaf33359147484729 Mon Sep 17 00:00:00 2001 From: Mathew Sachin Date: Thu, 11 Oct 2018 21:29:32 +0530 Subject: [PATCH] Fix Cmdline Region capture --- src/Captura.Core/Captura.Core.csproj | 2 +- src/Captura.Core/Fakes/FakeNotification.cs | 3 +++ src/Captura.Core/Fakes/FakeRegionItem.cs | 27 ------------------- src/Captura.Core/Fakes/FakeRegionProvider.cs | 2 +- .../Models/RegionItem.cs | 7 +++-- src/Captura/Captura.csproj | 1 - 6 files changed, 8 insertions(+), 34 deletions(-) delete mode 100644 src/Captura.Core/Fakes/FakeRegionItem.cs rename src/{Captura => Captura.Core}/Models/RegionItem.cs (89%) diff --git a/src/Captura.Core/Captura.Core.csproj b/src/Captura.Core/Captura.Core.csproj index 7f6869602..5560e7712 100644 --- a/src/Captura.Core/Captura.Core.csproj +++ b/src/Captura.Core/Captura.Core.csproj @@ -38,7 +38,6 @@ - @@ -52,6 +51,7 @@ + diff --git a/src/Captura.Core/Fakes/FakeNotification.cs b/src/Captura.Core/Fakes/FakeNotification.cs index 67252adf6..fa3556da7 100644 --- a/src/Captura.Core/Fakes/FakeNotification.cs +++ b/src/Captura.Core/Fakes/FakeNotification.cs @@ -20,7 +20,10 @@ public string SecondaryText public bool Finished { get; set; } public bool Success { get; set; } + +#pragma warning disable CS0067 public event Action Click; +#pragma warning restore CS0067 public void Remove() { } } diff --git a/src/Captura.Core/Fakes/FakeRegionItem.cs b/src/Captura.Core/Fakes/FakeRegionItem.cs deleted file mode 100644 index 7b2d48802..000000000 --- a/src/Captura.Core/Fakes/FakeRegionItem.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Drawing; -using Screna; - -namespace Captura.Models -{ - class FakeRegionItem : NotifyPropertyChanged, IVideoItem - { - readonly Rectangle _rect; - - public FakeRegionItem(Rectangle Region) - { - _rect = Region; - } - - public string Name => LanguageManager.Instance.RegionSelector; - - public IImageProvider GetImageProvider(bool IncludeCursor, out Func Transform) - { - Transform = P => new Point(P.X - _rect.X, P.Y - _rect.Y); - - return new RegionProvider(_rect, IncludeCursor); - } - - public override string ToString() => Name; - } -} diff --git a/src/Captura.Core/Fakes/FakeRegionProvider.cs b/src/Captura.Core/Fakes/FakeRegionProvider.cs index 0040139a3..bcd8dfe5b 100644 --- a/src/Captura.Core/Fakes/FakeRegionProvider.cs +++ b/src/Captura.Core/Fakes/FakeRegionProvider.cs @@ -17,7 +17,7 @@ public bool SelectorVisible public Rectangle SelectedRegion { get; set; } - public IVideoItem VideoSource => new FakeRegionItem(SelectedRegion); + public IVideoItem VideoSource => new RegionItem(this); #pragma warning disable CS0067 public event Action SelectorHidden; diff --git a/src/Captura/Models/RegionItem.cs b/src/Captura.Core/Models/RegionItem.cs similarity index 89% rename from src/Captura/Models/RegionItem.cs rename to src/Captura.Core/Models/RegionItem.cs index 2e27f818b..294a68d0e 100644 --- a/src/Captura/Models/RegionItem.cs +++ b/src/Captura.Core/Models/RegionItem.cs @@ -1,11 +1,10 @@ -using Captura.Models; -using System; +using System; using System.Drawing; using Screna; -namespace Captura +namespace Captura.Models { - class RegionItem : NotifyPropertyChanged, IVideoItem + public class RegionItem : NotifyPropertyChanged, IVideoItem { readonly IRegionProvider _selector; diff --git a/src/Captura/Captura.csproj b/src/Captura/Captura.csproj index b5d6cbd74..24bc13050 100644 --- a/src/Captura/Captura.csproj +++ b/src/Captura/Captura.csproj @@ -191,7 +191,6 @@ - PositionSettingsControl.xaml