This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Adapted from http://stackoverflow.com/questions/263400/what-is-the-best-algorithm-for-an-overridden-system-object-gethashcode | |
| namespace Utilities | |
| { | |
| public struct HashCode | |
| { | |
| private readonly int hashCode; | |
| private HashCode(int hashCode) | |
| { | |
| this.hashCode = hashCode; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Runtime.InteropServices; | |
| using System.Threading; | |
| using EnvDTE; | |
| using Microsoft.VisualStudio.TestTools.UnitTesting; | |
| namespace DteTestClassNamespace | |
| { | |
| [TestClass] | |
| public class DteTestClass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| IntPtr hWnd = IntPtr.Zero; | |
| Process currentProcess = Process.GetCurrentProcess(); | |
| Process[] processes = Process.GetProcessesByName(currentProcess.ProcessName); | |
| foreach (Process process in processes) | |
| { | |
| // Get the first instance that is not this instance, has the | |
| // same process name and was started from the same file name | |
| // and location. | |
| // Also check that the process has a valid |
NewerOlder