From d6cbed0ec6fdde306fe6245c4ceefb4a4249dc34 Mon Sep 17 00:00:00 2001 From: the-coderok Date: Thu, 13 Mar 2014 15:21:47 -0700 Subject: [PATCH] Created new project --- VSPackageInstall/Guids.cs | 15 - VSPackageInstall/Key.snk | Bin 596 -> 0 bytes VSPackageInstall/MyControl.xaml | 17 - VSPackageInstall/MyControl.xaml.cs | 35 -- VSPackageInstall/MyToolWindow.cs | 47 -- VSPackageInstall/PkgCmdID.cs | 13 - VSPackageInstall/Resources/Images.png | Bin 994 -> 0 bytes VSPackageInstall/VSPackageInstall.vsct | 125 ------ VSPackageInstall/VSPackageInstallPackage.cs | 147 ------- .../DialogboxPurger.cs | 359 ---------------- .../IntegrationTest Library/NativeMethods.cs | 154 ------- .../IntegrationTest Library/Utils.cs | 401 ------------------ .../VSPackageInstall_IntegrationTests/Key.snk | Bin 596 -> 0 bytes .../MenuItemTest.cs | 66 --- .../PackageTest.cs | 59 --- .../SignOff-Tests/CPPProjectTests.cs | 109 ----- .../SignOff-Tests/CSharpProjectTests.cs | 83 ---- .../SignOff-Tests/SolutionTests.cs | 55 --- .../SignOff-Tests/VBProjectTests.cs | 101 ----- .../ToolWindowTest.cs | 56 --- .../VSPackageInstall_IntegrationTests.csproj | 91 ---- .../VSPackageInstall_UnitTests/Key.snk | Bin 596 -> 0 bytes .../MenuItemTests/MenuItemCallback.cs | 80 ---- .../MenuItemTests/UIShellServiceMock.cs | 76 ---- .../MyToolWindowTest/MyToolWindow.cs | 58 --- .../MyToolWindowTest/ShowToolWindow.cs | 77 ---- .../MyToolWindowTest/UIShellServiceMock.cs | 84 ---- .../MyToolWindowTest/WindowFrameMock.cs | 39 -- .../VSPackageInstall_UnitTests/PackageTest.cs | 56 --- .../VSPackageInstall_UnitTests.csproj | 84 ---- VsDingExtension.sln | 30 +- VsDingExtension/AssemblyInfo.cs | 51 --- VsDingExtension/Connect.cs | 65 --- VsDingExtension/VsDingExtension.AddIn | Bin 42266 -> 0 bytes VsDingExtension/VsDingExtension.csproj | 139 ------ VsDingExtension/VsDingExtension.xml | 43 -- .../GlobalSuppressions.cs | 0 VsDingExtensionProject/Guids.cs | 14 + VsDingExtensionProject/Key.snk | Bin 0 -> 596 bytes .../Properties/AssemblyInfo.cs | 8 +- .../Resources.Designer.cs | 21 +- .../Resources.resx | 6 - .../Resources/Package.ico | Bin .../VSPackage.resx | 7 +- .../VsDingExtensionProject.csproj | 40 +- .../VsDingExtensionProjectPackage.cs | 86 ++++ .../source.extension.vsixmanifest | 6 +- 47 files changed, 126 insertions(+), 2877 deletions(-) delete mode 100644 VSPackageInstall/Guids.cs delete mode 100644 VSPackageInstall/Key.snk delete mode 100644 VSPackageInstall/MyControl.xaml delete mode 100644 VSPackageInstall/MyControl.xaml.cs delete mode 100644 VSPackageInstall/MyToolWindow.cs delete mode 100644 VSPackageInstall/PkgCmdID.cs delete mode 100644 VSPackageInstall/Resources/Images.png delete mode 100644 VSPackageInstall/VSPackageInstall.vsct delete mode 100644 VSPackageInstall/VSPackageInstallPackage.cs delete mode 100644 VSPackageInstall/VSPackageInstall_IntegrationTests/IntegrationTest Library/DialogboxPurger.cs delete mode 100644 VSPackageInstall/VSPackageInstall_IntegrationTests/IntegrationTest Library/NativeMethods.cs delete mode 100644 VSPackageInstall/VSPackageInstall_IntegrationTests/IntegrationTest Library/Utils.cs delete mode 100644 VSPackageInstall/VSPackageInstall_IntegrationTests/Key.snk delete mode 100644 VSPackageInstall/VSPackageInstall_IntegrationTests/MenuItemTest.cs delete mode 100644 VSPackageInstall/VSPackageInstall_IntegrationTests/PackageTest.cs delete mode 100644 VSPackageInstall/VSPackageInstall_IntegrationTests/SignOff-Tests/CPPProjectTests.cs delete mode 100644 VSPackageInstall/VSPackageInstall_IntegrationTests/SignOff-Tests/CSharpProjectTests.cs delete mode 100644 VSPackageInstall/VSPackageInstall_IntegrationTests/SignOff-Tests/SolutionTests.cs delete mode 100644 VSPackageInstall/VSPackageInstall_IntegrationTests/SignOff-Tests/VBProjectTests.cs delete mode 100644 VSPackageInstall/VSPackageInstall_IntegrationTests/ToolWindowTest.cs delete mode 100644 VSPackageInstall/VSPackageInstall_IntegrationTests/VSPackageInstall_IntegrationTests.csproj delete mode 100644 VSPackageInstall/VSPackageInstall_UnitTests/Key.snk delete mode 100644 VSPackageInstall/VSPackageInstall_UnitTests/MenuItemTests/MenuItemCallback.cs delete mode 100644 VSPackageInstall/VSPackageInstall_UnitTests/MenuItemTests/UIShellServiceMock.cs delete mode 100644 VSPackageInstall/VSPackageInstall_UnitTests/MyToolWindowTest/MyToolWindow.cs delete mode 100644 VSPackageInstall/VSPackageInstall_UnitTests/MyToolWindowTest/ShowToolWindow.cs delete mode 100644 VSPackageInstall/VSPackageInstall_UnitTests/MyToolWindowTest/UIShellServiceMock.cs delete mode 100644 VSPackageInstall/VSPackageInstall_UnitTests/MyToolWindowTest/WindowFrameMock.cs delete mode 100644 VSPackageInstall/VSPackageInstall_UnitTests/PackageTest.cs delete mode 100644 VSPackageInstall/VSPackageInstall_UnitTests/VSPackageInstall_UnitTests.csproj delete mode 100644 VsDingExtension/AssemblyInfo.cs delete mode 100644 VsDingExtension/Connect.cs delete mode 100644 VsDingExtension/VsDingExtension.AddIn delete mode 100644 VsDingExtension/VsDingExtension.csproj delete mode 100644 VsDingExtension/VsDingExtension.xml rename {VSPackageInstall => VsDingExtensionProject}/GlobalSuppressions.cs (100%) create mode 100644 VsDingExtensionProject/Guids.cs create mode 100644 VsDingExtensionProject/Key.snk rename {VSPackageInstall => VsDingExtensionProject}/Properties/AssemblyInfo.cs (53%) rename {VSPackageInstall => VsDingExtensionProject}/Resources.Designer.cs (79%) rename {VSPackageInstall => VsDingExtensionProject}/Resources.resx (96%) rename {VSPackageInstall => VsDingExtensionProject}/Resources/Package.ico (100%) rename {VSPackageInstall => VsDingExtensionProject}/VSPackage.resx (95%) rename VSPackageInstall/VSPackageInstall.csproj => VsDingExtensionProject/VsDingExtensionProject.csproj (86%) create mode 100644 VsDingExtensionProject/VsDingExtensionProjectPackage.cs rename {VSPackageInstall => VsDingExtensionProject}/source.extension.vsixmanifest (83%) diff --git a/VSPackageInstall/Guids.cs b/VSPackageInstall/Guids.cs deleted file mode 100644 index 5d457be..0000000 --- a/VSPackageInstall/Guids.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Guids.cs -// MUST match guids.h -using System; - -namespace VitaliiGanzha.VSPackageInstall -{ - static class GuidList - { - public const string guidVSPackageInstallPkgString = "a527a9c1-ec2f-46a0-a6e3-371859c5845b"; - public const string guidVSPackageInstallCmdSetString = "4fddc919-41be-47b6-ae59-7125c75d1f1e"; - public const string guidToolWindowPersistanceString = "a6862923-42ae-438f-ac76-7a68be1011e3"; - - public static readonly Guid guidVSPackageInstallCmdSet = new Guid(guidVSPackageInstallCmdSetString); - }; -} \ No newline at end of file diff --git a/VSPackageInstall/Key.snk b/VSPackageInstall/Key.snk deleted file mode 100644 index 6a24fe5f0d37f6d08dea86afe7d0a6450396455c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50096?%fn1!tK`Saw++$=>$H`QUk{`WNwv#& zMG;3g=ia)Gk|*OUu)uG+h>1bu|Png#*EnlA)N|TUoFWqVR-u@X1*I-b1 z#EN(VBF!_iWmOW_AM4+X{P$JNxdVHXX_K7TTg(d{@hLdH8)yRgC{AU4*VBeoQVF$v zKw`(|YskodA^-|`@4;Y2xo-8%r$Q87VAs~Kxw&b0R>?D6v+cMiVhS{mR5)FQY>%ke zi7%%Op){xLjoG2m2rhLVNk zvU$&s3HU4uc(2<)m%WAvZAx}I!y)p`B!0&zztTST5% zEAD@@FL@2jq7)k>1u_L+fLPjaG1wP^H8%Dg4m*78$%y| zROfqYPhvm`8wVr}CPa6t2W2>?`=GWo0^LkMBri2G12b8;qH{jek|WBCiq9T@kw{Th zk$ik?KkWq06L2a?hc+6G$s5g&2jeXC#pa@vV|ZT=eZSU=I*LwM`#o^VU&XP(NxGQf i$LKzvL-H(?PQS5GJqM>t@3&ukpyXc{&7|Qf>KL$*KNN=m diff --git a/VSPackageInstall/MyControl.xaml b/VSPackageInstall/MyControl.xaml deleted file mode 100644 index 5761443..0000000 --- a/VSPackageInstall/MyControl.xaml +++ /dev/null @@ -1,17 +0,0 @@ - - - - VS Ding - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VSPackageInstall/VSPackageInstallPackage.cs b/VSPackageInstall/VSPackageInstallPackage.cs deleted file mode 100644 index 156ffa7..0000000 --- a/VSPackageInstall/VSPackageInstallPackage.cs +++ /dev/null @@ -1,147 +0,0 @@ -using System; -using System.Diagnostics; -using System.Globalization; -using System.IO; -using System.Runtime.InteropServices; -using System.ComponentModel.Design; -using EnvDTE; -using EnvDTE80; -using Microsoft.Win32; -using Microsoft.VisualStudio; -using Microsoft.VisualStudio.Shell.Interop; -using Microsoft.VisualStudio.OLE.Interop; -using Microsoft.VisualStudio.Shell; - -namespace VitaliiGanzha.VSPackageInstall -{ - /// - /// This is the class that implements the package exposed by this assembly. - /// - /// The minimum requirement for a class to be considered a valid package for Visual Studio - /// is to implement the IVsPackage interface and register itself with the shell. - /// This package uses the helper classes defined inside the Managed Package Framework (MPF) - /// to do it: it derives from the Package class that provides the implementation of the - /// IVsPackage interface and uses the registration attributes defined in the framework to - /// register itself and its components with the shell. - /// - // This attribute tells the PkgDef creation utility (CreatePkgDef.exe) that this class is - // a package. - [PackageRegistration(UseManagedResourcesOnly = true)] - // This attribute is used to register the information needed to show this package - // in the Help/About dialog of Visual Studio. - [InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)] - // This attribute is needed to let the shell know that this package exposes some menus. - [ProvideMenuResource("Menus.ctmenu", 1)] - // This attribute registers a tool window exposed by this package. - [ProvideToolWindow(typeof(MyToolWindow))] - [Guid(GuidList.guidVSPackageInstallPkgString)] - public sealed class VSPackageInstallPackage : Package - { - private DTE2 applicationObject; - private AddIn addInInstance; - - /// - /// Default constructor of the package. - /// 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. - /// - public VSPackageInstallPackage() - { - Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering constructor for: {0}", this.ToString())); - } - - /// - /// This function is called when the user clicks the menu item that shows the - /// tool window. See the Initialize method to see how the menu item is associated to - /// this function using the OleMenuCommandService service and the MenuCommand class. - /// - private void ShowToolWindow(object sender, EventArgs e) - { - // 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.FindToolWindow(typeof(MyToolWindow), 0, true); - if ((null == window) || (null == window.Frame)) - { - throw new NotSupportedException(Resources.CanNotCreateWindow); - } - IVsWindowFrame windowFrame = (IVsWindowFrame)window.Frame; - Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(windowFrame.Show()); - } - - - ///////////////////////////////////////////////////////////////////////////// - // Overridden Package Implementation - #region Package Members - - /// - /// Initialization of the package; this method is called right after the package is sited, so this is the place - /// where you can put all the initialization code that rely on services provided by VisualStudio. - /// - protected override void Initialize() - { - try - { - Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString())); - base.Initialize(); - - // Add our command handlers for menu (commands must exist in the .vsct file) - OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService; - if (null != mcs) - { - // Create the command for the menu item. - CommandID menuCommandID = new CommandID(GuidList.guidVSPackageInstallCmdSet, (int)PkgCmdIDList.cmdidVsDing); - MenuCommand menuItem = new MenuCommand(MenuItemCallback, menuCommandID); - mcs.AddCommand(menuItem); - // Create the command for the tool window - CommandID toolwndCommandID = new CommandID(GuidList.guidVSPackageInstallCmdSet, (int)PkgCmdIDList.cmdidVsDingWnd); - MenuCommand menuToolWin = new MenuCommand(ShowToolWindow, toolwndCommandID); - mcs.AddCommand(menuToolWin); - } - - applicationObject = (DTE2)GetService(typeof(DTE)); - applicationObject.Events.BuildEvents.OnBuildDone += BuildEventsOnOnBuildDone; - } - catch (Exception e) - { - File.WriteAllText(@"c:\temp\test.txt", e.Message); - } - - } - - private void BuildEventsOnOnBuildDone(vsBuildScope scope, vsBuildAction action) - { - System.Media.SystemSounds.Asterisk.Play(); - } - - #endregion - - /// - /// This function is the callback used to execute a command when the a menu item is clicked. - /// See the Initialize method to see how the menu item is associated to this function using - /// the OleMenuCommandService service and the MenuCommand class. - /// - private void MenuItemCallback(object sender, EventArgs e) - { - // Show a Message Box to prove we were here - IVsUIShell uiShell = (IVsUIShell)GetService(typeof(SVsUIShell)); - Guid clsid = Guid.Empty; - int result; - Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(uiShell.ShowMessageBox( - 0, - ref clsid, - "VSPackageInstall", - string.Format(CultureInfo.CurrentCulture, "Inside {0}.MenuItemCallback()", this.ToString()), - string.Empty, - 0, - OLEMSGBUTTON.OLEMSGBUTTON_OK, - OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST, - OLEMSGICON.OLEMSGICON_INFO, - 0, // false - out result)); - } - - } -} diff --git a/VSPackageInstall/VSPackageInstall_IntegrationTests/IntegrationTest Library/DialogboxPurger.cs b/VSPackageInstall/VSPackageInstall_IntegrationTests/IntegrationTest Library/DialogboxPurger.cs deleted file mode 100644 index 9061a9f..0000000 --- a/VSPackageInstall/VSPackageInstall_IntegrationTests/IntegrationTest Library/DialogboxPurger.cs +++ /dev/null @@ -1,359 +0,0 @@ - -namespace Microsoft.VsSDK.IntegrationTestLibrary -{ - using System; - using System.Collections.Generic; - using System.Text; - using System.Runtime.InteropServices; - using System.Threading; - using Microsoft.VisualStudio.Shell.Interop; - using Microsoft.VisualStudio.Shell; - - /// - /// This class is responsible to close dialog boxes that pop up during different VS Calls - /// - internal class DialogBoxPurger : IDisposable - { - /// - /// The default number of milliseconds to wait for the threads to signal to terminate. - /// - private const int DefaultMillisecondsToWait = 3500; - - /// - /// Object used for synchronization between thread calls. - /// - internal static volatile object Mutex = new object(); - - /// - /// The IVsUIShell. This cannot be queried on the working thread from the service provider. Must be done in the main thread.!! - /// - private IVsUIShell uiShell; - - /// - /// The button to "press" on the dialog. - /// - private int buttonAction; - - /// - /// Thread signales to the calling thread that it is done. - /// - private bool exitThread = false; - - /// - /// Calling thread signales to this thread to die. - /// - private AutoResetEvent threadDone = new AutoResetEvent(false); - - /// - /// The queued thread started. - /// - private AutoResetEvent threadStarted = new AutoResetEvent(false); - - /// - /// The result of the dialogbox closing for all the dialog boxes. That is if there are two of them and one fails this will be false. - /// - private bool dialogBoxCloseResult = false; - - /// - /// The expected text to see on the dialog box. If set the thread will continue finding the dialog box with this text. - /// - private string expectedDialogBoxText = String.Empty; - - /// - /// The number of the same dialog boxes to wait for. - /// This is for scenarios when two dialog boxes with the same text are popping up. - /// - private int numberOfDialogsToWaitFor = 1; - - /// - /// Has the object been disposed. - /// - private bool isDisposed; - - /// - /// Overloaded ctor. - /// - /// The botton to "press" on the dialog box. - /// The number of dialog boxes with the same message to wait for. This is the situation when the same action pops up two of the same dialog boxes - /// The expected dialog box message to check for. - internal DialogBoxPurger(int buttonAction, int numberOfDialogsToWaitFor, string expectedDialogMesssage) - { - this.buttonAction = buttonAction; - this.numberOfDialogsToWaitFor = numberOfDialogsToWaitFor; - this.expectedDialogBoxText = expectedDialogMesssage; - } - - /// - /// Overloaded ctor. - /// - /// The botton to "press" on the dialog box. - /// The number of dialog boxes with the same message to wait for. This is the situation when the same action pops up two of the same dialog boxes - internal DialogBoxPurger(int buttonAction, int numberOfDialogsToWaitFor) - { - this.buttonAction = buttonAction; - this.numberOfDialogsToWaitFor = numberOfDialogsToWaitFor; - } - - /// - /// Overloaded ctor. - /// - /// The botton to "press" on the dialog box. - /// The expected dialog box message to check for. - internal DialogBoxPurger(int buttonAction, string expectedDialogMesssage) - { - this.buttonAction = buttonAction; - this.expectedDialogBoxText = expectedDialogMesssage; - } - - /// - /// Overloaded ctor. - /// - /// The botton to "press" on the dialog box. - internal DialogBoxPurger(int buttonAction) - { - this.buttonAction = buttonAction; - } - - /// - #region IDisposable Members - - void IDisposable.Dispose() - { - if (this.isDisposed) - { - return; - } - - this.WaitForDialogThreadToTerminate(); - - this.isDisposed = true; - } - - /// - /// Spawns a thread that will start listening to dialog boxes. - /// - internal void Start() - { - // We ask for the uishell here since we cannot do that on the therad that we will spawn. - IVsUIShell uiShell = Package.GetGlobalService(typeof(SVsUIShell)) as IVsUIShell; - - if (uiShell == null) - { - throw new InvalidOperationException("Could not get the uiShell from the serviceProvider"); - } - - this.uiShell = uiShell; - - System.Threading.Thread thread = new System.Threading.Thread(new ThreadStart(this.HandleDialogBoxes)); - thread.Start(); - - // We should never deadlock here, hence do not use the lock. Wait to be sure that the thread started. - this.threadStarted.WaitOne(3500, false); - } - - /// - /// Waits for the dialog box close thread to terminate. If the thread does not signal back within millisecondsToWait that it is shutting down, - /// then it will tell to the thread to do it. - /// - internal bool WaitForDialogThreadToTerminate() - { - return this.WaitForDialogThreadToTerminate(DefaultMillisecondsToWait); - } - - /// - /// Waits for the dialog box close thread to terminate. If the thread does not signal back within millisecondsToWait that it is shutting down, - /// then it will tell to the thread to do it. - /// - /// The number milliseconds to wait for until the dialog purger thread is signaled to terminate. This is just for safe precaution that we do not hang. - /// The result of the dialog boxes closing - internal bool WaitForDialogThreadToTerminate(int numberOfMillisecondsToWait) - { - bool signaled = false; - - // We give millisecondsToWait sec to bring up and close the dialog box. - signaled = this.threadDone.WaitOne(numberOfMillisecondsToWait, false); - - // Kill the thread since a timeout occured. - if (!signaled) - { - lock (Mutex) - { - // Set the exit thread to true. Next time the thread will kill itselfes if it sees - this.exitThread = true; - } - - // Wait for the thread to finish. We should never deadlock here. - this.threadDone.WaitOne(); - } - - return this.dialogBoxCloseResult; - } - - /// - /// This is the thread method. - /// - private void HandleDialogBoxes() - { - // No synchronization numberOfDialogsToWaitFor since it is readonly - IntPtr[] hwnds = new IntPtr[this.numberOfDialogsToWaitFor]; - bool[] dialogBoxCloseResults = new bool[this.numberOfDialogsToWaitFor]; - - try - { - // Signal that we started - lock (Mutex) - { - this.threadStarted.Set(); - } - - // The loop will be exited either if a message is send by the caller thread or if we found the dialog. If a message box text is specified the loop will not exit until the dialog is found. - bool stayInLoop = true; - int dialogBoxesToWaitFor = 1; - - while (stayInLoop) - { - int hwndIndex = dialogBoxesToWaitFor - 1; - - // We need to lock since the caller might set context to null. - lock (Mutex) - { - if (this.exitThread) - { - break; - } - - // We protect the shell too from reentrency. - this.uiShell.GetDialogOwnerHwnd(out hwnds[hwndIndex]); - - } - - if (hwnds[hwndIndex] != IntPtr.Zero) - { - StringBuilder windowClassName = new StringBuilder(256); - NativeMethods.GetClassName(hwnds[hwndIndex], windowClassName, windowClassName.Capacity); - - // The #32770 is the class name of a messagebox dialog. - if (windowClassName.ToString().Contains("#32770")) - { - IntPtr unmanagedMemoryLocation = IntPtr.Zero; - string dialogBoxText = String.Empty; - try - { - unmanagedMemoryLocation = Marshal.AllocHGlobal(10 * 1024); - NativeMethods.EnumChildWindows(hwnds[hwndIndex], new NativeMethods.CallBack(FindMessageBoxString), unmanagedMemoryLocation); - dialogBoxText = Marshal.PtrToStringUni(unmanagedMemoryLocation); - } - finally - { - if (unmanagedMemoryLocation != IntPtr.Zero) - { - Marshal.FreeHGlobal(unmanagedMemoryLocation); - } - } - - lock (Mutex) - { - - // Since this is running on the main thread be sure that we close the dialog. - bool dialogCloseResult = false; - if (this.buttonAction != 0) - { - dialogCloseResult = NativeMethods.EndDialog(hwnds[hwndIndex], this.buttonAction); - } - - // Check if we have found the right dialog box. - if (String.IsNullOrEmpty(this.expectedDialogBoxText) || (!String.IsNullOrEmpty(dialogBoxText) && String.Compare(this.expectedDialogBoxText, dialogBoxText.Trim(), StringComparison.OrdinalIgnoreCase) == 0)) - { - dialogBoxCloseResults[hwndIndex] = dialogCloseResult; - if (dialogBoxesToWaitFor++ >= this.numberOfDialogsToWaitFor) - { - stayInLoop = false; - } - } - } - } - } - } - } - finally - { - //Let the main thread run a possible close command. - System.Threading.Thread.Sleep(2000); - - foreach (IntPtr hwnd in hwnds) - { - // At this point the dialog should be closed, if not attempt to close it. - if (hwnd != IntPtr.Zero) - { - NativeMethods.SendMessage(hwnd, NativeMethods.WM_CLOSE, 0, new IntPtr(0)); - } - } - - lock (Mutex) - { - // Be optimistic. - this.dialogBoxCloseResult = true; - - for (int i = 0; i < dialogBoxCloseResults.Length; i++) - { - if (!dialogBoxCloseResults[i]) - { - this.dialogBoxCloseResult = false; - break; - } - } - - this.threadDone.Set(); - } - } - } - - /// - /// Finds a messagebox string on a messagebox. - /// - /// The windows handle of the dialog - /// A pointer to the memorylocation the string will be written to - /// True if found. - private static bool FindMessageBoxString(IntPtr hwnd, IntPtr unmanagedMemoryLocation) - { - StringBuilder sb = new StringBuilder(512); - NativeMethods.GetClassName(hwnd, sb, sb.Capacity); - - if (sb.ToString().ToLower().Contains("static")) - { - StringBuilder windowText = new StringBuilder(2048); - NativeMethods.GetWindowText(hwnd, windowText, windowText.Capacity); - - if (windowText.Length > 0) - { - IntPtr stringAsPtr = IntPtr.Zero; - try - { - stringAsPtr = Marshal.StringToHGlobalAnsi(windowText.ToString()); - char[] stringAsArray = windowText.ToString().ToCharArray(); - - // Since unicode characters are copied check if we are out of the allocated length. - // If not add the end terminating zero. - if ((2 * stringAsArray.Length) + 1 < 2048) - { - Marshal.Copy(stringAsArray, 0, unmanagedMemoryLocation, stringAsArray.Length); - Marshal.WriteInt32(unmanagedMemoryLocation, 2 * stringAsArray.Length, 0); - } - } - finally - { - if (stringAsPtr != IntPtr.Zero) - { - Marshal.FreeHGlobal(stringAsPtr); - } - } - return false; - } - } - - return true; - } - - #endregion - } -} diff --git a/VSPackageInstall/VSPackageInstall_IntegrationTests/IntegrationTest Library/NativeMethods.cs b/VSPackageInstall/VSPackageInstall_IntegrationTests/IntegrationTest Library/NativeMethods.cs deleted file mode 100644 index 8007567..0000000 --- a/VSPackageInstall/VSPackageInstall_IntegrationTests/IntegrationTest Library/NativeMethods.cs +++ /dev/null @@ -1,154 +0,0 @@ -/*************************************************************************** - -Copyright (c) Microsoft Corporation. All rights reserved. -This code is licensed under the Visual Studio SDK license terms. -THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. - -***************************************************************************/ - -namespace Microsoft.VsSDK.IntegrationTestLibrary -{ - using System; - using System.Collections.Generic; - using System.Text; - using System.Runtime.InteropServices; - using System.Threading; - using Microsoft.VisualStudio.Shell.Interop; - - /// - /// Defines pinvoked utility methods and internal VS Constants - /// - internal static class NativeMethods - { - internal delegate bool CallBack(IntPtr hwnd, IntPtr lParam); - - // Declare two overloaded SendMessage functions - [DllImport("user32.dll")] - internal static extern UInt32 SendMessage(IntPtr hWnd, UInt32 Msg, - UInt32 wParam, IntPtr lParam); - - [DllImport("user32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto)] - internal static extern bool PeekMessage([In, Out] ref Microsoft.VisualStudio.OLE.Interop.MSG msg, HandleRef hwnd, int msgMin, int msgMax, int remove); - - [DllImport("user32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto)] - internal static extern bool TranslateMessage([In, Out] ref Microsoft.VisualStudio.OLE.Interop.MSG msg); - - [DllImport("user32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto)] - internal static extern int DispatchMessage([In] ref Microsoft.VisualStudio.OLE.Interop.MSG msg); - - [DllImport("user32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto)] - internal static extern bool AttachThreadInput(uint idAttach, uint idAttachTo, bool attach); - - [DllImport("user32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto)] - internal static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId); - - [DllImport("kernel32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto)] - internal static extern uint GetCurrentThreadId(); - - [DllImport("user32")] - internal static extern int EnumChildWindows(IntPtr hwnd, CallBack x, IntPtr y); - - [DllImport("user32")] - internal static extern bool IsWindowVisible(IntPtr hDlg); - - [DllImport("user32.dll", CharSet = System.Runtime.InteropServices.CharSet.Auto)] - internal static extern IntPtr SetFocus(IntPtr hWnd); - - [DllImport("user32")] - internal static extern int GetClassName(IntPtr hWnd, - StringBuilder className, - int stringLength); - [DllImport("user32")] - internal static extern int GetWindowText(IntPtr hWnd, StringBuilder className, int stringLength); - - - [DllImport("user32")] - internal static extern bool EndDialog(IntPtr hDlg, int result); - - [DllImport("Kernel32")] - internal static extern long GetLastError(); - - internal const int QS_KEY = 0x0001, - QS_MOUSEMOVE = 0x0002, - QS_MOUSEBUTTON = 0x0004, - QS_POSTMESSAGE = 0x0008, - QS_TIMER = 0x0010, - QS_PAINT = 0x0020, - QS_SENDMESSAGE = 0x0040, - QS_HOTKEY = 0x0080, - QS_ALLPOSTMESSAGE = 0x0100, - QS_MOUSE = QS_MOUSEMOVE | QS_MOUSEBUTTON, - QS_INPUT = QS_MOUSE | QS_KEY, - QS_ALLEVENTS = QS_INPUT | QS_POSTMESSAGE | QS_TIMER | QS_PAINT | QS_HOTKEY, - QS_ALLINPUT = QS_INPUT | QS_POSTMESSAGE | QS_TIMER | QS_PAINT | QS_HOTKEY | QS_SENDMESSAGE; - - internal const int Facility_Win32 = 7; - - internal const int WM_CLOSE = 0x0010; - - internal const int - S_FALSE = 0x00000001, - S_OK = 0x00000000, - - IDOK = 1, - IDCANCEL = 2, - IDABORT = 3, - IDRETRY = 4, - IDIGNORE = 5, - IDYES = 6, - IDNO = 7, - IDCLOSE = 8, - IDHELP = 9, - IDTRYAGAIN = 10, - IDCONTINUE = 11; - - internal static long HResultFromWin32(long error) - { - if (error <= 0) - { - return error; - } - - return ((error & 0x0000FFFF) | (Facility_Win32 << 16) | 0x80000000); - } - - /// - /// Please use this "approved" method to compare file names. - /// - public static bool IsSamePath(string file1, string file2) - { - if (file1 == null || file1.Length == 0) - { - return (file2 == null || file2.Length == 0); - } - - Uri uri1 = null; - Uri uri2 = null; - - try - { - if (!Uri.TryCreate(file1, UriKind.Absolute, out uri1) || !Uri.TryCreate(file2, UriKind.Absolute, out uri2)) - { - return false; - } - - if (uri1 != null && uri1.IsFile && uri2 != null && uri2.IsFile) - { - return 0 == String.Compare(uri1.LocalPath, uri2.LocalPath, StringComparison.OrdinalIgnoreCase); - } - - return file1 == file2; - } - catch (UriFormatException e) - { - System.Diagnostics.Trace.WriteLine("Exception " + e.Message); - } - - return false; - } - - } -} diff --git a/VSPackageInstall/VSPackageInstall_IntegrationTests/IntegrationTest Library/Utils.cs b/VSPackageInstall/VSPackageInstall_IntegrationTests/IntegrationTest Library/Utils.cs deleted file mode 100644 index 1fa9deb..0000000 --- a/VSPackageInstall/VSPackageInstall_IntegrationTests/IntegrationTest Library/Utils.cs +++ /dev/null @@ -1,401 +0,0 @@ -using System; -using System.IO; -using System.Text; -using System.Reflection; -using System.Diagnostics; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel.Design; -using System.Runtime.InteropServices; -using Microsoft.VisualStudio.Shell.Interop; -using Microsoft.VisualStudio.Shell; -using EnvDTE; -using EnvDTE80; -using Microsoft.Win32; -using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using Microsoft.VisualStudio; - -namespace Microsoft.VsSDK.IntegrationTestLibrary -{ - /// - /// - public class TestUtils - { - - #region Methods: Handling embedded resources - /// - /// Gets the embedded file identified by the resource name, and converts the - /// file into a string. - /// - /// In VS, is DefaultNamespace.FileName? - /// - public static string GetEmbeddedStringResource(Assembly assembly, string resourceName) - { - string result = null; - - // Use the .NET procedure for loading a file embedded in the assembly - Stream stream = assembly.GetManifestResourceStream(resourceName); - if (stream != null) - { - // Convert bytes to string - byte[] fileContentsAsBytes = new byte[stream.Length]; - stream.Read(fileContentsAsBytes, 0, (int)stream.Length); - result = Encoding.Default.GetString(fileContentsAsBytes); - } - else - { - // Embedded resource not found - list available resources - Debug.WriteLine("Unable to find the embedded resource file '" + resourceName + "'."); - Debug.WriteLine(" Available resources:"); - foreach (string aResourceName in assembly.GetManifestResourceNames()) - { - Debug.WriteLine(" " + aResourceName); - } - } - - return result; - } - /// - /// - /// - /// - /// - /// - /// - public static void WriteEmbeddedResourceToFile(Assembly assembly, string embeddedResourceName, string fileName) - { - // Get file contents - string fileContents = GetEmbeddedStringResource(assembly, embeddedResourceName); - if (fileContents == null) - throw new ApplicationException("Failed to get embedded resource '" + embeddedResourceName + "' from assembly '" + assembly.FullName); - - // Write to file - StreamWriter sw = new StreamWriter(fileName); - sw.Write(fileContents); - sw.Close(); - } - - /// - /// Writes an embedded resource to a file. - /// - /// The name of the assembly that the embedded resource is defined. - /// The name of the embedded resource. - /// The file to write the embedded resource's content. - public static void WriteEmbeddedResourceToBinaryFile(Assembly assembly, string embeddedResourceName, string fileName) - { - // Get file contents - Stream stream = assembly.GetManifestResourceStream(embeddedResourceName); - if (stream == null) - throw new InvalidOperationException("Failed to get embedded resource '" + embeddedResourceName + "' from assembly '" + assembly.FullName); - - // Write to file - BinaryWriter sw = null; - FileStream fs = null; - try - { - byte[] fileContentsAsBytes = new byte[stream.Length]; - stream.Read(fileContentsAsBytes, 0, (int)stream.Length); - - FileMode mode = FileMode.CreateNew; - if (File.Exists(fileName)) - { - mode = FileMode.Truncate; - } - - fs = new FileStream(fileName, mode); - - sw = new BinaryWriter(fs); - sw.Write(fileContentsAsBytes); - } - finally - { - if (fs != null) - { - fs.Close(); - } - if (sw != null) - { - sw.Close(); - } - } - } - - #endregion - - #region Methods: Handling temporary files and directories - /// - /// Returns the first available file name on the form - /// [baseFileName]i.[extension] - /// where [i] starts at 1 and increases until there is an available file name - /// in the given directory. Also creates an empty file with that name to mark - /// that file as occupied. - /// - /// Directory that the file should live in. - /// - /// may be null, in which case the .[extension] part - /// is not added. - /// Full file name. - public static string GetNewFileName(string directory, string baseFileName, string extension) - { - // Get the new file name - string fileName = GetNewFileOrDirectoryNameWithoutCreatingAnything(directory, baseFileName, extension); - - // Create an empty file to mark it as taken - StreamWriter sw = new StreamWriter(fileName); - - sw.Write(""); - sw.Close(); - return fileName; - } - /// - /// Returns the first available directory name on the form - /// [baseDirectoryName]i - /// where [i] starts at 1 and increases until there is an available directory name - /// in the given directory. Also creates the directory to mark it as occupied. - /// - /// Directory that the file should live in. - /// - /// Full directory name. - public static string GetNewDirectoryName(string directory, string baseDirectoryName) - { - // Get the new file name - string directoryName = GetNewFileOrDirectoryNameWithoutCreatingAnything(directory, baseDirectoryName, null); - - // Create an empty directory to make it as occupied - Directory.CreateDirectory(directoryName); - - return directoryName; - } - - /// - /// - /// - /// - /// - /// - /// - private static string GetNewFileOrDirectoryNameWithoutCreatingAnything(string directory, string baseFileName, string extension) - { - // - get a file name that we can use - string fileName; - int i = 1; - - string fullFileName = null; - while (true) - { - // construct next file name - fileName = baseFileName + i; - if (extension != null) - fileName += '.' + extension; - - // check if that file exists in the directory - fullFileName = Path.Combine(directory, fileName); - - if (!File.Exists(fullFileName) && !Directory.Exists(fullFileName)) - break; - else - i++; - } - - return fullFileName; - } - #endregion - - #region Methods: Handling solutions - /// - /// Closes the currently open solution (if any), and creates a new solution with the given name. - /// - /// Name of new solution. - public void CreateEmptySolution(string directory, string solutionName) - { - CloseCurrentSolution(__VSSLNSAVEOPTIONS.SLNSAVEOPT_NoSave); - - string solutionDirectory = GetNewDirectoryName(directory, solutionName); - - // Create and force save solution - IVsSolution solutionService = (IVsSolution)VsIdeTestHostContext.ServiceProvider.GetService(typeof(IVsSolution)); - solutionService.CreateSolution(solutionDirectory, solutionName, (uint)__VSCREATESOLUTIONFLAGS.CSF_SILENT); - solutionService.SaveSolutionElement((uint)__VSSLNSAVEOPTIONS.SLNSAVEOPT_ForceSave, null, 0); - DTE dte = VsIdeTestHostContext.Dte; - Assert.AreEqual(solutionName + ".sln", Path.GetFileName(dte.Solution.FileName), "Newly created solution has wrong Filename"); - } - - public void CloseCurrentSolution(__VSSLNSAVEOPTIONS saveoptions) - { - // Get solution service - IVsSolution solutionService = (IVsSolution)VsIdeTestHostContext.ServiceProvider.GetService(typeof(IVsSolution)); - - // Close already open solution - solutionService.CloseSolutionElement((uint)saveoptions, null, 0); - } - - public void ForceSaveSolution() - { - // Get solution service - IVsSolution solutionService = (IVsSolution)VsIdeTestHostContext.ServiceProvider.GetService(typeof(IVsSolution)); - - // Force-save the solution - solutionService.SaveSolutionElement((uint)__VSSLNSAVEOPTIONS.SLNSAVEOPT_ForceSave, null, 0); - } - - /// - /// Get current number of open project in solution - /// - /// - public int ProjectCount() - { - // Get solution service - IVsSolution solutionService = (IVsSolution)VsIdeTestHostContext.ServiceProvider.GetService(typeof(IVsSolution)); - object projectCount; - solutionService.GetProperty((int)__VSPROPID.VSPROPID_ProjectCount, out projectCount); - return (int)projectCount; - } - #endregion - - #region Methods: Handling projects - /// - /// Creates a project. - /// - /// Name of new project. - /// Name of project template to use - /// language - /// New project. - public void CreateProjectFromTemplate(string projectName, string templateName, string language, bool exclusive) - { - DTE dte = (DTE)VsIdeTestHostContext.ServiceProvider.GetService(typeof(DTE)); - - Solution2 sol = dte.Solution as Solution2; - string projectTemplate = sol.GetProjectTemplate(templateName, language); - - // - project name and directory - string solutionDirectory = Directory.GetParent(dte.Solution.FullName).FullName; - string projectDirectory = GetNewDirectoryName(solutionDirectory, projectName); - - dte.Solution.AddFromTemplate(projectTemplate, projectDirectory, projectName, false); - } - #endregion - - #region Methods: Handling project items - /// - /// Create a new item in the project - /// - /// the parent collection for the new item - /// - /// - /// - /// - public ProjectItem AddNewItemFromVsTemplate(ProjectItems parent, string templateName, string language, string name) - { - if (parent == null) - throw new ArgumentException("project"); - if (name == null) - throw new ArgumentException("name"); - - DTE dte = (DTE)VsIdeTestHostContext.ServiceProvider.GetService(typeof(DTE)); - - Solution2 sol = dte.Solution as Solution2; - - string filename = sol.GetProjectItemTemplate(templateName, language); - - parent.AddFromTemplate(filename, name); - - return parent.Item(name); - } - - /// - /// Save an open document. - /// - /// for filebased documents this is the full path to the document - public void SaveDocument(string documentMoniker) - { - // Get document cookie and hierarchy for the file - IVsRunningDocumentTable runningDocumentTableService = (IVsRunningDocumentTable)VsIdeTestHostContext.ServiceProvider.GetService(typeof(IVsRunningDocumentTable)); - uint docCookie; - IntPtr docData; - IVsHierarchy hierarchy; - uint itemId; - runningDocumentTableService.FindAndLockDocument( - (uint)Microsoft.VisualStudio.Shell.Interop._VSRDTFLAGS.RDT_NoLock, - documentMoniker, - out hierarchy, - out itemId, - out docData, - out docCookie); - - // Save the document - IVsSolution solutionService = (IVsSolution)VsIdeTestHostContext.ServiceProvider.GetService(typeof(IVsSolution)); - solutionService.SaveSolutionElement((uint)__VSSLNSAVEOPTIONS.SLNSAVEOPT_ForceSave, hierarchy, docCookie); - } - - public void CloseInEditorWithoutSaving(string fullFileName) - { - // Get the RDT service - IVsRunningDocumentTable runningDocumentTableService = (IVsRunningDocumentTable)VsIdeTestHostContext.ServiceProvider.GetService(typeof(IVsRunningDocumentTable)); - Assert.IsNotNull(runningDocumentTableService, "Failed to get the Running Document Table Service"); - - // Get our document cookie and hierarchy for the file - uint docCookie; - IntPtr docData; - IVsHierarchy hierarchy; - uint itemId; - runningDocumentTableService.FindAndLockDocument( - (uint)Microsoft.VisualStudio.Shell.Interop._VSRDTFLAGS.RDT_NoLock, - fullFileName, - out hierarchy, - out itemId, - out docData, - out docCookie); - - // Get the SolutionService - IVsSolution solutionService = VsIdeTestHostContext.ServiceProvider.GetService(typeof(IVsSolution)) as IVsSolution; - Assert.IsNotNull(solutionService, "Failed to get IVsSolution service"); - - // Close the document - solutionService.CloseSolutionElement( - (uint)__VSSLNSAVEOPTIONS.SLNSAVEOPT_NoSave, - hierarchy, - docCookie); - } - #endregion - - #region Methods: Handling Toolwindows - public bool CanFindToolwindow(Guid persistenceGuid) - { - IVsUIShell uiShellService = VsIdeTestHostContext.ServiceProvider.GetService(typeof(SVsUIShell)) as IVsUIShell; - Assert.IsNotNull(uiShellService); - IVsWindowFrame windowFrame; - int hr = uiShellService.FindToolWindow((uint)__VSFINDTOOLWIN.FTW_fFindFirst, ref persistenceGuid, out windowFrame); - Assert.IsTrue(hr == VSConstants.S_OK); - - return (windowFrame != null); - } - #endregion - - #region Methods: Loading packages - public IVsPackage LoadPackage(Guid packageGuid) - { - IVsShell shellService = (IVsShell)VsIdeTestHostContext.ServiceProvider.GetService(typeof(SVsShell)); - IVsPackage package; - shellService.LoadPackage(ref packageGuid, out package); - Assert.IsNotNull(package, "Failed to load package"); - return package; - } - #endregion - - /// - /// Executes a Command (menu item) in the given context - /// - public void ExecuteCommand(CommandID cmd) - { - object Customin = null; - object Customout = null; - string guidString = cmd.Guid.ToString("B").ToUpper(); - int cmdId = cmd.ID; - DTE dte = VsIdeTestHostContext.Dte; - dte.Commands.Raise(guidString, cmdId, ref Customin, ref Customout); - } - - } -} diff --git a/VSPackageInstall/VSPackageInstall_IntegrationTests/Key.snk b/VSPackageInstall/VSPackageInstall_IntegrationTests/Key.snk deleted file mode 100644 index 6a24fe5f0d37f6d08dea86afe7d0a6450396455c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50096?%fn1!tK`Saw++$=>$H`QUk{`WNwv#& zMG;3g=ia)Gk|*OUu)uG+h>1bu|Png#*EnlA)N|TUoFWqVR-u@X1*I-b1 z#EN(VBF!_iWmOW_AM4+X{P$JNxdVHXX_K7TTg(d{@hLdH8)yRgC{AU4*VBeoQVF$v zKw`(|YskodA^-|`@4;Y2xo-8%r$Q87VAs~Kxw&b0R>?D6v+cMiVhS{mR5)FQY>%ke zi7%%Op){xLjoG2m2rhLVNk zvU$&s3HU4uc(2<)m%WAvZAx}I!y)p`B!0&zztTST5% zEAD@@FL@2jq7)k>1u_L+fLPjaG1wP^H8%Dg4m*78$%y| zROfqYPhvm`8wVr}CPa6t2W2>?`=GWo0^LkMBri2G12b8;qH{jek|WBCiq9T@kw{Th zk$ik?KkWq06L2a?hc+6G$s5g&2jeXC#pa@vV|ZT=eZSU=I*LwM`#o^VU&XP(NxGQf i$LKzvL-H(?PQS5GJqM>t@3&ukpyXc{&7|Qf>KL$*KNN=m diff --git a/VSPackageInstall/VSPackageInstall_IntegrationTests/MenuItemTest.cs b/VSPackageInstall/VSPackageInstall_IntegrationTests/MenuItemTest.cs deleted file mode 100644 index 8d22566..0000000 --- a/VSPackageInstall/VSPackageInstall_IntegrationTests/MenuItemTest.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; -using System.Globalization; -using System.ComponentModel.Design; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VisualStudio.OLE.Interop; -using Microsoft.VisualStudio.Shell.Interop; -using Microsoft.VisualStudio.Shell; -using Microsoft.VsSDK.IntegrationTestLibrary; -using Microsoft.VSSDK.Tools.VsIdeTesting; - -namespace VSPackageInstall_IntegrationTests -{ - [TestClass()] - public class MenuItemTest - { - private delegate void ThreadInvoker(); - - private TestContext testContextInstance; - - /// - ///Gets or sets the test context which provides - ///information about and functionality for the current test run. - /// - public TestContext TestContext - { - get - { - return testContextInstance; - } - set - { - testContextInstance = value; - } - } - - /// - ///A test for lauching the command and closing the associated dialogbox - /// - [TestMethod()] - [HostType("VS IDE")] - public void LaunchCommand() - { - UIThreadInvoker.Invoke((ThreadInvoker)delegate() - { - CommandID menuItemCmd = new CommandID(VitaliiGanzha.VSPackageInstall.GuidList.guidVSPackageInstallCmdSet, (int)VitaliiGanzha.VSPackageInstall.PkgCmdIDList.cmdidVsDing); - - // Create the DialogBoxListener Thread. - string expectedDialogBoxText = string.Format(CultureInfo.CurrentCulture, "{0}\n\nInside {1}.MenuItemCallback()", "VSPackageInstall", "VitaliiGanzha.VSPackageInstall.VSPackageInstallPackage"); - DialogBoxPurger purger = new DialogBoxPurger(NativeMethods.IDOK, expectedDialogBoxText); - - try - { - purger.Start(); - - TestUtils testUtils = new TestUtils(); - testUtils.ExecuteCommand(menuItemCmd); - } - finally - { - Assert.IsTrue(purger.WaitForDialogThreadToTerminate(), "The dialog box has not shown"); - } - }); - } - - } -} diff --git a/VSPackageInstall/VSPackageInstall_IntegrationTests/PackageTest.cs b/VSPackageInstall/VSPackageInstall_IntegrationTests/PackageTest.cs deleted file mode 100644 index 62e9689..0000000 --- a/VSPackageInstall/VSPackageInstall_IntegrationTests/PackageTest.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Text; -using System.Collections.Generic; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using Microsoft.VisualStudio.Shell.Interop; -using Microsoft.VisualStudio.Shell; -using EnvDTE; - -namespace VSPackageInstall_IntegrationTests -{ - /// - /// Integration test for package validation - /// - [TestClass] - public class PackageTest - { - private delegate void ThreadInvoker(); - - private TestContext testContextInstance; - - /// - ///Gets or sets the test context which provides - ///information about and functionality for the current test run. - /// - public TestContext TestContext - { - get - { - return testContextInstance; - } - set - { - testContextInstance = value; - } - } - - [TestMethod] - [HostType("VS IDE")] - public void PackageLoadTest() - { - UIThreadInvoker.Invoke((ThreadInvoker)delegate() - { - - //Get the Shell Service - IVsShell shellService = VsIdeTestHostContext.ServiceProvider.GetService(typeof(SVsShell)) as IVsShell; - Assert.IsNotNull(shellService); - - //Validate package load - IVsPackage package; - Guid packageGuid = new Guid(VitaliiGanzha.VSPackageInstall.GuidList.guidVSPackageInstallPkgString); - Assert.IsTrue(0 == shellService.LoadPackage(ref packageGuid, out package)); - Assert.IsNotNull(package, "Package failed to load"); - - }); - } - } -} diff --git a/VSPackageInstall/VSPackageInstall_IntegrationTests/SignOff-Tests/CPPProjectTests.cs b/VSPackageInstall/VSPackageInstall_IntegrationTests/SignOff-Tests/CPPProjectTests.cs deleted file mode 100644 index d146f65..0000000 --- a/VSPackageInstall/VSPackageInstall_IntegrationTests/SignOff-Tests/CPPProjectTests.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System; -using System.Text; -using System.Collections.Generic; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VsSDK.IntegrationTestLibrary; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using EnvDTE; -using System.IO; - -namespace VSPackageInstall_IntegrationTests.IntegrationTests -{ - [TestClass] - public class CPPProjectTests - { - #region fields - private delegate void ThreadInvoker(); - private TestContext _testContext; - #endregion - - #region properties - /// - ///Gets or sets the test context which provides - ///information about and functionality for the current test run. - /// - public TestContext TestContext - { - get { return _testContext; } - set { _testContext = value; } - } - #endregion - - #region ctors - public CPPProjectTests() - { - } - #endregion - - #region Additional test attributes - // - // You can use the following additional attributes as you write your tests: - // - // Use ClassInitialize to run code before running the first test in the class - // [ClassInitialize()] - // public static void MyClassInitialize(TestContext testContext) { } - // - // Use ClassCleanup to run code after all tests in a class have run - // [ClassCleanup()] - // public static void MyClassCleanup() { } - // - // Use TestInitialize to run code before running each test - // [TestInitialize()] - // public void MyTestInitialize() { } - // - // Use TestCleanup to run code after each test has run - // [TestCleanup()] - // public void MyTestCleanup() { } - // - #endregion - - [HostType("VS IDE")] - [TestMethod] - public void CPPWinformsApplication() - { - UIThreadInvoker.Invoke((ThreadInvoker)delegate() - { - //Solution and project creation parameters - string solutionName = "CPPWinApp"; - string projectName = "CPPWinApp"; - - //Template parameters - string projectType = "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}"; - string projectTemplateName = Path.Combine("vcNet", "mc++appwiz.vsz"); - - string itemTemplateName = "newc++file.cpp"; - string newFileName = "Test.cpp"; - - DTE dte = (DTE)VsIdeTestHostContext.ServiceProvider.GetService(typeof(DTE)); - - TestUtils testUtils = new TestUtils(); - - testUtils.CreateEmptySolution(TestContext.TestDir, solutionName); - Assert.AreEqual(0, testUtils.ProjectCount()); - - //Add new CPP Windows application project to existing solution - string solutionDirectory = Directory.GetParent(dte.Solution.FullName).FullName; - string projectDirectory = TestUtils.GetNewDirectoryName(solutionDirectory, projectName); - string projectTemplatePath = Path.Combine(dte.Solution.get_TemplatePath(projectType), projectTemplateName); - Assert.IsTrue(File.Exists(projectTemplatePath), string.Format("Could not find template file: {0}", projectTemplatePath)); - dte.Solution.AddFromTemplate(projectTemplatePath, projectDirectory, projectName, false); - - //Verify that the new project has been added to the solution - Assert.AreEqual(1, testUtils.ProjectCount()); - - //Get the project - Project project = dte.Solution.Item(1); - Assert.IsNotNull(project); - Assert.IsTrue(string.Compare(project.Name, projectName, StringComparison.InvariantCultureIgnoreCase) == 0); - - //Verify Adding new code file to project - string newItemTemplatePath = Path.Combine(dte.Solution.ProjectItemsTemplatePath(projectType), itemTemplateName); - Assert.IsTrue(File.Exists(newItemTemplatePath)); - ProjectItem item = project.ProjectItems.AddFromTemplate(newItemTemplatePath, newFileName); - Assert.IsNotNull(item); - - }); - } - - } -} diff --git a/VSPackageInstall/VSPackageInstall_IntegrationTests/SignOff-Tests/CSharpProjectTests.cs b/VSPackageInstall/VSPackageInstall_IntegrationTests/SignOff-Tests/CSharpProjectTests.cs deleted file mode 100644 index 0d34ad0..0000000 --- a/VSPackageInstall/VSPackageInstall_IntegrationTests/SignOff-Tests/CSharpProjectTests.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System; -using System.Text; -using System.Collections.Generic; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VsSDK.IntegrationTestLibrary; -using Microsoft.VSSDK.Tools.VsIdeTesting; - -namespace VSPackageInstall_IntegrationTests.IntegrationTests -{ - [TestClass] - public class CSharpProjectTests - { - #region fields - private delegate void ThreadInvoker(); - private TestContext _testContext; - #endregion - - #region properties - /// - ///Gets or sets the test context which provides - ///information about and functionality for the current test run. - /// - public TestContext TestContext - { - get { return _testContext; } - set { _testContext = value; } - } - #endregion - - #region ctors - public CSharpProjectTests() - { - } - #endregion - - #region Additional test attributes - // - // You can use the following additional attributes as you write your tests: - // - // Use ClassInitialize to run code before running the first test in the class - // [ClassInitialize()] - // public static void MyClassInitialize(TestContext testContext) { } - // - // Use ClassCleanup to run code after all tests in a class have run - // [ClassCleanup()] - // public static void MyClassCleanup() { } - // - // Use TestInitialize to run code before running each test - // [TestInitialize()] - // public void MyTestInitialize() { } - // - // Use TestCleanup to run code after each test has run - // [TestCleanup()] - // public void MyTestCleanup() { } - // - #endregion - - [TestMethod] - [HostType("VS IDE")] - public void WinformsApplication() - { - UIThreadInvoker.Invoke((ThreadInvoker)delegate() - { - TestUtils testUtils = new TestUtils(); - - testUtils.CreateEmptySolution(TestContext.TestDir, "CSWinApp"); - Assert.AreEqual(0, testUtils.ProjectCount()); - - //Create Winforms application project - //TestUtils.CreateProjectFromTemplate("MyWindowsApp", "Windows Application", "CSharp", false); - //Assert.AreEqual(1, TestUtils.ProjectCount()); - - //TODO Verify that we can debug launch the application - - //TODO Set Break point and verify that will hit - - //TODO Verify Adding new project item to project - - }); - } - - } -} diff --git a/VSPackageInstall/VSPackageInstall_IntegrationTests/SignOff-Tests/SolutionTests.cs b/VSPackageInstall/VSPackageInstall_IntegrationTests/SignOff-Tests/SolutionTests.cs deleted file mode 100644 index 00e4e51..0000000 --- a/VSPackageInstall/VSPackageInstall_IntegrationTests/SignOff-Tests/SolutionTests.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.Text; -using System.Collections.Generic; -using Microsoft.VisualStudio.Shell.Interop; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using EnvDTE; -using System.IO; -using Microsoft.VsSDK.IntegrationTestLibrary; - - -namespace VSPackageInstall_IntegrationTests.IntegrationTests -{ - [TestClass] - public class SolutionTests - { - #region fields - private delegate void ThreadInvoker(); - private TestContext _testContext; - #endregion - - #region properties - /// - ///Gets or sets the test context which provides - ///information about and functionality for the current test run. - /// - public TestContext TestContext - { - get { return _testContext; } - set { _testContext = value; } - } - #endregion - - - #region ctors - public SolutionTests() - { - } - - #endregion - - [TestMethod] - [HostType("VS IDE")] - public void CreateEmptySolution() - { - UIThreadInvoker.Invoke((ThreadInvoker)delegate() - { - TestUtils testUtils = new TestUtils(); - testUtils.CloseCurrentSolution(__VSSLNSAVEOPTIONS.SLNSAVEOPT_NoSave); - testUtils.CreateEmptySolution(TestContext.TestDir, "EmptySolution"); - }); - } - - } -} diff --git a/VSPackageInstall/VSPackageInstall_IntegrationTests/SignOff-Tests/VBProjectTests.cs b/VSPackageInstall/VSPackageInstall_IntegrationTests/SignOff-Tests/VBProjectTests.cs deleted file mode 100644 index d9253df..0000000 --- a/VSPackageInstall/VSPackageInstall_IntegrationTests/SignOff-Tests/VBProjectTests.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System; -using System.Text; -using System.Collections.Generic; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VsSDK.IntegrationTestLibrary; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using EnvDTE; - -namespace VSPackageInstall_IntegrationTests.IntegrationTests -{ - [TestClass] - public class VisualBasicProjectTests - { - #region fields - private delegate void ThreadInvoker(); - private TestContext _testContext; - #endregion - - #region properties - /// - ///Gets or sets the test context which provides - ///information about and functionality for the current test run. - /// - public TestContext TestContext - { - get { return _testContext; } - set { _testContext = value; } - } - #endregion - - #region ctors - public VisualBasicProjectTests() - { - } - #endregion - - #region Additional test attributes - // - // You can use the following additional attributes as you write your tests: - // - // Use ClassInitialize to run code before running the first test in the class - // [ClassInitialize()] - // public static void MyClassInitialize(TestContext testContext) { } - // - // Use ClassCleanup to run code after all tests in a class have run - // [ClassCleanup()] - // public static void MyClassCleanup() { } - // - // Use TestInitialize to run code before running each test - // [TestInitialize()] - // public void MyTestInitialize() { } - // - // Use TestCleanup to run code after each test has run - // [TestCleanup()] - // public void MyTestCleanup() { } - // - #endregion - - [HostType("VS IDE")] - [TestMethod] - public void VBWinformsApplication() - { - UIThreadInvoker.Invoke((ThreadInvoker)delegate() - { - //Solution and project creation parameters - string solutionName = "VBWinApp"; - string projectName = "VBWinApp"; - - //Template parameters - string language = "VisualBasic"; - string projectTemplateName = "WindowsApplication.Zip"; - string itemTemplateName = "CodeFile.zip"; - string newFileName = "Test.vb"; - - DTE dte = (DTE)VsIdeTestHostContext.ServiceProvider.GetService(typeof(DTE)); - - TestUtils testUtils = new TestUtils(); - - testUtils.CreateEmptySolution(TestContext.TestDir, solutionName); - Assert.AreEqual(0, testUtils.ProjectCount()); - - //Add new Windows application project to existing solution - testUtils.CreateProjectFromTemplate(projectName, projectTemplateName, language, false); - - //Verify that the new project has been added to the solution - Assert.AreEqual(1, testUtils.ProjectCount()); - - //Get the project - Project project = dte.Solution.Item(1); - Assert.IsNotNull(project); - Assert.IsTrue(string.Compare(project.Name, projectName, StringComparison.InvariantCultureIgnoreCase) == 0); - - //Verify Adding new code file to project - ProjectItem newCodeFileItem = testUtils.AddNewItemFromVsTemplate(project.ProjectItems, itemTemplateName, language, newFileName); - Assert.IsNotNull(newCodeFileItem, "Could not create new project item"); - - }); - } - - } -} diff --git a/VSPackageInstall/VSPackageInstall_IntegrationTests/ToolWindowTest.cs b/VSPackageInstall/VSPackageInstall_IntegrationTests/ToolWindowTest.cs deleted file mode 100644 index ef5e460..0000000 --- a/VSPackageInstall/VSPackageInstall_IntegrationTests/ToolWindowTest.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using System.ComponentModel.Design; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VisualStudio.OLE.Interop; -using Microsoft.VisualStudio.Shell.Interop; -using Microsoft.VisualStudio.Shell; -using Microsoft.VsSDK.IntegrationTestLibrary; -using Microsoft.VSSDK.Tools.VsIdeTesting; - -namespace VSPackageInstall_IntegrationTests -{ - - [TestClass()] - public class ToolWindowTest - { - private delegate void ThreadInvoker(); - - private TestContext testContextInstance; - - /// - ///Gets or sets the test context which provides - ///information about and functionality for the current test run. - /// - public TestContext TestContext - { - get - { - return testContextInstance; - } - set - { - testContextInstance = value; - } - } - - /// - ///A test for showing the toolwindow - /// - [TestMethod()] - [HostType("VS IDE")] - public void ShowToolWindow() - { - UIThreadInvoker.Invoke((ThreadInvoker)delegate() - { - CommandID toolWindowCmd = new CommandID(VitaliiGanzha.VSPackageInstall.GuidList.guidVSPackageInstallCmdSet, (int)VitaliiGanzha.VSPackageInstall.PkgCmdIDList.cmdidVsDingWnd); - - TestUtils testUtils = new TestUtils(); - testUtils.ExecuteCommand(toolWindowCmd); - - Assert.IsTrue(testUtils.CanFindToolwindow(new Guid(VitaliiGanzha.VSPackageInstall.GuidList.guidToolWindowPersistanceString))); - - }); - } - - } -} diff --git a/VSPackageInstall/VSPackageInstall_IntegrationTests/VSPackageInstall_IntegrationTests.csproj b/VSPackageInstall/VSPackageInstall_IntegrationTests/VSPackageInstall_IntegrationTests.csproj deleted file mode 100644 index e6bf3bb..0000000 --- a/VSPackageInstall/VSPackageInstall_IntegrationTests/VSPackageInstall_IntegrationTests.csproj +++ /dev/null @@ -1,91 +0,0 @@ - - - - Debug - AnyCPU - 2.0 - {77A542CC-52C0-4387-B57B-63AF5F597EA1} - Library - Properties - VSPackageInstall_IntegrationTests - VSPackageInstall_IntegrationTests - v4.5 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - Key.snk - - - true - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {20191D13-7CC1-4F9B-9CB8-42F22ACE4CA6} - VSPackageInstall - - - - - \ No newline at end of file diff --git a/VSPackageInstall/VSPackageInstall_UnitTests/Key.snk b/VSPackageInstall/VSPackageInstall_UnitTests/Key.snk deleted file mode 100644 index 6a24fe5f0d37f6d08dea86afe7d0a6450396455c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50096?%fn1!tK`Saw++$=>$H`QUk{`WNwv#& zMG;3g=ia)Gk|*OUu)uG+h>1bu|Png#*EnlA)N|TUoFWqVR-u@X1*I-b1 z#EN(VBF!_iWmOW_AM4+X{P$JNxdVHXX_K7TTg(d{@hLdH8)yRgC{AU4*VBeoQVF$v zKw`(|YskodA^-|`@4;Y2xo-8%r$Q87VAs~Kxw&b0R>?D6v+cMiVhS{mR5)FQY>%ke zi7%%Op){xLjoG2m2rhLVNk zvU$&s3HU4uc(2<)m%WAvZAx}I!y)p`B!0&zztTST5% zEAD@@FL@2jq7)k>1u_L+fLPjaG1wP^H8%Dg4m*78$%y| zROfqYPhvm`8wVr}CPa6t2W2>?`=GWo0^LkMBri2G12b8;qH{jek|WBCiq9T@kw{Th zk$ik?KkWq06L2a?hc+6G$s5g&2jeXC#pa@vV|ZT=eZSU=I*LwM`#o^VU&XP(NxGQf i$LKzvL-H(?PQS5GJqM>t@3&ukpyXc{&7|Qf>KL$*KNN=m diff --git a/VSPackageInstall/VSPackageInstall_UnitTests/MenuItemTests/MenuItemCallback.cs b/VSPackageInstall/VSPackageInstall_UnitTests/MenuItemTests/MenuItemCallback.cs deleted file mode 100644 index b5aac3f..0000000 --- a/VSPackageInstall/VSPackageInstall_UnitTests/MenuItemTests/MenuItemCallback.cs +++ /dev/null @@ -1,80 +0,0 @@ -/*************************************************************************** - -Copyright (c) Microsoft Corporation. All rights reserved. -This code is licensed under the Visual Studio SDK license terms. -THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. - -***************************************************************************/ - -using System; -using System.Collections; -using System.Text; -using System.Reflection; -using System.ComponentModel.Design; -using Microsoft.VsSDK.UnitTestLibrary; -using Microsoft.VisualStudio.Shell.Interop; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VisualStudio.Shell; -using VitaliiGanzha.VSPackageInstall; - -namespace VSPackageInstall_UnitTests.MenuItemTests -{ - [TestClass()] - public class MenuItemTest - { - /// - /// Verify that a new menu command object gets added to the OleMenuCommandService. - /// This action takes place In the Initialize method of the Package object - /// - [TestMethod] - public void InitializeMenuCommand() - { - // Create the package - IVsPackage package = new VSPackageInstallPackage() as IVsPackage; - Assert.IsNotNull(package, "The object does not implement IVsPackage"); - - // Create a basic service provider - OleServiceProvider serviceProvider = OleServiceProvider.CreateOleServiceProviderWithBasicServices(); - - // Site the package - Assert.AreEqual(0, package.SetSite(serviceProvider), "SetSite did not return S_OK"); - - //Verify that the menu command can be found - CommandID menuCommandID = new CommandID(VitaliiGanzha.VSPackageInstall.GuidList.guidVSPackageInstallCmdSet, (int)VitaliiGanzha.VSPackageInstall.PkgCmdIDList.cmdidVsDing); - System.Reflection.MethodInfo info = typeof(Package).GetMethod("GetService", BindingFlags.Instance | BindingFlags.NonPublic); - Assert.IsNotNull(info); - OleMenuCommandService mcs = info.Invoke(package, new object[] { (typeof(IMenuCommandService)) }) as OleMenuCommandService; - Assert.IsNotNull(mcs.FindCommand(menuCommandID)); - } - - [TestMethod] - public void MenuItemCallback() - { - // Create the package - IVsPackage package = new VSPackageInstallPackage() as IVsPackage; - Assert.IsNotNull(package, "The object does not implement IVsPackage"); - - // Create a basic service provider - OleServiceProvider serviceProvider = OleServiceProvider.CreateOleServiceProviderWithBasicServices(); - - // Create a UIShell service mock and proffer the service so that it can called from the MenuItemCallback method - BaseMock uishellMock = UIShellServiceMock.GetUiShellInstance(); - serviceProvider.AddService(typeof(SVsUIShell), uishellMock, true); - - // Site the package - Assert.AreEqual(0, package.SetSite(serviceProvider), "SetSite did not return S_OK"); - - //Invoke private method on package class and observe that the method does not throw - System.Reflection.MethodInfo info = package.GetType().GetMethod("MenuItemCallback", BindingFlags.Instance | BindingFlags.NonPublic); - Assert.IsNotNull(info, "Failed to get the private method MenuItemCallback throug refplection"); - info.Invoke(package, new object[] { null, null }); - - //Clean up services - serviceProvider.RemoveService(typeof(SVsUIShell)); - - } - } -} diff --git a/VSPackageInstall/VSPackageInstall_UnitTests/MenuItemTests/UIShellServiceMock.cs b/VSPackageInstall/VSPackageInstall_UnitTests/MenuItemTests/UIShellServiceMock.cs deleted file mode 100644 index 2d9b464..0000000 --- a/VSPackageInstall/VSPackageInstall_UnitTests/MenuItemTests/UIShellServiceMock.cs +++ /dev/null @@ -1,76 +0,0 @@ -/*************************************************************************** - -Copyright (c) Microsoft Corporation. All rights reserved. -This code is licensed under the Visual Studio SDK license terms. -THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. - -***************************************************************************/ - -using System; -using Microsoft.VisualStudio; -using Microsoft.VisualStudio.Shell.Interop; -using Microsoft.VsSDK.UnitTestLibrary; - -namespace VSPackageInstall_UnitTests -{ - static class UIShellServiceMock - { - private static GenericMockFactory uiShellFactory; - - #region UiShell Getters - /// - /// Returns an IVsUiShell that does not implement any methods - /// - /// - internal static BaseMock GetUiShellInstance() - { - if (uiShellFactory == null) - { - uiShellFactory = new GenericMockFactory("UiShell", new Type[] { typeof(IVsUIShell), typeof(IVsUIShellOpenDocument) }); - } - BaseMock uiShell = uiShellFactory.GetInstance(); - return uiShell; - } - - /// - /// Get an IVsUiShell that implements SetWaitCursor, SaveDocDataToFile, ShowMessageBox - /// - /// uishell mock - internal static BaseMock GetUiShellInstance0() - { - BaseMock uiShell = GetUiShellInstance(); - string name = string.Format("{0}.{1}", typeof(IVsUIShell).FullName, "SetWaitCursor"); - uiShell.AddMethodCallback(name, new EventHandler(SetWaitCursorCallBack)); - - name = string.Format("{0}.{1}", typeof(IVsUIShell).FullName, "SaveDocDataToFile"); - uiShell.AddMethodCallback(name, new EventHandler(SaveDocDataToFileCallBack)); - - name = string.Format("{0}.{1}", typeof(IVsUIShell).FullName, "ShowMessageBox"); - uiShell.AddMethodCallback(name, new EventHandler(ShowMessageBoxCallBack)); - return uiShell; - } - #endregion - - #region Callbacks - private static void SetWaitCursorCallBack(object caller, CallbackArgs arguments) - { - arguments.ReturnValue = VSConstants.S_OK; - } - - private static void SaveDocDataToFileCallBack(object caller, CallbackArgs arguments) - { - arguments.ReturnValue = VSConstants.S_OK; - } - - private static void ShowMessageBoxCallBack(object caller, CallbackArgs arguments) - { - arguments.ReturnValue = VSConstants.S_OK; - arguments.SetParameter(10, (int)System.Windows.Forms.DialogResult.Yes); - } - - #endregion - } -} \ No newline at end of file diff --git a/VSPackageInstall/VSPackageInstall_UnitTests/MyToolWindowTest/MyToolWindow.cs b/VSPackageInstall/VSPackageInstall_UnitTests/MyToolWindowTest/MyToolWindow.cs deleted file mode 100644 index 23e98ae..0000000 --- a/VSPackageInstall/VSPackageInstall_UnitTests/MyToolWindowTest/MyToolWindow.cs +++ /dev/null @@ -1,58 +0,0 @@ -/*************************************************************************** - -Copyright (c) Microsoft Corporation. All rights reserved. -This code is licensed under the Visual Studio SDK license terms. -THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. - -***************************************************************************/ - -using System; -using System.Collections; -using System.Text; -using System.Reflection; -using Microsoft.VsSDK.UnitTestLibrary; -using Microsoft.VisualStudio.Shell.Interop; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using VitaliiGanzha.VSPackageInstall; - -namespace VSPackageInstall_UnitTests.MyToolWindowTest -{ - /// - ///This is a test class for MyToolWindowTest and is intended - ///to contain all MyToolWindowTest Unit Tests - /// - [TestClass()] - public class MyToolWindowTest - { - - /// - ///MyToolWindow Constructor test - /// - [TestMethod()] - public void MyToolWindowConstructorTest() - { - - MyToolWindow target = new MyToolWindow(); - Assert.IsNotNull(target, "Failed to create an instance of MyToolWindow"); - - MethodInfo method = target.GetType().GetMethod("get_Content", BindingFlags.Public | BindingFlags.Instance); - Assert.IsNotNull(method.Invoke(target, null), "MyControl object was not instantiated"); - - } - - /// - ///Verify the Content property is valid. - /// - [TestMethod()] - public void WindowPropertyTest() - { - MyToolWindow target = new MyToolWindow(); - Assert.IsNotNull(target.Content, "Content property was null"); - } - - } -} diff --git a/VSPackageInstall/VSPackageInstall_UnitTests/MyToolWindowTest/ShowToolWindow.cs b/VSPackageInstall/VSPackageInstall_UnitTests/MyToolWindowTest/ShowToolWindow.cs deleted file mode 100644 index bc7e9c5..0000000 --- a/VSPackageInstall/VSPackageInstall_UnitTests/MyToolWindowTest/ShowToolWindow.cs +++ /dev/null @@ -1,77 +0,0 @@ -/*************************************************************************** - -Copyright (c) Microsoft Corporation. All rights reserved. -This code is licensed under the Visual Studio SDK license terms. -THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. - -***************************************************************************/ - -using System; -using System.Collections; -using System.Text; -using System.Reflection; -using Microsoft.VsSDK.UnitTestLibrary; -using Microsoft.VisualStudio.Shell.Interop; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.VSSDK.Tools.VsIdeTesting; -using VitaliiGanzha.VSPackageInstall; - -namespace VSPackageInstall_UnitTests.MyToolWindowTest -{ - [TestClass()] - public class ShowToolWindowTest - { - - [TestMethod()] - public void ValidateToolWindowShown() - { - IVsPackage package = new VSPackageInstallPackage() as IVsPackage; - - // Create a basic service provider - OleServiceProvider serviceProvider = OleServiceProvider.CreateOleServiceProviderWithBasicServices(); - - //Add uishell service that knows how to create a toolwindow - BaseMock uiShellService = UIShellServiceMock.GetUiShellInstanceCreateToolWin(); - serviceProvider.AddService(typeof(SVsUIShell), uiShellService, false); - - // Site the package - Assert.AreEqual(0, package.SetSite(serviceProvider), "SetSite did not return S_OK"); - - MethodInfo method = typeof(VSPackageInstallPackage).GetMethod("ShowToolWindow", BindingFlags.NonPublic | BindingFlags.Instance); - - object result = method.Invoke(package, new object[] { null, null }); - } - - [TestMethod()] - [ExpectedException(typeof(InvalidOperationException), "Did not throw expected exception when windowframe object was null")] - public void ShowToolwindowNegativeTest() - { - IVsPackage package = new VSPackageInstallPackage() as IVsPackage; - - // Create a basic service provider - OleServiceProvider serviceProvider = OleServiceProvider.CreateOleServiceProviderWithBasicServices(); - - //Add uishell service that knows how to create a toolwindow - BaseMock uiShellService = UIShellServiceMock.GetUiShellInstanceCreateToolWinReturnsNull(); - serviceProvider.AddService(typeof(SVsUIShell), uiShellService, false); - - // Site the package - Assert.AreEqual(0, package.SetSite(serviceProvider), "SetSite did not return S_OK"); - - MethodInfo method = typeof(VSPackageInstallPackage).GetMethod("ShowToolWindow", BindingFlags.NonPublic | BindingFlags.Instance); - - //Invoke thows TargetInvocationException, but we want it's inner Exception thrown by ShowToolWindow, InvalidOperationException. - try - { - object result = method.Invoke(package, new object[] { null, null }); - } - catch (Exception e) - { - throw e.InnerException; - } - } - } -} diff --git a/VSPackageInstall/VSPackageInstall_UnitTests/MyToolWindowTest/UIShellServiceMock.cs b/VSPackageInstall/VSPackageInstall_UnitTests/MyToolWindowTest/UIShellServiceMock.cs deleted file mode 100644 index 404dfb6..0000000 --- a/VSPackageInstall/VSPackageInstall_UnitTests/MyToolWindowTest/UIShellServiceMock.cs +++ /dev/null @@ -1,84 +0,0 @@ -/*************************************************************************** - -Copyright (c) Microsoft Corporation. All rights reserved. -This code is licensed under the Visual Studio SDK license terms. -THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. - -***************************************************************************/ - -using System; -using Microsoft.VisualStudio; -using Microsoft.VisualStudio.Shell.Interop; -using Microsoft.VsSDK.UnitTestLibrary; - -namespace VSPackageInstall_UnitTests.MyToolWindowTest -{ - static class UIShellServiceMock - { - private static GenericMockFactory uiShellFactory; - - #region UiShell Getters - /// - /// Returns an IVsUiShell that does not implement any methods - /// - /// - internal static BaseMock GetUiShellInstance() - { - if (uiShellFactory == null) - { - uiShellFactory = new GenericMockFactory("UiShell", new Type[] { typeof(IVsUIShell), typeof(IVsUIShellOpenDocument) }); - } - BaseMock uiShell = uiShellFactory.GetInstance(); - return uiShell; - } - - /// - /// Get an IVsUiShell that implement CreateToolWindow - /// - /// uishell mock - internal static BaseMock GetUiShellInstanceCreateToolWin() - { - BaseMock uiShell = GetUiShellInstance(); - string name = string.Format("{0}.{1}", typeof(IVsUIShell).FullName, "CreateToolWindow"); - uiShell.AddMethodCallback(name, new EventHandler(CreateToolWindowCallBack)); - - return uiShell; - } - - /// - /// Get an IVsUiShell that implement CreateToolWindow (negative test) - /// - /// uishell mock - internal static BaseMock GetUiShellInstanceCreateToolWinReturnsNull() - { - BaseMock uiShell = GetUiShellInstance(); - string name = string.Format("{0}.{1}", typeof(IVsUIShell).FullName, "CreateToolWindow"); - uiShell.AddMethodCallback(name, new EventHandler(CreateToolWindowNegativeTestCallBack)); - - return uiShell; - } - #endregion - - #region Callbacks - private static void CreateToolWindowCallBack(object caller, CallbackArgs arguments) - { - arguments.ReturnValue = VSConstants.S_OK; - - // Create the output mock object for the frame - IVsWindowFrame frame = WindowFrameMock.GetBaseFrame(); - arguments.SetParameter(9, frame); - } - - private static void CreateToolWindowNegativeTestCallBack(object caller, CallbackArgs arguments) - { - arguments.ReturnValue = VSConstants.S_OK; - - //set the windowframe object to null - arguments.SetParameter(9, null); - } - #endregion - } -} \ No newline at end of file diff --git a/VSPackageInstall/VSPackageInstall_UnitTests/MyToolWindowTest/WindowFrameMock.cs b/VSPackageInstall/VSPackageInstall_UnitTests/MyToolWindowTest/WindowFrameMock.cs deleted file mode 100644 index 90d190c..0000000 --- a/VSPackageInstall/VSPackageInstall_UnitTests/MyToolWindowTest/WindowFrameMock.cs +++ /dev/null @@ -1,39 +0,0 @@ -/*************************************************************************** - -Copyright (c) Microsoft Corporation. All rights reserved. -This code is licensed under the Visual Studio SDK license terms. -THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. - -***************************************************************************/ - -using System; -using System.Collections.Generic; -using System.Text; -using Microsoft.VsSDK.UnitTestLibrary; -using Microsoft.VisualStudio; -using Microsoft.VisualStudio.Shell.Interop; - -namespace VSPackageInstall_UnitTests.MyToolWindowTest -{ - class WindowFrameMock - { - const string propertiesName = "properties"; - - private static GenericMockFactory frameFactory = null; - - /// - /// Return a IVsWindowFrame without any special implementation - /// - /// - internal static IVsWindowFrame GetBaseFrame() - { - if (frameFactory == null) - frameFactory = new GenericMockFactory("WindowFrame", new Type[] { typeof(IVsWindowFrame), typeof(IVsWindowFrame2) }); - IVsWindowFrame frame = (IVsWindowFrame)frameFactory.GetInstance(); - return frame; - } - } -} diff --git a/VSPackageInstall/VSPackageInstall_UnitTests/PackageTest.cs b/VSPackageInstall/VSPackageInstall_UnitTests/PackageTest.cs deleted file mode 100644 index bcf1b0a..0000000 --- a/VSPackageInstall/VSPackageInstall_UnitTests/PackageTest.cs +++ /dev/null @@ -1,56 +0,0 @@ -/*************************************************************************** - -Copyright (c) Microsoft Corporation. All rights reserved. -This code is licensed under the Visual Studio SDK license terms. -THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF -ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY -IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR -PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. - -***************************************************************************/ - -using System; -using System.Collections; -using System.Text; -using System.Reflection; -using Microsoft.VsSDK.UnitTestLibrary; -using Microsoft.VisualStudio.Shell.Interop; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using VitaliiGanzha.VSPackageInstall; - -namespace VSPackageInstall_UnitTests -{ - [TestClass()] - public class PackageTest - { - [TestMethod()] - public void CreateInstance() - { - VSPackageInstallPackage package = new VSPackageInstallPackage(); - } - - [TestMethod()] - public void IsIVsPackage() - { - VSPackageInstallPackage package = new VSPackageInstallPackage(); - Assert.IsNotNull(package as IVsPackage, "The object does not implement IVsPackage"); - } - - [TestMethod()] - public void SetSite() - { - // Create the package - IVsPackage package = new VSPackageInstallPackage() as IVsPackage; - Assert.IsNotNull(package, "The object does not implement IVsPackage"); - - // Create a basic service provider - OleServiceProvider serviceProvider = OleServiceProvider.CreateOleServiceProviderWithBasicServices(); - - // Site the package - Assert.AreEqual(0, package.SetSite(serviceProvider), "SetSite did not return S_OK"); - - // Unsite the package - Assert.AreEqual(0, package.SetSite(null), "SetSite(null) did not return S_OK"); - } - } -} diff --git a/VSPackageInstall/VSPackageInstall_UnitTests/VSPackageInstall_UnitTests.csproj b/VSPackageInstall/VSPackageInstall_UnitTests/VSPackageInstall_UnitTests.csproj deleted file mode 100644 index 76429a2..0000000 --- a/VSPackageInstall/VSPackageInstall_UnitTests/VSPackageInstall_UnitTests.csproj +++ /dev/null @@ -1,84 +0,0 @@ - - - - Debug - AnyCPU - 2.0 - {E620FC0C-6208-4216-9899-47DF43578E4C} - Library - Properties - VSPackageInstall_UnitTests - VSPackageInstall_UnitTests - v4.5 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - Key.snk - - - true - - - - - - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {20191D13-7CC1-4F9B-9CB8-42F22ACE4CA6} - VSPackageInstall - - - - \ No newline at end of file diff --git a/VsDingExtension.sln b/VsDingExtension.sln index 8d4d4f1..b15e144 100644 --- a/VsDingExtension.sln +++ b/VsDingExtension.sln @@ -1,21 +1,15 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 +VisualStudioVersion = 12.0.30110.0 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VsDingExtension", "VsDingExtension\VsDingExtension.csproj", "{54C786E5-FD14-4036-92AE-E9F25B71534B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VSPackageInstall", "VSPackageInstall\VSPackageInstall.csproj", "{20191D13-7CC1-4F9B-9CB8-42F22ACE4CA6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VSPackageInstall_IntegrationTests", "VSPackageInstall\VSPackageInstall_IntegrationTests\VSPackageInstall_IntegrationTests.csproj", "{77A542CC-52C0-4387-B57B-63AF5F597EA1}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5BD9D4DB-8683-4698-8D24-01EE7306F73A}" ProjectSection(SolutionItems) = preProject IntegrationTests.testsettings = IntegrationTests.testsettings UnitTests.testsettings = UnitTests.testsettings EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VSPackageInstall_UnitTests", "VSPackageInstall\VSPackageInstall_UnitTests\VSPackageInstall_UnitTests.csproj", "{E620FC0C-6208-4216-9899-47DF43578E4C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VsDingExtensionProject", "VsDingExtensionProject\VsDingExtensionProject.csproj", "{3BEC1E8B-59C5-439E-AE97-8FF4B3E6B0C1}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -23,22 +17,10 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {54C786E5-FD14-4036-92AE-E9F25B71534B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {54C786E5-FD14-4036-92AE-E9F25B71534B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {54C786E5-FD14-4036-92AE-E9F25B71534B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {54C786E5-FD14-4036-92AE-E9F25B71534B}.Release|Any CPU.Build.0 = Release|Any CPU - {20191D13-7CC1-4F9B-9CB8-42F22ACE4CA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {20191D13-7CC1-4F9B-9CB8-42F22ACE4CA6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {20191D13-7CC1-4F9B-9CB8-42F22ACE4CA6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {20191D13-7CC1-4F9B-9CB8-42F22ACE4CA6}.Release|Any CPU.Build.0 = Release|Any CPU - {77A542CC-52C0-4387-B57B-63AF5F597EA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {77A542CC-52C0-4387-B57B-63AF5F597EA1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {77A542CC-52C0-4387-B57B-63AF5F597EA1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {77A542CC-52C0-4387-B57B-63AF5F597EA1}.Release|Any CPU.Build.0 = Release|Any CPU - {E620FC0C-6208-4216-9899-47DF43578E4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E620FC0C-6208-4216-9899-47DF43578E4C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E620FC0C-6208-4216-9899-47DF43578E4C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E620FC0C-6208-4216-9899-47DF43578E4C}.Release|Any CPU.Build.0 = Release|Any CPU + {3BEC1E8B-59C5-439E-AE97-8FF4B3E6B0C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3BEC1E8B-59C5-439E-AE97-8FF4B3E6B0C1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3BEC1E8B-59C5-439E-AE97-8FF4B3E6B0C1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3BEC1E8B-59C5-439E-AE97-8FF4B3E6B0C1}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/VsDingExtension/AssemblyInfo.cs b/VsDingExtension/AssemblyInfo.cs deleted file mode 100644 index 9f505ee..0000000 --- a/VsDingExtension/AssemblyInfo.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Revision -// Build Number -// -// You can specify all the value or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.0.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified - the assembly cannot be signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. -// (*) If the key file and a key name attributes are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP - that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the file is installed into the CSP and used. -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("")] -[assembly: AssemblyKeyName("")] diff --git a/VsDingExtension/Connect.cs b/VsDingExtension/Connect.cs deleted file mode 100644 index 908b1cc..0000000 --- a/VsDingExtension/Connect.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; -using Extensibility; -using EnvDTE; -using EnvDTE80; -namespace VsDingExtension -{ - /// The object for implementing an Add-in. - /// - public class Connect : IDTExtensibility2 - { - /// Implements the constructor for the Add-in object. Place your initialization code within this method. - public Connect() - { - } - - /// Implements the OnConnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being loaded. - /// Root object of the host application. - /// Describes how the Add-in is being loaded. - /// Object representing this Add-in. - /// - public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom) - { - applicationObject = (DTE2)application; - addInInstance = (AddIn)addInInst; - } - - /// Implements the OnDisconnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being unloaded. - /// Describes how the Add-in is being unloaded. - /// Array of parameters that are host application specific. - /// - public void OnDisconnection(ext_DisconnectMode disconnectMode, ref Array custom) - { - } - - /// Implements the OnAddInsUpdate method of the IDTExtensibility2 interface. Receives notification when the collection of Add-ins has changed. - /// Array of parameters that are host application specific. - /// - public void OnAddInsUpdate(ref Array custom) - { - } - - /// Implements the OnStartupComplete method of the IDTExtensibility2 interface. Receives notification that the host application has completed loading. - /// Array of parameters that are host application specific. - /// - public void OnStartupComplete(ref Array custom) - { - applicationObject.Events.BuildEvents.OnBuildDone += BuildEventsOnOnBuildDone; - } - - private void BuildEventsOnOnBuildDone(vsBuildScope scope, vsBuildAction action) - { - System.Media.SystemSounds.Asterisk.Play(); - } - - /// Implements the OnBeginShutdown method of the IDTExtensibility2 interface. Receives notification that the host application is being unloaded. - /// Array of parameters that are host application specific. - /// - public void OnBeginShutdown(ref Array custom) - { - } - - private DTE2 applicationObject; - private AddIn addInInstance; - } -} \ No newline at end of file diff --git a/VsDingExtension/VsDingExtension.AddIn b/VsDingExtension/VsDingExtension.AddIn deleted file mode 100644 index 55ebe90077d684735df3740a58ae2b53c054f67d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 42266 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 - - - Debug - AnyCPU - 8.0.30424 - 2.0 - {54C786E5-FD14-4036-92AE-E9F25B71534B} - Library - - - false - VsDingExtension - .\bin\ - v4.5 - - - - true - false - .\bin\Debug\ - false - DEBUG;TRACE - 4 - false - false - VsDingExtension.xml - - - false - true - .\bin\Release\ - false - TRACE - 4 - false - false - VsDingExtension.xml - - - VsDingExtension - - - - False - - - - - - - - - - Code - - - Code - - - - - {80CC9F66-E7D8-4DDD-85B6-D9E6CD0E93E2} - 8 - 0 - 0 - primary - False - False - - - {26AD1324-4B7C-44BC-84F8-B86AED45729F} - 10 - 0 - 0 - primary - False - False - - - {1A31287A-4D7D-413E-8E32-3B374931BD89} - 8 - 0 - 0 - primary - False - False - - - {2CE2370E-D744-4936-A090-3FFFE667B0E1} - 9 - 0 - 0 - primary - False - False - - - {1CBA492E-7263-47BB-87FE-639000619B15} - 8 - 0 - 0 - primary - False - False - - - {00020430-0000-0000-C000-000000000046} - 2 - 0 - 0 - primary - False - False - - - - - VsDingExtension - For Testing.AddIn - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/VsDingExtension/VsDingExtension.xml b/VsDingExtension/VsDingExtension.xml deleted file mode 100644 index ffa1530..0000000 --- a/VsDingExtension/VsDingExtension.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - VsDingExtension - - - - The object for implementing an Add-in. - - - - Implements the constructor for the Add-in object. Place your initialization code within this method. - - - Implements the OnConnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being loaded. - Root object of the host application. - Describes how the Add-in is being loaded. - Object representing this Add-in. - - - - Implements the OnDisconnection method of the IDTExtensibility2 interface. Receives notification that the Add-in is being unloaded. - Describes how the Add-in is being unloaded. - Array of parameters that are host application specific. - - - - Implements the OnAddInsUpdate method of the IDTExtensibility2 interface. Receives notification when the collection of Add-ins has changed. - Array of parameters that are host application specific. - - - - Implements the OnStartupComplete method of the IDTExtensibility2 interface. Receives notification that the host application has completed loading. - Array of parameters that are host application specific. - - - - Implements the OnBeginShutdown method of the IDTExtensibility2 interface. Receives notification that the host application is being unloaded. - Array of parameters that are host application specific. - - - - diff --git a/VSPackageInstall/GlobalSuppressions.cs b/VsDingExtensionProject/GlobalSuppressions.cs similarity index 100% rename from VSPackageInstall/GlobalSuppressions.cs rename to VsDingExtensionProject/GlobalSuppressions.cs diff --git a/VsDingExtensionProject/Guids.cs b/VsDingExtensionProject/Guids.cs new file mode 100644 index 0000000..90438f2 --- /dev/null +++ b/VsDingExtensionProject/Guids.cs @@ -0,0 +1,14 @@ +// Guids.cs +// MUST match guids.h +using System; + +namespace VitaliiGanzha.VsDingExtensionProject +{ + static class GuidList + { + public const string guidVsDingExtensionProjectPkgString = "26ba08d0-0d25-4479-8684-3054dd122876"; + public const string guidVsDingExtensionProjectCmdSetString = "85fa6948-b83a-4626-85da-51b8bb350053"; + + public static readonly Guid guidVsDingExtensionProjectCmdSet = new Guid(guidVsDingExtensionProjectCmdSetString); + }; +} \ No newline at end of file diff --git a/VsDingExtensionProject/Key.snk b/VsDingExtensionProject/Key.snk new file mode 100644 index 0000000000000000000000000000000000000000..6e27b7fc3067a121d6a6aa8128a3b1defa759bbd GIT binary patch literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50098qOAAG`MGpjg{_gei93>H=F06b%`V4K6 zff#F}%_fQUBDAHQO?pQjaVxGp5xJrL1#+uHajRT8D=@V?hH9YDxbqb!>l`mjSI%re zD?Olwl}~axm<>Zbr_3zz=??|o5)&uo0Fl|`!W5`m^Mid7pACelco++Ze5hj$UyYAH zQsR93mZoF4g^XS)a)rA<6d6x#$*UVZ6FPpW+PVEJ#c{jn=Kr;3)i0{;z1sm!z%wEQ zh(Iuz9d_P_P2S4mB9KaU7U{Q1;>XzHrM%d;k&I(A^ii0y#?}QxB@LW76&3 z0f1pX3J8N)Xhj;YWW=zekfB9PV+@&ug46t$aD)IuoV|rWD(Dr{QT(4V@9?Vj2Fqh8?@=FDM?z*)S4@Ek;PV>N(ovuyfO~6{Ww46sLXd7Qp7x<+OWs //------------------------------------------------------------------------------ -namespace VitaliiGanzha.VSPackageInstall { +namespace VitaliiGanzha.VsDingExtensionProject { using System; @@ -39,7 +39,7 @@ namespace VitaliiGanzha.VSPackageInstall { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VitaliiGanzha.VSPackageInstall.Resources", typeof(Resources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VitaliiGanzha.VsDingExtensionProject.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; @@ -60,22 +60,5 @@ namespace VitaliiGanzha.VSPackageInstall { } } - /// - /// Looks up a localized string similar to Can not create tool window.. - /// - internal static string CanNotCreateWindow { - get { - return ResourceManager.GetString("CanNotCreateWindow", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to My Tool Window. - /// - internal static string ToolWindowTitle { - get { - return ResourceManager.GetString("ToolWindowTitle", resourceCulture); - } - } } } diff --git a/VSPackageInstall/Resources.resx b/VsDingExtensionProject/Resources.resx similarity index 96% rename from VSPackageInstall/Resources.resx rename to VsDingExtensionProject/Resources.resx index c89ac58..891c592 100644 --- a/VSPackageInstall/Resources.resx +++ b/VsDingExtensionProject/Resources.resx @@ -126,10 +126,4 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Can not create tool window. - - - VS Ding - \ No newline at end of file diff --git a/VSPackageInstall/Resources/Package.ico b/VsDingExtensionProject/Resources/Package.ico similarity index 100% rename from VSPackageInstall/Resources/Package.ico rename to VsDingExtensionProject/Resources/Package.ico diff --git a/VSPackageInstall/VSPackage.resx b/VsDingExtensionProject/VSPackage.resx similarity index 95% rename from VSPackageInstall/VSPackage.resx rename to VsDingExtensionProject/VSPackage.resx index 18a7594..80ade04 100644 --- a/VSPackageInstall/VSPackage.resx +++ b/VsDingExtensionProject/VSPackage.resx @@ -129,15 +129,12 @@ - VSPackageInstall + VsDingExtensionProject - Visual Studio sound notifications + Information about my package Resources\Package.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - Resources\Images.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - \ No newline at end of file diff --git a/VSPackageInstall/VSPackageInstall.csproj b/VsDingExtensionProject/VsDingExtensionProject.csproj similarity index 86% rename from VSPackageInstall/VSPackageInstall.csproj rename to VsDingExtensionProject/VsDingExtensionProject.csproj index 67a5a9e..23077f0 100644 --- a/VSPackageInstall/VSPackageInstall.csproj +++ b/VsDingExtensionProject/VsDingExtensionProject.csproj @@ -5,17 +5,17 @@ 12.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - + Debug AnyCPU 2.0 - {20191d13-7cc1-4f9b-9cb8-42f22ace4ca6} + {3BEC1E8B-59C5-439E-AE97-8FF4B3E6B0C1} {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} Library Properties - VitaliiGanzha.VSPackageInstall - VSPackageInstall + VitaliiGanzha.VsDingExtensionProject + VsDingExtensionProject True Key.snk v4.5 @@ -51,6 +51,9 @@ true + + ..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\Microsoft.VisualStudio.TestWindow.Interfaces.dll + @@ -63,10 +66,6 @@ - - - - @@ -125,10 +124,6 @@ - - MyControl.xaml - - True @@ -136,10 +131,8 @@ Resources.resx - + - - @@ -160,23 +153,8 @@ - - - Menus.ctmenu - - - - - - - - - - Designer - MSBuild:Compile - true @@ -190,4 +168,4 @@ --> - + \ No newline at end of file diff --git a/VsDingExtensionProject/VsDingExtensionProjectPackage.cs b/VsDingExtensionProject/VsDingExtensionProjectPackage.cs new file mode 100644 index 0000000..82974d4 --- /dev/null +++ b/VsDingExtensionProject/VsDingExtensionProjectPackage.cs @@ -0,0 +1,86 @@ +using System; +using System.Diagnostics; +using System.Globalization; +using System.Runtime.InteropServices; +using System.ComponentModel.Design; +using EnvDTE; +using EnvDTE80; +using Microsoft.Win32; +using Microsoft.VisualStudio; +using Microsoft.VisualStudio.Shell.Interop; +using Microsoft.VisualStudio.OLE.Interop; +using Microsoft.VisualStudio.Shell; + +namespace VitaliiGanzha.VsDingExtensionProject +{ + /// + /// This is the class that implements the package exposed by this assembly. + /// + /// The minimum requirement for a class to be considered a valid package for Visual Studio + /// is to implement the IVsPackage interface and register itself with the shell. + /// This package uses the helper classes defined inside the Managed Package Framework (MPF) + /// to do it: it derives from the Package class that provides the implementation of the + /// IVsPackage interface and uses the registration attributes defined in the framework to + /// register itself and its components with the shell. + /// + // This attribute tells the PkgDef creation utility (CreatePkgDef.exe) that this class is + // a package. + [PackageRegistration(UseManagedResourcesOnly = true)] + // This attribute is used to register the information needed to show this package + // in the Help/About dialog of Visual Studio. + [InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)] + [Guid(GuidList.guidVsDingExtensionProjectPkgString)] + public sealed class VsDingExtensionProjectPackage : Package + { + private DTE2 applicationObject; + private AddIn addInInstance; + + /// + /// Default constructor of the package. + /// 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. + /// + public VsDingExtensionProjectPackage() + { + Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering constructor for: {0}", this.ToString())); + } + + + + ///////////////////////////////////////////////////////////////////////////// + // Overridden Package Implementation + #region Package Members + + /// + /// Initialization of the package; this method is called right after the package is sited, so this is the place + /// where you can put all the initialization code that rely on services provided by VisualStudio. + /// + protected override void Initialize() + { + Debug.WriteLine (string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString())); + base.Initialize(); + + applicationObject = (DTE2)GetService(typeof(DTE)); + + applicationObject.Events.BuildEvents.OnBuildDone += BuildEventsOnOnBuildDone; + applicationObject.Events.DebuggerEvents.OnEnterBreakMode += DebuggerEventsOnOnEnterBreakMode; + + IComponentModel componentModel = Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(SComponentModel)) as IComponentModel; + + } + private void DebuggerEventsOnOnEnterBreakMode(dbgEventReason reason, ref dbgExecutionAction executionAction) + { + System.Media.SystemSounds.Asterisk.Play(); + } + + private void BuildEventsOnOnBuildDone(vsBuildScope scope, vsBuildAction action) + { + System.Media.SystemSounds.Asterisk.Play(); + } + + #endregion + + } +} diff --git a/VSPackageInstall/source.extension.vsixmanifest b/VsDingExtensionProject/source.extension.vsixmanifest similarity index 83% rename from VSPackageInstall/source.extension.vsixmanifest rename to VsDingExtensionProject/source.extension.vsixmanifest index 94e6d18..cb33ea4 100644 --- a/VSPackageInstall/source.extension.vsixmanifest +++ b/VsDingExtensionProject/source.extension.vsixmanifest @@ -1,9 +1,9 @@  - - VSPackageInstall - Visual Studio sound notifications + + VsDingExtensionProject + Information about my package