From 8e85161b816222a238b4e7e27eafc0176e810a50 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 12 Dec 2019 20:39:20 +0100 Subject: [PATCH] Recreate as a VS2019 extension --- scrcpy-vs.sln | 16 +- scrcpy-vs/Key.snk | Bin 596 -> 596 bytes scrcpy-vs/Properties/AssemblyInfo.cs | 4 +- .../UI/Resources/ScrcpyToolWindowPackage.ico | Bin 428446 -> 0 bytes scrcpy-vs/UI/Resources/ext-icon.ico | Bin 0 -> 37110 bytes .../{ScrcpyToolWindow.cs => ScrcpyWindow.cs} | 20 +- ...indowCommand.cs => ScrcpyWindowCommand.cs} | 35 ++-- ...wControl.xaml => ScrcpyWindowControl.xaml} | 8 +- ...ol.xaml.cs => ScrcpyWindowControl.xaml.cs} | 8 +- ...indowPackage.cs => ScrcpyWindowPackage.cs} | 39 +++- ...wPackage.vsct => ScrcpyWindowPackage.vsct} | 10 +- scrcpy-vs/UI/VSPackage.resx | 72 +++---- scrcpy-vs/packages.config | 28 --- scrcpy-vs/scrcpy-vs.csproj | 191 +++++------------- scrcpy-vs/source.extension.vsixmanifest | 10 +- 15 files changed, 159 insertions(+), 282 deletions(-) delete mode 100644 scrcpy-vs/UI/Resources/ScrcpyToolWindowPackage.ico create mode 100644 scrcpy-vs/UI/Resources/ext-icon.ico rename scrcpy-vs/UI/{ScrcpyToolWindow.cs => ScrcpyWindow.cs} (68%) rename scrcpy-vs/UI/{ScrcpyToolWindowCommand.cs => ScrcpyWindowCommand.cs} (65%) rename scrcpy-vs/UI/{ScrcpyToolWindowControl.xaml => ScrcpyWindowControl.xaml} (93%) rename scrcpy-vs/UI/{ScrcpyToolWindowControl.xaml.cs => ScrcpyWindowControl.xaml.cs} (94%) rename scrcpy-vs/UI/{ScrcpyToolWindowPackage.cs => ScrcpyWindowPackage.cs} (75%) rename scrcpy-vs/UI/{ScrcpyToolWindowPackage.vsct => ScrcpyWindowPackage.vsct} (90%) delete mode 100644 scrcpy-vs/packages.config diff --git a/scrcpy-vs.sln b/scrcpy-vs.sln index 34005b1..58cd21e 100644 --- a/scrcpy-vs.sln +++ b/scrcpy-vs.sln @@ -1,9 +1,9 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27703.2026 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29609.76 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "scrcpy-vs", "scrcpy-vs\scrcpy-vs.csproj", "{28F1DDE5-CCDF-4121-B369-90519C757951}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "scrcpy-vs", "scrcpy-vs\scrcpy-vs.csproj", "{3B6D9C25-3629-4574-B459-945A05BB8A9C}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -11,15 +11,15 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {28F1DDE5-CCDF-4121-B369-90519C757951}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {28F1DDE5-CCDF-4121-B369-90519C757951}.Debug|Any CPU.Build.0 = Debug|Any CPU - {28F1DDE5-CCDF-4121-B369-90519C757951}.Release|Any CPU.ActiveCfg = Release|Any CPU - {28F1DDE5-CCDF-4121-B369-90519C757951}.Release|Any CPU.Build.0 = Release|Any CPU + {3B6D9C25-3629-4574-B459-945A05BB8A9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3B6D9C25-3629-4574-B459-945A05BB8A9C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3B6D9C25-3629-4574-B459-945A05BB8A9C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3B6D9C25-3629-4574-B459-945A05BB8A9C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {D7324178-ED2C-40A2-A2CF-A8B30B08A4BC} + SolutionGuid = {24D73EE2-7B2B-40D6-B777-A6A6A21C0290} EndGlobalSection EndGlobal diff --git a/scrcpy-vs/Key.snk b/scrcpy-vs/Key.snk index aef7442c1f10b99ff506a12001d030d94869f373..6ae31cfe22d5123ed22cf795f2cd5eeafd6efad4 100644 GIT binary patch delta 587 zcmV-R0<`_q1k?nO6o1hGqT=wZqE9-0U3UMdgi!UrjD~de8Jd%z!4MxWN>02R7bz}u zJD_v1gR3~beuMpPnS~H*kT;!mq>`JXpl(0>^nSnv-fHkpnf+%@SuD;!t0xDx84u*~ z!Z4ow9@JnS@xh@%QI4gqqFQzeGo)yy>903ng$T zCN$tZ0M)R3pl$wqbbX4h^{sxm+1x;rPTrEQ@IeORoGR#%0l-S(Zt2^MP$={hulMmk zi-5yZf*$u`Z`0ekf*vhPYKAJGC}(LPDqX>5X7%8@i0wE|9ZFCdPP#V%s?cr>9Rs3~ z5ZB%3S#ncHO@ANYNB$_BBK1$z;RtV8<3`LVMM3;cFGDo#rMghaDe)e}wy6o$!hMDB zqHPA^*$Pn7Sg&mh`rxkZ@1pcIa}5ffTVH7#yTkiHHoR|gczi@kT1ux5j9g-_Kb*&2 z1r6RLiwnv&AvIbdnD`hBY2+Sh*&2CT2z$s-XfC8Ab$@P74S%Vk4(D@$(_gqcBr1)M zc9P%1XH3{K*O|}Fwl+KM)`@cY}H`^^-%I7b6N76+*5=s_ClbjB9(TdC9qGmm(@FXEAie zmNU-O)r@Odxo!T=d+-r!C)OPg|0HPT>4+3pW`E%R^sadWnbpA zbNvf76M{PsK&}}3)VM!dq(qObaB|5~mC{;p7z{Vm9pqyPIz5VH{=TbNlioOl^MOsj z^_C+H$fIhErhm!KGbBwD@cs*sM!+flsJ%-eeAst zQ})kXFUXu~885y??pF)?og@F(Q2?b*!!02f9VIW5r(+hZR_qZoZqU&5Ma6A9CNtz< z$74!^s|<|jX^;biOWV&xVvuNaM~yx*v`Vo$%nq`OQh#lRpVtU*8~r_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HK)yhNqW2qa zp&9vQM4qMgN9E?n@;hsw-1AXxe$LY4zbj$;&!7$r;PqeH{Rk>LV<;OlrPepwzq1B> z&PNvU7xMQXD1NX|W%eJe@Yoy6Us`|by!xHv|3d%%Q-3Zk*PYga1QmV$DVN+jAC|xJ z^Do(7rHf^^|4Iui@n`wn0$7plsPBxV^Z8WtJ^%CY_aShG`1c`jUi9C`(DhN0`~IG_ zFEqyPk74JHtGha0q+g4m6s^PChBw9s0Kzv{cRb(w=I=Ky{W!XJMN9hU!>OUE58@xM zkG=l#kuC8HM`jLWZ~xsjuw>=3$KE>_8UHNyOy9t@OFvzioQ&Rl1phCkH1+{e%gmYc zyACEk`FbGQ_Up*Wnwh7Ob1k&cFIN;~(jzlZU54&M8~1+t>k1V{Y)^V_AY-@pJ9B){@*p{KocmI82&#m6n;qZ2+$x~(Bd1V*W^lyDT z{h;LpoAojKcw6nVFDI@~T>bEsug*R2#Y?bn-@YA3Kfm?X_2Ibv9BujG(IXwH^Jo7V zQLc@AG`4Z_wLiB1we!TSZ~nY<;rl~7?p&YzC0+B*cgYj?oU|D4ndQ4<4I^zwBeVBj xXo8DjTVqtmy5YCBvHj0o-1_Z_CO}x-xwd1XebXLZC;92&b)xHn*NMDN{s$ywGy?zt literal 0 HcmV?d00001 diff --git a/scrcpy-vs/UI/ScrcpyToolWindow.cs b/scrcpy-vs/UI/ScrcpyWindow.cs similarity index 68% rename from scrcpy-vs/UI/ScrcpyToolWindow.cs rename to scrcpy-vs/UI/ScrcpyWindow.cs index e457896..5367c90 100644 --- a/scrcpy-vs/UI/ScrcpyToolWindow.cs +++ b/scrcpy-vs/UI/ScrcpyWindow.cs @@ -1,9 +1,9 @@ -namespace scrcpy.VisualStudio.UI -{ - using System; - using System.Runtime.InteropServices; - using Microsoft.VisualStudio.Shell; +using System; +using System.Runtime.InteropServices; +using Microsoft.VisualStudio.Shell; +namespace scrcpy.VisualStudio.UI +{ ///

/// This class implements the tool window exposed by this package and hosts a user control. /// @@ -15,20 +15,20 @@ /// implementation of the IVsUIElementPane interface. /// /// - [Guid("e4ebc168-7fd1-42b4-9c77-8340a86f8644")] - public class ScrcpyToolWindow : ToolWindowPane + [Guid("f3c9e782-7825-4f77-b696-a53218ca48ad")] + public class ScrcpyWindow : ToolWindowPane { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public ScrcpyToolWindow() : base(null) + public ScrcpyWindow() : base(null) { this.Caption = "scrcpy"; // This is the user control hosted by the tool window; Note that, even if this class implements IDisposable, // we are not calling Dispose on this object. This is because ToolWindowPane calls Dispose on // the object returned by the Content property. - this.Content = new ScrcpyToolWindowControl(); + this.Content = new ScrcpyWindowControl(); } } } diff --git a/scrcpy-vs/UI/ScrcpyToolWindowCommand.cs b/scrcpy-vs/UI/ScrcpyWindowCommand.cs similarity index 65% rename from scrcpy-vs/UI/ScrcpyToolWindowCommand.cs rename to scrcpy-vs/UI/ScrcpyWindowCommand.cs index e124df4..4200ba3 100644 --- a/scrcpy-vs/UI/ScrcpyToolWindowCommand.cs +++ b/scrcpy-vs/UI/ScrcpyWindowCommand.cs @@ -12,7 +12,7 @@ namespace scrcpy.VisualStudio.UI /// /// Command handler /// - internal sealed class ScrcpyToolWindowCommand + internal sealed class ScrcpyWindowCommand { /// /// Command ID. @@ -22,7 +22,7 @@ internal sealed class ScrcpyToolWindowCommand /// /// Command menu group (command set GUID). /// - public static readonly Guid CommandSet = new Guid("94db034e-bda6-45cc-8f5a-3f278c8068d8"); + public static readonly Guid CommandSet = new Guid("f72d56e5-b073-4fcc-9ae0-eb42776b3a3c"); /// /// VS Package that provides this command, not null. @@ -30,12 +30,12 @@ internal sealed class ScrcpyToolWindowCommand private readonly AsyncPackage package; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// Adds our command handlers for menu (commands must exist in the command table file) /// /// Owner package, not null. /// Command service to add command to, not null. - private ScrcpyToolWindowCommand(AsyncPackage package, OleMenuCommandService commandService) + private ScrcpyWindowCommand(AsyncPackage package, OleMenuCommandService commandService) { this.package = package ?? throw new ArgumentNullException(nameof(package)); commandService = commandService ?? throw new ArgumentNullException(nameof(commandService)); @@ -48,7 +48,7 @@ private ScrcpyToolWindowCommand(AsyncPackage package, OleMenuCommandService comm /// /// Gets the instance of the command. /// - public static ScrcpyToolWindowCommand Instance + public static ScrcpyWindowCommand Instance { get; private set; @@ -71,12 +71,12 @@ private Microsoft.VisualStudio.Shell.IAsyncServiceProvider ServiceProvider /// Owner package, not null. public static async Task InitializeAsync(AsyncPackage package) { - // Verify the current thread is the UI thread - the call to AddCommand in ScrcpyToolWindowCommand's constructor requires + // Switch to the main thread - the call to AddCommand in ScrcpyWindowCommand's constructor requires // the UI thread. - ThreadHelper.ThrowIfNotOnUIThread(); + await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(package.DisposalToken); OleMenuCommandService commandService = await package.GetServiceAsync((typeof(IMenuCommandService))) as OleMenuCommandService; - Instance = new ScrcpyToolWindowCommand(package, commandService); + Instance = new ScrcpyWindowCommand(package, commandService); } /// @@ -86,19 +86,14 @@ public static async Task InitializeAsync(AsyncPackage package) /// The event args. private void Execute(object sender, EventArgs e) { - ThreadHelper.ThrowIfNotOnUIThread(); - - // Get the instance number 0 of this tool window. This window is single instance so this instance - // is actually the only one. - // The last flag is set to true so that if the tool window does not exists it will be created. - ToolWindowPane window = this.package.FindToolWindow(typeof(ScrcpyToolWindow), 0, true); - if ((null == window) || (null == window.Frame)) + this.package.JoinableTaskFactory.RunAsync(async delegate { - throw new NotSupportedException("Cannot create tool window"); - } - - IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame; - Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(windowFrame.Show()); + ToolWindowPane window = await this.package.ShowToolWindowAsync(typeof(ScrcpyWindow), 0, true, this.package.DisposalToken); + if ((null == window) || (null == window.Frame)) + { + throw new NotSupportedException("Cannot create tool window"); + } + }); } } } diff --git a/scrcpy-vs/UI/ScrcpyToolWindowControl.xaml b/scrcpy-vs/UI/ScrcpyWindowControl.xaml similarity index 93% rename from scrcpy-vs/UI/ScrcpyToolWindowControl.xaml rename to scrcpy-vs/UI/ScrcpyWindowControl.xaml index 5a49103..a55efaa 100644 --- a/scrcpy-vs/UI/ScrcpyToolWindowControl.xaml +++ b/scrcpy-vs/UI/ScrcpyWindowControl.xaml @@ -1,12 +1,10 @@ - /// Interaction logic for ScrcpyToolWindowControl. /// - public partial class ScrcpyToolWindowControl : UserControl, IDisposable + public partial class ScrcpyWindowControl : UserControl, IDisposable { /// /// The delay introduced before refreshing devices. @@ -45,14 +45,14 @@ public partial class ScrcpyToolWindowControl : UserControl, IDisposable /// /// Initializes a new instance of the class. /// - public ScrcpyToolWindowControl() + public ScrcpyWindowControl() { _viewModel = new ScrcpyViewModel(); _viewModel.ScrcpyStartRequested += ScrcpyStartRequested; _viewModel.ScrcpyStopRequested += (s, e) => windowHost.CleanUp(); DataContext = _viewModel; - jtf = new JoinableTaskFactory(new JoinableTaskContext()); + jtf = new JoinableTaskFactory(Microsoft.VisualStudio.Shell.ThreadHelper.JoinableTaskContext); _deviceWatcher = new DeviceWatcher(); async void deviceChangedHandler(object s, EventArgs e) => await DevicesChangedEventAsync(); _deviceWatcher.DeviceChanged += deviceChangedHandler; @@ -120,7 +120,7 @@ protected virtual void Dispose(bool disposing) } } - ~ScrcpyToolWindowControl() + ~ScrcpyWindowControl() { Dispose(false); } diff --git a/scrcpy-vs/UI/ScrcpyToolWindowPackage.cs b/scrcpy-vs/UI/ScrcpyWindowPackage.cs similarity index 75% rename from scrcpy-vs/UI/ScrcpyToolWindowPackage.cs rename to scrcpy-vs/UI/ScrcpyWindowPackage.cs index e906bfc..df544dc 100644 --- a/scrcpy-vs/UI/ScrcpyToolWindowPackage.cs +++ b/scrcpy-vs/UI/ScrcpyWindowPackage.cs @@ -35,26 +35,26 @@ namespace scrcpy.VisualStudio.UI [PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)] [InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)] // Info on this package for Help/About [ProvideMenuResource("Menus.ctmenu", 1)] - [ProvideToolWindow(typeof(ScrcpyToolWindow))] - [Guid(ScrcpyToolWindowPackage.PackageGuidString)] + [ProvideToolWindow(typeof(ScrcpyWindow))] + [Guid(ScrcpyWindowPackage.PackageGuidString)] [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "pkgdef, VS and vsixmanifest are valid VS terms")] - public sealed class ScrcpyToolWindowPackage : AsyncPackage + public sealed class ScrcpyWindowPackage : AsyncPackage { /// - /// ScrcpyToolWindowPackage GUID string. + /// ScrcpyWindowPackage GUID string. /// - public const string PackageGuidString = "c672548b-255d-438c-91b9-b18acadfac63"; + public const string PackageGuidString = "9e042473-074b-4938-a921-c3c1b8c6429d"; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// - public ScrcpyToolWindowPackage() + public ScrcpyWindowPackage() { // Inside this method you can place any initialization code that does not require // any Visual Studio service because at this point the package object is created but // not sited yet inside Visual Studio environment. The place to do all the other // initialization is the Initialize method. - } + } #region Package Members @@ -70,7 +70,28 @@ protected override async Task InitializeAsync(CancellationToken cancellationToke // When initialized asynchronously, the current thread may be a background thread at this point. // Do any initialization that requires the UI thread after switching to the UI thread. await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); - await ScrcpyToolWindowCommand.InitializeAsync(this); + await ScrcpyWindowCommand.InitializeAsync(this); + } + + public override IVsAsyncToolWindowFactory GetAsyncToolWindowFactory(Guid toolWindowType) + { + ThreadHelper.ThrowIfNotOnUIThread(); + if (toolWindowType == typeof(ScrcpyWindow).GUID) + { + return this; + } + + return base.GetAsyncToolWindowFactory(toolWindowType); + } + + protected override string GetToolWindowTitle(Type toolWindowType, int id) + { + if (toolWindowType == typeof(ScrcpyWindow)) + { + return "ScrcpyWindow loading"; + } + + return base.GetToolWindowTitle(toolWindowType, id); } #endregion diff --git a/scrcpy-vs/UI/ScrcpyToolWindowPackage.vsct b/scrcpy-vs/UI/ScrcpyWindowPackage.vsct similarity index 90% rename from scrcpy-vs/UI/ScrcpyToolWindowPackage.vsct rename to scrcpy-vs/UI/ScrcpyWindowPackage.vsct index 106dc08..d875150 100644 --- a/scrcpy-vs/UI/ScrcpyToolWindowPackage.vsct +++ b/scrcpy-vs/UI/ScrcpyWindowPackage.vsct @@ -22,7 +22,7 @@ - + -