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
// Instead of writing: | |
// if( a == "abc" || a == "xyz" || a == "123" ) { ... } | |
// if( opt != Options.Opt1 && opt != Options.Opt2 && opt != Options.Opt3 ) { ... } | |
// We can write: | |
// if( a.OneOf("abc", "xyz", 123") ) { ... } | |
// if( opt.NoneOf(Options.Opt1, Options.Opt2, Options.Opt3) ) { ... } | |
public static class ObjectExtensions | |
{ | |
public static bool OneOf<T>(this T self, params T[] values) |
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
Imports System | |
Imports EnvDTE | |
Imports EnvDTE80 | |
Imports EnvDTE90 | |
Imports System.Diagnostics | |
Imports System.Windows | |
Imports Microsoft.Win32 | |
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
Public Sub ImportPresentationMode() | |
DTE.ExecuteCommand("Tools.ImportandExportSettings", "-import:""C:\somepath\Presentation.vssettings""") | |
End Sub | |
Public Sub ImportGenericEnvironment() | |
DTE.ExecuteCommand("Tools.ImportandExportSettings", "-import:""C:\somepath\normal.vssettings""") | |
End Sub |