├── .gitattributes ├── .github └── FUNDING.yml ├── .gitignore ├── .gitmodules ├── .version ├── .vssbe ├── 3rd-party ├── Bridge ├── .version ├── AssemblyInfo.cs ├── Bridge.csproj ├── BuildType.cs ├── Codes.cs ├── Exceptions │ ├── GeneralException.cs │ ├── InitializeException.cs │ ├── InvalidArgumentException.cs │ └── NotFoundException.cs └── IEvent.cs ├── LICENSE ├── README.md ├── VsixLib.targets ├── appveyor-build.bat ├── appveyor-tests.bat ├── build.bat ├── changelog.txt ├── com.github.3F.test.snk ├── com.github.3F.vsce.snk ├── common.props ├── inc ├── modules │ ├── E-MSBuild │ │ └── E-MSBuild.csproj │ ├── LSender │ │ └── LSender.csproj │ ├── SobaScript.Mapper │ │ └── SobaScript.Mapper.csproj │ ├── SobaScript.Z.Core │ │ └── SobaScript.Z.Core.csproj │ ├── SobaScript.Z.Ext │ │ └── SobaScript.Z.Ext.csproj │ ├── SobaScript.Z.VS │ │ └── SobaScript.Z.VS.csproj │ ├── SobaScript │ │ └── SobaScript.csproj │ ├── Varhead │ │ └── Varhead.csproj │ └── common.props └── tests │ ├── E-MSBuildTest │ └── E-MSBuildTest.csproj │ ├── LSender │ ├── DepA │ │ └── DepA.csproj │ ├── DepB │ │ └── DepB.csproj │ ├── DepC │ │ └── DepC.csproj │ ├── LSenderTest │ │ └── LSenderTest.csproj │ └── common.props │ ├── SobaScript.MapperTest │ └── SobaScript.MapperTest.csproj │ ├── SobaScript.Z.CoreTest │ └── SobaScript.Z.CoreTest.csproj │ ├── SobaScript.Z.ExtTest │ └── SobaScript.Z.ExtTest.csproj │ ├── SobaScript.Z.VSTest │ └── SobaScript.Z.VSTest.csproj │ ├── SobaScriptTest │ └── SobaScriptTest.csproj │ ├── VarheadTest │ └── VarheadTest.csproj │ └── common.props ├── media ├── devenv.png └── gif │ └── AboutVS.gif ├── tools ├── gnt.bat ├── hMSBuild.bat ├── netfx4sdk.cmd └── packages.config ├── versions.props ├── vsCommandEvent.sln ├── vsCommandEvent ├── Actions │ ├── ActionAbstract.cs │ ├── ActionCSharp.cs │ ├── ActionEnvCommand.cs │ ├── ActionFile.cs │ ├── ActionInterpreter.cs │ ├── ActionOperation.cs │ ├── ActionScript.cs │ ├── ActionTargets.cs │ ├── Binder.cs │ ├── Command.cs │ ├── DTEOperation.cs │ ├── IAction.cs │ ├── ICommand.cs │ ├── IStatus.cs │ └── Status.cs ├── Bootloader.cs ├── BuildEnv.cs ├── CancelBuildState.cs ├── Config.cs ├── Configuration │ ├── Component.cs │ ├── ContextType.cs │ ├── Header.cs │ ├── IConfig.cs │ ├── IManager.cs │ ├── Manager.cs │ ├── PackerAbstract.cs │ └── User │ │ ├── Cache.cs │ │ ├── Common.cs │ │ ├── Data.cs │ │ ├── Global.cs │ │ ├── HashType.cs │ │ ├── ICacheHeader.cs │ │ ├── ICommon.cs │ │ ├── IData.cs │ │ ├── IDataSvc.cs │ │ ├── IGlobal.cs │ │ ├── IManager.cs │ │ ├── IRoute.cs │ │ ├── IUserValue.cs │ │ ├── LinkType.cs │ │ ├── Manager.cs │ │ ├── Route.cs │ │ └── UserValue.cs ├── DataArgs.cs ├── DteEnv.cs ├── DteSlnCfg.cs ├── EncDetector.cs ├── EnvAbstract.cs ├── Environment.cs ├── EvLevel.cs ├── Events │ ├── AggregatedEventsEnvDte.cs │ ├── CommandEvents │ │ ├── Filter.cs │ │ └── IFilter.cs │ ├── Commands │ │ ├── ICommand.cs │ │ └── ICommandArray.cs │ ├── Event.cs │ ├── EventProcess.cs │ ├── ICommandEvent.cs │ ├── IEventProcess.cs │ ├── IMode.cs │ ├── IModeCSharp.cs │ ├── IModeEnvCommand.cs │ ├── IModeFile.cs │ ├── IModeInterpreter.cs │ ├── IModeOperation.cs │ ├── IModeScript.cs │ ├── IModeTargets.cs │ ├── ISolutionEvent.cs │ ├── ISolutionEventOWP.cs │ ├── Mapping │ │ └── Json │ │ │ └── ModeCommand.cs │ ├── ModeCSharp.cs │ ├── ModeEnvCommand.cs │ ├── ModeFile.cs │ ├── ModeInterpreter.cs │ ├── ModeOperation.cs │ ├── ModeScript.cs │ ├── ModeTargets.cs │ ├── ModeType.cs │ ├── OWP │ │ ├── ComparisonType.cs │ │ ├── Condition.cs │ │ └── IMatching.cs │ ├── SolutionEventType.cs │ └── Types │ │ ├── Command.cs │ │ └── CommandDte.cs ├── Exceptions │ ├── CompilerException.cs │ └── UnspecSBEException.cs ├── Extensions │ ├── ArrayExtension.cs │ ├── IVsHierarchyExtension.cs │ ├── ObjectExtension.cs │ ├── ProjectExtension.cs │ └── StringExtension.cs ├── GAC.cs ├── GuidList.cs ├── IAppSettings.cs ├── IEnvironment.cs ├── IEnvironmentExt.cs ├── IEvLevel.cs ├── IOW.cs ├── IPkg.cs ├── ISolutionEvents.cs ├── IsolatedEnv.cs ├── JsonSerializationBinder.cs ├── LICENSE.vsixinfo ├── Log.cs ├── Logger │ ├── ILog.cs │ ├── Initializer.cs │ └── MessageArgs.cs ├── MSBuild.cs ├── MainToolCommand.cs ├── OW.cs ├── OwpEnv.cs ├── ParamPacker.cs ├── Pkg.cs ├── Pkg.vsct ├── PkgCmdID.cs ├── Properties │ └── AssemblyInfo.cs ├── Receiver │ └── Output │ │ ├── EWType.cs │ │ ├── IItem.cs │ │ ├── IItemEW.cs │ │ ├── IItems.cs │ │ ├── Ident.cs │ │ ├── ItemEW.cs │ │ ├── ItemType.cs │ │ ├── Items.cs │ │ ├── Matcher.cs │ │ ├── OWP.cs │ │ └── PaneArgs.cs ├── Resources │ ├── License.md │ ├── Package.ico │ ├── Package.png │ ├── Package_16.png │ ├── Package_32.ico │ ├── Settings_16.png │ ├── bug.png │ ├── cfg_exclamation.png │ ├── components │ │ ├── alias.png │ │ ├── definition.png │ │ ├── function.png │ │ ├── package.png │ │ └── property.png │ ├── help-16.png │ ├── lightning.png │ ├── preview.png │ ├── separator-horizontal.png │ ├── toggle-16.png │ └── vsmenu_unwarn.png ├── Settings.cs ├── SobaScript │ └── Components │ │ ├── DteComponent.cs │ │ ├── IDteCeEnv.cs │ │ └── InternalComponent.cs ├── SolutionEvents.cs ├── SzArchiver.cs ├── UI │ ├── EnumDecor.cs │ ├── ITransfer.cs │ ├── Resource.Designer.cs │ ├── Resource.resx │ ├── Util.cs │ └── WForms │ │ ├── AboutFrm.Designer.cs │ │ ├── AboutFrm.cs │ │ ├── AboutFrm.resx │ │ ├── Components │ │ └── DataGridViewExt.cs │ │ ├── ComponentsFrm.Designer.cs │ │ ├── ComponentsFrm.cs │ │ ├── ComponentsFrm.resx │ │ ├── Controls │ │ ├── CompletionData.cs │ │ ├── DomIcon.Designer.cs │ │ ├── DomIcon.resx │ │ ├── FileTextBox.Designer.cs │ │ ├── FileTextBox.cs │ │ ├── FileTextBox.resx │ │ ├── Lights.Designer.cs │ │ ├── Lights.cs │ │ ├── Lights.resx │ │ ├── TextEditor.Designer.cs │ │ ├── TextEditor.cs │ │ ├── TextEditor.resx │ │ └── TextEditorElements │ │ │ ├── BraceFoldingStrategy.cs │ │ │ ├── HighlightBracesRenderer.cs │ │ │ └── SimilarWordsRenderer.cs │ │ ├── DTECheckFrm.Designer.cs │ │ ├── DTECheckFrm.cs │ │ ├── DTECheckFrm.resx │ │ ├── DTECommandsFrm.Designer.cs │ │ ├── DTECommandsFrm.cs │ │ ├── DTECommandsFrm.resx │ │ ├── EnvDteSniffer.Designer.cs │ │ ├── EnvDteSniffer.cs │ │ ├── EnvDteSniffer.resx │ │ ├── EventsFrm.Designer.cs │ │ ├── EventsFrm.cs │ │ ├── EventsFrm.resx │ │ ├── Logic │ │ ├── Events.cs │ │ ├── RestoreData.cs │ │ └── SBEWrap.cs │ │ ├── PropertiesFrm.Designer.cs │ │ ├── PropertiesFrm.cs │ │ ├── PropertiesFrm.resx │ │ ├── PropertyCheckFrm.Designer.cs │ │ ├── PropertyCheckFrm.cs │ │ ├── PropertyCheckFrm.resx │ │ ├── ScriptCheckFrm.Designer.cs │ │ ├── ScriptCheckFrm.cs │ │ ├── ScriptCheckFrm.resx │ │ └── Wizards │ │ ├── Version │ │ ├── Fields.cs │ │ ├── GenType.cs │ │ ├── IStep.cs │ │ ├── Manager.cs │ │ ├── Resource.Designer.cs │ │ ├── Resource.resx │ │ ├── RevNumber │ │ │ ├── DeltaTime.cs │ │ │ ├── IRevNumber.cs │ │ │ ├── Raw.cs │ │ │ └── Type.cs │ │ ├── StepCfgData.cs │ │ ├── StepFields.cs │ │ ├── StepFinal.cs │ │ ├── StepGen.cs │ │ ├── StepRepl.cs │ │ ├── StepStruct.cs │ │ └── StepsType.cs │ │ ├── VersionFrm.Designer.cs │ │ ├── VersionFrm.cs │ │ └── VersionFrm.resx ├── UnifiedTypes │ ├── Build │ │ └── VSCommand.cs │ └── DTEC.cs ├── UserConfig.cs ├── VSPackage.Designer.cs ├── VSPackage.resx ├── VSTools │ ├── ErrorList │ │ ├── IPane.cs │ │ └── Pane.cs │ └── OW │ │ ├── IPane.cs │ │ ├── PaneCOM.cs │ │ └── PaneDTE.cs ├── app.config ├── sdk10.vsixmanifest ├── sdk15.vsixmanifest ├── sdk17.vsixmanifest ├── vsCommandEvent.csproj └── xshd │ ├── CSharpLang.xshd │ ├── CppLang.xshd │ ├── FilesMode.xshd │ ├── InterpreterMode.xshd │ ├── MSBuildTargets.xshd │ ├── OperationMode.xshd │ ├── SBEScripts.xshd │ ├── XshdResource.Designer.cs │ └── XshdResource.resx └── vsCommandEventTest ├── Actions └── DTEOperationTest.cs ├── AssemblyInfo.cs ├── MSBuild └── ParserTest.cs ├── Receiver └── Output │ ├── BuildItemTest.cs │ └── MatcherTest.cs ├── SobaAcs.cs ├── SobaScript └── Components │ └── InternalComponentTest.cs ├── StubEnv.cs ├── TempFile.cs ├── app.config └── vsCommandEventTest.csproj /.gitattributes: -------------------------------------------------------------------------------- 1 | 2 | # Our batch files requires CRLF for correct work. 3 | # https://github.com/3F/hMSBuild/issues/2 4 | 5 | *.bat text eol=crlf 6 | *.cmd text eol=crlf 7 | *.tpl text eol=crlf 8 | 9 | # https://github.com/3F/vsSolutionBuildEvent/releases/tag/1.14.1 10 | 11 | *.resx text eol=crlf 12 | *.vsixinfo text eol=crlf -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # ____ 2 | # /___/|\ 3 | # `~|___| ! With open love to open source. 4 | # /___/ \; Yours, github.com/3F 5 | # 6 | 7 | custom: ['3F.github.io/Donation'] 8 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "MvsSln"] 2 | path = MvsSln 3 | url = https://github.com/3F/MvsSln.git 4 | [submodule "E-MSBuild"] 5 | path = E-MSBuild 6 | url = https://github.com/3F/E-MSBuild.git 7 | [submodule "SobaScript"] 8 | path = SobaScript 9 | url = https://github.com/3F/SobaScript.git 10 | [submodule "SobaScript.Z.Core"] 11 | path = SobaScript.Z.Core 12 | url = https://github.com/3F/SobaScript.Z.Core.git 13 | [submodule "SobaScript.Z.Ext"] 14 | path = SobaScript.Z.Ext 15 | url = https://github.com/3F/SobaScript.Z.Ext.git 16 | [submodule "SobaScript.Z.VS"] 17 | path = SobaScript.Z.VS 18 | url = https://github.com/3F/SobaScript.Z.VS.git 19 | [submodule "Varhead"] 20 | path = Varhead 21 | url = https://github.com/3F/Varhead.git 22 | [submodule "LSender"] 23 | path = LSender 24 | url = https://github.com/3F/LSender.git 25 | [submodule "SobaScript.Mapper"] 26 | path = SobaScript.Mapper 27 | url = https://github.com/3F/SobaScript.Mapper.git 28 | -------------------------------------------------------------------------------- /.version: -------------------------------------------------------------------------------- 1 | 1.4.0 -------------------------------------------------------------------------------- /3rd-party: -------------------------------------------------------------------------------- 1 | vsCommandEvent - https://github.com/3F/vsCommandEvent 2 | - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 | 4 | # Third-party software components 5 | 6 | ## vsCommandEvent and its various packages may* include or reference: 7 | (*- specific target platforms or some complex archives) 8 | 9 | * SobaScript (github.com/3F/SobaScript) 10 | * Core Components (github.com/3F/SobaScript.Z.Core) 11 | * Ext Components (github.com/3F/SobaScript.Z.Ext) 12 | * VS Components (github.com/3F/SobaScript.Z.VS) 13 | 14 | * E-MSBuild (github.com/3F/E-MSBuild) 15 | * Varhead (github.com/3F/Varhead) 16 | 17 | * AvalonEdit (avalonedit.net) 18 | * Json.NET (json.codeplex.com) 19 | * NLog (nlog-project.org) 20 | * Ude (code.google.com/p/ude/) 21 | * SevenZipSharp (sevenzipsharp.codeplex.com) 22 | * 7-Zip (www.7-zip.org) 23 | * GetNuTool (github.com/3F/GetNuTool) 24 | 25 | ## Dev Dependencies includes the following tools for src 26 | 27 | * Moq (www.moqthis.com) 28 | * GetNuTool (github.com/3F/GetNuTool) 29 | * vsSolutionBuildEvent (github.com/3F/vsSolutionBuildEvent) 30 | * hMSBuild (github.com/3F/hMSBuild) 31 | * netfx4sdk (github.com/3F/netfx4sdk) 32 | 33 | 34 | ## Additional packages 35 | 36 | Additional packages like NuGet packages (.nupkg) also may include files that are distributed under the following licenses and permits: 37 | 38 | * MICROSOFT VISUAL STUDIO SOFTWARE DEVELOPMENT KIT: 39 | see accompanying file EULA.html or here: 40 | 41 | * https://www.visualstudio.com/en-us/support/legal/mt171586 42 | * http://go.microsoft.com/fwlink/?LinkID=614949 43 | 44 | 45 | * MICROSOFT .NET LIBRARIES: 46 | see accompanying file dotnet_library_license.htm or here https://www.microsoft.com/net/dotnet_library_license.htm 47 | 48 | 49 | ## Resources 50 | 51 | About graphical resources see /Resources/License -------------------------------------------------------------------------------- /Bridge/.version: -------------------------------------------------------------------------------- 1 | 0.1 -------------------------------------------------------------------------------- /Bridge/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | [assembly: ComVisible(false)] 4 | 5 | [assembly: Guid("5DDF8018-6651-421E-9B70-26D0DB76498F")] -------------------------------------------------------------------------------- /Bridge/Bridge.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | $([System.IO.File]::ReadAllText("$(MSBuildProjectDirectory)\.version")) 6 | vsCommandEvent.Bridge 7 | net.r_eg.vsCE.Bridge 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | ..\packages\vsSBE.SDK.$(vsSBE_SDK)\lib\$(Sdk10libTarget)\Microsoft.VisualStudio.Shell.Interop.dll 21 | True 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Bridge/Codes.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | namespace net.r_eg.vsCE.Bridge 9 | { 10 | /// 11 | /// Represents a different codes for our library 12 | /// 13 | internal sealed class Codes 14 | { 15 | /// 16 | /// Unspecified Success operation 17 | /// 18 | public const int Success = 0; 19 | 20 | /// 21 | /// Unspecified Failed operation 22 | /// 23 | public const int Failed = 1; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Bridge/Exceptions/GeneralException.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | 10 | namespace net.r_eg.vsCE.Bridge.Exceptions 11 | { 12 | [Serializable] 13 | public class GeneralException: NotSupportedException 14 | { 15 | public GeneralException() 16 | { 17 | 18 | } 19 | 20 | public GeneralException(string message) 21 | : base(message) 22 | { 23 | 24 | } 25 | 26 | public GeneralException(string message, Exception innerException) 27 | : base(message, innerException) 28 | { 29 | 30 | } 31 | 32 | public GeneralException(string message, params object[] args) 33 | : base(format(ref message, args)) 34 | { 35 | 36 | } 37 | 38 | public GeneralException(string message, Exception innerException, params object[] args) 39 | : base(format(ref message, args), innerException) 40 | { 41 | 42 | } 43 | 44 | protected static string format(ref string message, params object[] args) 45 | { 46 | return String.Format(message, args); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Bridge/Exceptions/InitializeException.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | 10 | namespace net.r_eg.vsCE.Bridge.Exceptions 11 | { 12 | [Serializable] 13 | public class InitializeException: GeneralException 14 | { 15 | public InitializeException(string message) 16 | : base(message) 17 | { 18 | 19 | } 20 | 21 | public InitializeException(string message, params object[] args) 22 | : base(message, args) 23 | { 24 | 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Bridge/Exceptions/InvalidArgumentException.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | 10 | namespace net.r_eg.vsCE.Bridge.Exceptions 11 | { 12 | [Serializable] 13 | public class InvalidArgumentException: GeneralException 14 | { 15 | public InvalidArgumentException(string message) 16 | : base(message) 17 | { 18 | 19 | } 20 | 21 | public InvalidArgumentException(string message, params object[] args) 22 | : base(message, args) 23 | { 24 | 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Bridge/Exceptions/NotFoundException.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | 10 | namespace net.r_eg.vsCE.Bridge.Exceptions 11 | { 12 | [Serializable] 13 | public class NotFoundException: GeneralException 14 | { 15 | public NotFoundException(string message) 16 | : base(message) 17 | { 18 | 19 | } 20 | 21 | public NotFoundException(string message, params object[] args) 22 | : base(message, args) 23 | { 24 | 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Bridge/IEvent.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace net.r_eg.vsCE.Bridge 12 | { 13 | [Guid("F9BF1346-3701-43A0-92D7-828B1112B63C")] 14 | public interface IEvent 15 | { 16 | /// 17 | /// Solution has been opened. 18 | /// 19 | /// Reserved for future use. 20 | /// true if the solution is being created. false if the solution was created previously or is being loaded. 21 | /// If the method succeeds, it returns VSConstants.S_OK. If it fails, it returns an error code. 22 | int solutionOpened(object pUnkReserved, int fNewSolution); 23 | 24 | /// 25 | /// Solution has been closed. 26 | /// 27 | /// Reserved for future use. 28 | /// If the method succeeds, it returns VSConstants.S_OK. If it fails, it returns an error code. 29 | int solutionClosed(object pUnkReserved); 30 | 31 | /// 32 | /// Before executing Command ID for EnvDTE. 33 | /// 34 | /// The GUID. 35 | /// The command ID. 36 | /// Custom input parameters. 37 | /// Custom output parameters. 38 | /// Whether the command has been cancelled. 39 | /// If the method succeeds, it returns VSConstants.S_OK. If it fails, it returns an error code. 40 | int onCommandDtePre(string guid, int id, object customIn, object customOut, ref bool cancelDefault); 41 | 42 | /// 43 | /// After executed Command ID for EnvDTE. 44 | /// 45 | /// The GUID. 46 | /// The command ID. 47 | /// Custom input parameters. 48 | /// Custom output parameters. 49 | /// If the method succeeds, it returns VSConstants.S_OK. If it fails, it returns an error code. 50 | int onCommandDtePost(string guid, int id, object customIn, object customOut); 51 | 52 | /// 53 | /// During assembly. 54 | /// 55 | /// Raw data of building process 56 | /// Guid string of pane 57 | /// Name of item pane 58 | void onBuildRaw(string data, string guid, string item); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /VsixLib.targets: -------------------------------------------------------------------------------- 1 |  2 | 14 | 15 | 16 | 17 | <_SDK_Lib>$(SolutionDir)packages\vsSBE.SDK.$(vsSBE_SDK)\lib\$(SdklibTarget) 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /appveyor-build.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | setlocal 4 | cd tools 5 | call netfx4sdk -mode sys 6 | endlocal 7 | 8 | build %* -------------------------------------------------------------------------------- /appveyor-tests.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo Usage: %~nx0 [configuration name or nothing to test all] 3 | 4 | set "cfg=%~1" 5 | set ciLogger=Appveyor.TestLogger -Version 2.0.0 6 | set tcmd=dotnet test --no-build --no-restore --test-adapter-path:. --logger:Appveyor 7 | 8 | :::::::::::::::::::: 9 | 10 | setlocal 11 | cd vsCommandEventTest 12 | nuget install %ciLogger% 13 | endlocal 14 | 15 | if not defined cfg ( 16 | 17 | call %tcmd% -c REL_SDK10 vsCommandEventTest 18 | call %tcmd% -c REL_SDK15 vsCommandEventTest 19 | call %tcmd% -c REL_SDK17 vsCommandEventTest 20 | 21 | ) else ( 22 | call %tcmd% -c %cfg% vsCommandEventTest 23 | ) 24 | 25 | exit /B 0 26 | 27 | :err 28 | echo. Build failed. 1>&2 29 | exit /B 1 -------------------------------------------------------------------------------- /build.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo Usage: %~nx0 [RCI flag] [configuration name or nothing to build all] 3 | echo DBG == Debug; REL == Release; + _SDK10/15/17 4 | if "%~1"=="RCI" ( set "IsRCI=1" & set "cfg=%~2" ) else ( set "IsRCI=" & set "cfg=%~1" ) 5 | 6 | :::::::::::::::::::: 7 | set __p_call=1 8 | call tools\gnt /p:ngconfig="tools/packages.config" || goto err 9 | 10 | set bnode=packages\vsSolutionBuildEvent\cim.cmd -vsw-priority Microsoft.NetCore.Component.SDK /m:7 /v:m /p:Platform="Any CPU" 11 | if not defined cfg ( 12 | 13 | call %bnode% /p:Configuration=REL_SDK10 || goto err 14 | call %bnode% /p:Configuration=REL_SDK15 || goto err 15 | call %bnode% /p:Configuration=REL_SDK17 || goto err 16 | 17 | ) else call %bnode% /p:Configuration=%cfg% || goto err 18 | 19 | exit /B 0 20 | 21 | :err 22 | echo. Failed. 1>&2 23 | exit /B 1 -------------------------------------------------------------------------------- /com.github.3F.test.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3F/vsCommandEvent/99bba678a94396df59a540f8286995613de64240/com.github.3F.test.snk -------------------------------------------------------------------------------- /com.github.3F.vsce.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3F/vsCommandEvent/99bba678a94396df59a540f8286995613de64240/com.github.3F.vsce.snk -------------------------------------------------------------------------------- /inc/modules/E-MSBuild/E-MSBuild.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | net.r_eg.EvMSBuild 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /inc/modules/LSender/LSender.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | net.r_eg.LSender 8 | LSR_FEATURE_S_VECTOR;$(DefineConstants) 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /inc/modules/SobaScript.Mapper/SobaScript.Mapper.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | net.r_eg.SobaScript.Mapper 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /inc/modules/SobaScript.Z.Core/SobaScript.Z.Core.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | net.r_eg.SobaScript.Z.Core 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /inc/modules/SobaScript.Z.Ext/SobaScript.Z.Ext.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | net.r_eg.SobaScript.Z.Ext 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /inc/modules/SobaScript.Z.VS/SobaScript.Z.VS.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | net.r_eg.SobaScript.Z.VS 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /inc/modules/SobaScript/SobaScript.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | net.r_eg.SobaScript 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /inc/modules/Varhead/Varhead.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | net.r_eg.Varhead 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /inc/modules/common.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | ..\..\..\ 4 | 5 | 6 | 7 | ..\bin\$(MSBuildProjectName)\ 8 | ..\obj\$(MSBuildProjectName)\ 9 | false 10 | 11 | 12 | 13 | netstandard2.0;net40 14 | true 15 | $(RepoDirRoot)com.github.3F.vsce.snk 16 | false 17 | Copyright (c) 2015-2021 Denis Kuzmin <x-3F@outlook.com> github/3F 18 | 19 | DBG_SDK10;REL_SDK10;DBG_SDK15;REL_SDK15;DBG_SDK17;REL_SDK17 20 | $(Configurations) 21 | 1701;1702;CS1591 22 | latest 23 | false 24 | 25 | 26 | 27 | DEBUG;TRACE;$(DefineConstants) 28 | true 29 | full 30 | false 31 | 32 | 33 | 34 | pdbonly 35 | true 36 | 37 | 38 | 39 | true 40 | 41 | 42 | -------------------------------------------------------------------------------- /inc/tests/E-MSBuildTest/E-MSBuildTest.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | EvMSBuildTest 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /inc/tests/LSender/DepA/DepA.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /inc/tests/LSender/DepB/DepB.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /inc/tests/LSender/DepC/DepC.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /inc/tests/LSender/LSenderTest/LSenderTest.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | LSR_FEATURE_S_VECTOR;$(DefineConstants) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /inc/tests/LSender/common.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ..\$(RepoDirRoot) 6 | ..\$(IncModulesDir) 7 | ..\$(AssemblyOriginatorKeyFile) 8 | 9 | 10 | -------------------------------------------------------------------------------- /inc/tests/SobaScript.MapperTest/SobaScript.MapperTest.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /inc/tests/SobaScript.Z.CoreTest/SobaScript.Z.CoreTest.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /inc/tests/SobaScript.Z.ExtTest/SobaScript.Z.ExtTest.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /inc/tests/SobaScript.Z.VSTest/SobaScript.Z.VSTest.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | $(RepoDirRoot)SobaScript.Z.VS\SobaScript.Z.VSTest\key.snk 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /inc/tests/SobaScriptTest/SobaScriptTest.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /inc/tests/VarheadTest/VarheadTest.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /inc/tests/common.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ..\..\..\ 6 | ..\..\modules\ 7 | 8 | 9 | 10 | ..\bin\$(MSBuildProjectName)\ 11 | ..\obj\$(MSBuildProjectName)\ 12 | false 13 | 14 | 15 | 16 | netcoreapp3.1 17 | false 18 | true 19 | $(RepoDirRoot)com.github.3F.test.snk 20 | false 21 | DBG_SDK10;REL_SDK10;DBG_SDK15;REL_SDK15;DBG_SDK17;REL_SDK17 22 | $(Configurations) 23 | 1701;1702;CS1591 24 | latest 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /media/devenv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3F/vsCommandEvent/99bba678a94396df59a540f8286995613de64240/media/devenv.png -------------------------------------------------------------------------------- /media/gif/AboutVS.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3F/vsCommandEvent/99bba678a94396df59a540f8286995613de64240/media/gif/AboutVS.gif -------------------------------------------------------------------------------- /tools/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /vsCommandEvent/Actions/ActionFile.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using net.r_eg.vsCE.Events; 9 | 10 | namespace net.r_eg.vsCE.Actions 11 | { 12 | /// 13 | /// Action for Files Mode 14 | /// 15 | public class ActionFile: ActionAbstract, IAction 16 | { 17 | /// 18 | /// Process for specified event. 19 | /// 20 | /// Configured event. 21 | /// Result of handling. 22 | public override bool process(ISolutionEvent evt) 23 | { 24 | string cFiles = ((IModeFile)evt.Mode).Command; 25 | 26 | cFiles = parse(evt, cFiles); 27 | shell(evt, treatNewlineAs(" & ", cFiles)); 28 | 29 | return true; 30 | } 31 | 32 | /// 33 | public ActionFile(ICommand cmd) 34 | : base(cmd) 35 | { 36 | 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vsCommandEvent/Actions/ActionInterpreter.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using net.r_eg.vsCE.Events; 9 | using net.r_eg.vsCE.Exceptions; 10 | 11 | namespace net.r_eg.vsCE.Actions 12 | { 13 | /// 14 | /// Action for Interpreter Mode 15 | /// 16 | public class ActionInterpreter: ActionAbstract, IAction 17 | { 18 | /// 19 | /// Process for specified event. 20 | /// 21 | /// Configured event. 22 | /// Result of handling. 23 | public override bool process(ISolutionEvent evt) 24 | { 25 | if(((IModeInterpreter)evt.Mode).Handler.Trim().Length < 1) { 26 | throw new CompilerException("Interpreter: Handler is empty or not selected."); 27 | } 28 | 29 | string script = ((IModeInterpreter)evt.Mode).Command; 30 | string wrapper = ((IModeInterpreter)evt.Mode).Wrapper; 31 | 32 | script = parse(evt, script); 33 | script = treatNewlineAs(((IModeInterpreter)evt.Mode).Newline, script); 34 | 35 | switch(wrapper.Length) { 36 | case 1: { 37 | script = string.Format("{0}{1}{0}", wrapper, script.Replace(wrapper, "\\" + wrapper)); 38 | break; 39 | } 40 | case 2: { 41 | //pair as: (), {}, [] ... 42 | //e.g.: (echo str&echo.&echo str) >> out 43 | string wL = wrapper[0].ToString(); 44 | string wR = wrapper[1].ToString(); 45 | script = string.Format("{0}{1}{2}", wL, script.Replace(wL, "\\" + wL).Replace(wR, "\\" + wR), wR); 46 | break; 47 | } 48 | } 49 | 50 | string handler = ((IModeInterpreter)evt.Mode).Handler; 51 | if(evt.SupportMSBuild) { 52 | handler = cmd.MSBuild.Eval(handler); 53 | } 54 | 55 | shell(evt, string.Format("{0} {1}", handler, script)); 56 | return true; 57 | } 58 | 59 | /// 60 | public ActionInterpreter(ICommand cmd) 61 | : base(cmd) 62 | { 63 | 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /vsCommandEvent/Actions/ActionOperation.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using net.r_eg.vsCE.Events; 9 | using ECommand = net.r_eg.vsCE.Events.Types.Command; 10 | 11 | namespace net.r_eg.vsCE.Actions 12 | { 13 | /// 14 | /// Action for Operation Mode 15 | /// 16 | public class ActionOperation: ActionAbstract, IAction 17 | { 18 | /// 19 | /// Process for specified event. 20 | /// 21 | /// Configured event. 22 | /// Result of handling. 23 | public override bool process(ISolutionEvent evt) 24 | { 25 | IModeOperation operation = (IModeOperation)evt.Mode; 26 | if(operation.Command == null || operation.Command.Length < 1) { 27 | return true; 28 | } 29 | DTEOperation dteo = new DTEOperation(cmd.Env, cmd.EventType); 30 | 31 | if(!evt.SupportMSBuild && !evt.SupportSBEScripts) { 32 | dteo.exec(operation.Command, operation.AbortOnFirstError); 33 | return true; 34 | } 35 | 36 | // need evaluation for data 37 | 38 | ECommand[] parsed = new ECommand[operation.Command.Length]; 39 | for(int i = 0; i < operation.Command.Length; ++i) 40 | { 41 | parsed[i].name = parse(evt, operation.Command[i].name); 42 | parsed[i].args = parse(evt, operation.Command[i].args); 43 | } 44 | 45 | dteo.exec(parsed, operation.AbortOnFirstError); 46 | return true; 47 | } 48 | 49 | /// 50 | public ActionOperation(ICommand cmd) 51 | : base(cmd) 52 | { 53 | 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /vsCommandEvent/Actions/ActionScript.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using net.r_eg.vsCE.Events; 9 | 10 | namespace net.r_eg.vsCE.Actions 11 | { 12 | /// 13 | /// Action for Script Mode 14 | /// 15 | public class ActionScript: ActionAbstract, IAction 16 | { 17 | /// 18 | /// Process for specified event. 19 | /// 20 | /// Configured event. 21 | /// Result of handling. 22 | public override bool process(ISolutionEvent evt) 23 | { 24 | parse(evt, ((IModeScript)evt.Mode).Command); 25 | return true; 26 | } 27 | 28 | /// 29 | public ActionScript(ICommand cmd) 30 | : base(cmd) 31 | { 32 | 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vsCommandEvent/Actions/IAction.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System.Runtime.InteropServices; 9 | using net.r_eg.vsCE.Events; 10 | 11 | namespace net.r_eg.vsCE.Actions 12 | { 13 | [Guid("3DA65163-3C80-4F75-BDFA-BFA5C1865128")] 14 | public interface IAction 15 | { 16 | /// 17 | /// Process for specified event. 18 | /// 19 | /// Configured event. 20 | /// Result of handling. 21 | bool process(ISolutionEvent evt); 22 | 23 | /// 24 | /// Access to shell for event data. 25 | /// 26 | /// Configured event. 27 | /// Formatted command to shell. 28 | void shell(ISolutionEvent evt, string cmd); 29 | 30 | /// 31 | /// Access to parsers for event data. 32 | /// 33 | /// Configured event. 34 | /// Data to analysing. 35 | /// Parsed data. 36 | string parse(ISolutionEvent evt, string data); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vsCommandEvent/Actions/ICommand.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System.Runtime.InteropServices; 9 | using net.r_eg.EvMSBuild; 10 | using net.r_eg.SobaScript; 11 | using net.r_eg.vsCE.Events; 12 | 13 | namespace net.r_eg.vsCE.Actions 14 | { 15 | [Guid("8E774159-2221-4435-A6C9-A40B78A369FD")] 16 | public interface ICommand 17 | { 18 | /// 19 | /// SBE-Scripts core 20 | /// 21 | ISobaScript SBEScript { get; } 22 | 23 | /// 24 | /// MSBuild core 25 | /// 26 | IEvMSBuild MSBuild { get; } 27 | 28 | /// 29 | /// Used environment 30 | /// 31 | IEnvironment Env { get; } 32 | 33 | /// 34 | /// Specified Event type. 35 | /// 36 | SolutionEventType EventType { get; } 37 | 38 | /// 39 | /// Find and execute action by specified event. 40 | /// 41 | /// Configured event. 42 | /// The type of event. 43 | /// true value if it was handled. 44 | bool exec(ISolutionEvent evt, SolutionEventType type); 45 | 46 | /// 47 | /// Find and execute action with default event type. 48 | /// 49 | /// Configured event. 50 | /// true value if it was handled. 51 | bool exec(ISolutionEvent evt); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vsCommandEvent/CancelBuildState.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | namespace net.r_eg.vsCE 9 | { 10 | internal sealed class CancelBuildState 11 | { 12 | /// 13 | /// Actual state for VS API. 14 | /// 15 | public int CanceledInt => Canceled ? 1 : 0; 16 | 17 | /// 18 | /// Actual state. 19 | /// 20 | public bool Canceled { get; private set; } 21 | 22 | public void Cancel() => Canceled = true; 23 | 24 | public void Reset() => Canceled = false; 25 | 26 | public bool UpdateFlagIfCanceled(ref int flag) 27 | { 28 | if(Canceled) 29 | { 30 | Log.Debug($"Canceled operation due to {nameof(CancelBuildState)} -> {flag}"); 31 | flag = CanceledInt; 32 | } 33 | return Canceled; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vsCommandEvent/Configuration/Component.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | namespace net.r_eg.vsCE.Configuration 9 | { 10 | /// 11 | /// Configure existing components 12 | /// 13 | public class Component 14 | { 15 | /// 16 | /// Identification by class name 17 | /// 18 | public string ClassName 19 | { 20 | get; 21 | set; 22 | } 23 | 24 | /// 25 | /// Activation status 26 | /// 27 | public bool Enabled 28 | { 29 | get; 30 | set; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vsCommandEvent/Configuration/ContextType.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace net.r_eg.vsCE.Configuration 12 | { 13 | [Guid("A55E2432-81B0-407E-B3B2-29958D76B09A")] 14 | public enum ContextType 15 | { 16 | /// 17 | /// Common configuration. 18 | /// 19 | Common, 20 | 21 | /// 22 | /// Configuration of specific solution. 23 | /// 24 | Solution, 25 | 26 | /// 27 | /// Unspecified static configuration. 28 | /// 29 | Static, 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vsCommandEvent/Configuration/Header.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | namespace net.r_eg.vsCE.Configuration 9 | { 10 | public class Header 11 | { 12 | public string[] _ => new string[] 13 | { 14 | " This file for vsCommandEvent ", 15 | " https://github.com/3F/vsCommandEvent " 16 | }; 17 | 18 | public string Compatibility { get; set; } = "1.0"; 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vsCommandEvent/Configuration/IConfig.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace net.r_eg.vsCE.Configuration 12 | { 13 | [Guid("5ED372D0-2585-4B87-95DB-C356B5B266D6")] 14 | public interface IConfig 15 | { 16 | /// 17 | /// When data is updated. 18 | /// 19 | event EventHandler> Updated; 20 | 21 | /// 22 | /// User data at runtime. 23 | /// 24 | T Data { get; } 25 | 26 | /// 27 | /// Link to configuration file. 28 | /// 29 | string Link { get; } 30 | 31 | /// 32 | /// Get status of configuration data. 33 | /// true value if data exists only in RAM, otherwise used existing file. 34 | /// 35 | bool InRAM { get; } 36 | 37 | /// 38 | /// Load settings from file. 39 | /// 40 | /// Path to configuration file. 41 | /// Special version of configuration file. 42 | /// true value if loaded from existing file, otherwise loaded as new. 43 | bool load(string path, string prefix); 44 | 45 | /// 46 | /// Load settings from other object. 47 | /// 48 | /// Object with configuration. 49 | void load(T data); 50 | 51 | /// 52 | /// Use link from other configuration for loading new settings. 53 | /// 54 | /// Link from other configuration. 55 | /// true value if loaded from existing file, otherwise loaded as new. 56 | bool load(string link); 57 | 58 | /// 59 | /// Load settings from file with path by default. 60 | /// 61 | /// true value if loaded from existing file, otherwise loaded as new. 62 | bool load(); 63 | 64 | /// 65 | /// Save settings. 66 | /// 67 | void save(); 68 | 69 | /// 70 | /// Unload User data. 71 | /// 72 | void unload(); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /vsCommandEvent/Configuration/User/Cache.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | namespace net.r_eg.vsCE.Configuration.User 9 | { 10 | public class Cache: ICacheHeader 11 | { 12 | /// 13 | /// When has been updated. 14 | /// UTC as a rule. 15 | /// 16 | public long Updated 17 | { 18 | get; 19 | set; 20 | } 21 | 22 | /// 23 | /// Type of hashing. 24 | /// 25 | public HashType Algorithm 26 | { 27 | get; 28 | set; 29 | } 30 | 31 | /// 32 | /// Hash value of data. 33 | /// 34 | public string Hash 35 | { 36 | get; 37 | set; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vsCommandEvent/Configuration/User/Common.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | namespace net.r_eg.vsCE.Configuration.User 9 | { 10 | public class Common: ICommon 11 | { 12 | /// 13 | /// Word wrapping for main editor. 14 | /// 15 | public bool WordWrap 16 | { 17 | get { return wordWrap; } 18 | set { wordWrap = value; } 19 | } 20 | private bool wordWrap = true; 21 | 22 | /// 23 | /// Value of zooming for main editor. 24 | /// 25 | public int Zoomed 26 | { 27 | get { return zoomed; } 28 | set { zoomed = value; } 29 | } 30 | private int zoomed = 100; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vsCommandEvent/Configuration/User/Global.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System.Collections.Generic; 9 | 10 | namespace net.r_eg.vsCE.Configuration.User 11 | { 12 | public class Global: IGlobal 13 | { 14 | /// 15 | public bool DebugMode { get; set; } 16 | 17 | /// 18 | /// Flag of ignoring configuration. 19 | /// 20 | public bool IgnoreConfiguration 21 | { 22 | get; 23 | set; 24 | } 25 | 26 | //[JsonProperty(TypeNameHandling = TypeNameHandling.None, ItemTypeNameHandling = TypeNameHandling.All)] 27 | public Dictionary LogIgnoreLevels { get; set; } = new Dictionary(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vsCommandEvent/Configuration/User/HashType.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace net.r_eg.vsCE.Configuration.User 12 | { 13 | [Guid("CD46BF40-05AF-40F1-9569-F0A1981D4D93")] 14 | public enum HashType 15 | { 16 | /// 17 | /// ~335 MiB/Second with CPU frequency ~2.194e+09 Hz 18 | /// 19 | MD5, 20 | 21 | /// 22 | /// Tiger tree. 23 | /// ~328 MiB/Second with CPU frequency ~2.194e+09 Hz 24 | /// 25 | TTH, 26 | 27 | /// 28 | /// SHA-1 29 | /// ~192 MiB/Second with CPU frequency ~2.194e+09 Hz 30 | /// 31 | SHA1, 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vsCommandEvent/Configuration/User/ICacheHeader.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace net.r_eg.vsCE.Configuration.User 12 | { 13 | [Guid("B305C9E9-F900-4F86-A4B8-BF57A97A9AEA")] 14 | public interface ICacheHeader 15 | { 16 | /// 17 | /// When has been updated. 18 | /// UTC as a rule. 19 | /// 20 | long Updated { get; set; } 21 | 22 | /// 23 | /// Type of hashing. 24 | /// 25 | HashType Algorithm { get; set; } 26 | 27 | /// 28 | /// Hash value of data. 29 | /// 30 | string Hash { get; set; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vsCommandEvent/Configuration/User/ICommon.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace net.r_eg.vsCE.Configuration.User 12 | { 13 | [Guid("BF646E0B-0E9C-460A-9236-2177E971C1DA")] 14 | public interface ICommon 15 | { 16 | /// 17 | /// Word wrapping for main editor. 18 | /// 19 | bool WordWrap { get; set; } 20 | 21 | /// 22 | /// Value of zooming for main editor. 23 | /// 24 | int Zoomed { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vsCommandEvent/Configuration/User/IData.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Runtime.InteropServices; 11 | 12 | namespace net.r_eg.vsCE.Configuration.User 13 | { 14 | [Guid("86A57222-31EF-4C98-B960-F1478DB1A565")] 15 | public interface IData 16 | { 17 | /// 18 | /// Global settings. 19 | /// 20 | IGlobal Global { get; set; } 21 | 22 | /// 23 | /// Common settings for specific route. 24 | /// 25 | Dictionary Common { get; set; } 26 | 27 | /// 28 | /// Different headers of cache data. 29 | /// 30 | Dictionary Cache { get; set; } 31 | 32 | /// 33 | /// Prepares data to removing from cache. 34 | /// 35 | /// Data that should be soon removed. 36 | void toRemoveFromCache(IUserValue item); 37 | 38 | /// 39 | /// To avoid of planned removing data from cache. 40 | /// 41 | void avoidRemovingFromCache(); 42 | 43 | /// 44 | /// Updating of the cache container from unused data etc. 45 | /// 46 | void updateCache(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vsCommandEvent/Configuration/User/IDataSvc.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace net.r_eg.vsCE.Configuration.User 12 | { 13 | [Guid("09660649-B7BC-43D3-8E8F-951308B953D5")] 14 | internal interface IDataSvc 15 | { 16 | /// 17 | /// Update Common property. 18 | /// 19 | /// Update for loading or saving. 20 | void updateCommon(bool isLoad); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /vsCommandEvent/Configuration/User/IGlobal.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Runtime.InteropServices; 11 | 12 | namespace net.r_eg.vsCE.Configuration.User 13 | { 14 | [Guid("D9460698-4331-4843-BDAC-F8C7C5F845A2")] 15 | public interface IGlobal 16 | { 17 | /// 18 | /// Debug mode for application. 19 | /// 20 | bool DebugMode { get; set; } 21 | 22 | /// 23 | /// Flag of ignoring configuration. 24 | /// 25 | bool IgnoreConfiguration { get; set; } 26 | 27 | /// 28 | /// List of levels for disabling from logger. 29 | /// 30 | Dictionary LogIgnoreLevels { get; set; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vsCommandEvent/Configuration/User/IManager.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace net.r_eg.vsCE.Configuration.User 12 | { 13 | /// 14 | /// Specifies basic manager of accessing to remote value. 15 | /// 16 | [Guid("7E740672-7D27-4180-A5F7-0A21A0329D3A")] 17 | public interface IManager 18 | { 19 | /// 20 | /// Unspecified raw value. 21 | /// 22 | object Value { get; } 23 | 24 | /// 25 | /// Trying to get value as ICacheHeader. 26 | /// 27 | ICacheHeader CacheHeader { get; } 28 | 29 | /// 30 | /// To erase current value from common data. 31 | /// 32 | void unset(); 33 | 34 | /// 35 | /// Reset data from value. 36 | /// 37 | void reset(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vsCommandEvent/Configuration/User/IRoute.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | using net.r_eg.vsCE.Events; 11 | 12 | namespace net.r_eg.vsCE.Configuration.User 13 | { 14 | [Guid("D9C520D8-E053-4EE3-AA82-1A2400B4F64E")] 15 | public interface IRoute 16 | { 17 | /// 18 | /// Identifier of Event. 19 | /// 20 | SolutionEventType Event { get; set; } 21 | 22 | /// 23 | /// Identifier of Mode. 24 | /// 25 | ModeType Mode { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vsCommandEvent/Configuration/User/IUserValue.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace net.r_eg.vsCE.Configuration.User 12 | { 13 | [Guid("85814141-144E-4C4A-8C1D-B5884D01BBCE")] 14 | public interface IUserValue 15 | { 16 | /// 17 | /// Type of link to external value. 18 | /// 19 | LinkType Type { get; set; } 20 | 21 | /// 22 | /// Guid of external node. 23 | /// 24 | string Guid { get; set; } 25 | 26 | /// 27 | /// Manager of accessing to remote value. 28 | /// 29 | IManager Manager { get; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vsCommandEvent/Configuration/User/LinkType.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace net.r_eg.vsCE.Configuration.User 12 | { 13 | [Guid("469B1F8F-331B-47AF-A6CF-2166594AE9C4")] 14 | public enum LinkType 15 | { 16 | CacheHeader = 0x100, 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vsCommandEvent/Configuration/User/Route.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using net.r_eg.vsCE.Events; 9 | 10 | namespace net.r_eg.vsCE.Configuration.User 11 | { 12 | public struct Route: IRoute 13 | { 14 | /// 15 | /// Identifier of Event. 16 | /// 17 | public SolutionEventType Event 18 | { 19 | get; 20 | set; 21 | } 22 | 23 | /// 24 | /// Identifier of Mode. 25 | /// 26 | public ModeType Mode 27 | { 28 | get; 29 | set; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vsCommandEvent/Configuration/User/UserValue.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using Newtonsoft.Json; 9 | 10 | namespace net.r_eg.vsCE.Configuration.User 11 | { 12 | public class UserValue: IUserValue 13 | { 14 | /// 15 | /// Type of link to external value. 16 | /// 17 | public LinkType Type 18 | { 19 | get; 20 | set; 21 | } 22 | 23 | /// 24 | /// Guid of external node. 25 | /// 26 | public string Guid 27 | { 28 | get; 29 | set; 30 | } 31 | 32 | /// 33 | /// Manager of accessing to remote value. 34 | /// 35 | [JsonIgnore] 36 | public IManager Manager 37 | { 38 | get 39 | { 40 | if(manager == null) { 41 | manager = new Manager(this); 42 | } 43 | return manager; 44 | } 45 | } 46 | private IManager manager; 47 | 48 | 49 | /// 50 | /// Initialize with new Guid and specific LinkType. 51 | /// 52 | /// Type of link to external value. 53 | public UserValue(LinkType Type) 54 | { 55 | Guid = System.Guid.NewGuid().ToString(); 56 | this.Type = Type; 57 | } 58 | 59 | public UserValue() 60 | { 61 | 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /vsCommandEvent/DataArgs.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | 10 | namespace net.r_eg.vsCE 11 | { 12 | [Serializable] 13 | public class DataArgs: EventArgs 14 | { 15 | /// 16 | /// Provides a T value to use with events. 17 | /// 18 | public T Data 19 | { 20 | get; 21 | set; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vsCommandEvent/DteSlnCfg.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using EnvDTE; 10 | using EnvDTE80; 11 | using net.r_eg.MvsSln.Core; 12 | 13 | namespace net.r_eg.vsCE 14 | { 15 | internal sealed class DteSlnCfg: SolutionConfiguration2 16 | { 17 | public string Name { get; } 18 | 19 | public string PlatformName { get; } 20 | 21 | internal DteSlnCfg(string name, string platform) 22 | { 23 | Name = name; 24 | PlatformName = platform; 25 | } 26 | 27 | internal DteSlnCfg(IConfPlatform def) 28 | : this(def.Configuration, def.Platform) 29 | { 30 | 31 | } 32 | 33 | #region NotSupported 34 | 35 | public DTE DTE => throw new NotSupportedException(); 36 | public SolutionConfigurations Collection => throw new NotSupportedException(); 37 | public SolutionContexts SolutionContexts => throw new NotSupportedException(); 38 | public void Delete() => throw new NotSupportedException(); 39 | public void Activate() => throw new NotSupportedException(); 40 | 41 | #endregion 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vsCommandEvent/Events/CommandEvents/Filter.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | namespace net.r_eg.vsCE.Events.CommandEvents 9 | { 10 | public class Filter: IFilter 11 | { 12 | public int Id { get; set; } 13 | 14 | public string Guid { get; set; } 15 | 16 | public object CustomIn { get; set; } 17 | 18 | public object CustomOut { get; set; } 19 | 20 | public bool Cancel { get; set; } 21 | 22 | public bool Pre { get; set; } = true; 23 | 24 | public bool Post { get; set; } 25 | 26 | public string Description { get; set; } 27 | 28 | public bool IgnoreCustomIn { get; set; } 29 | 30 | public bool IgnoreCustomOut { get; set; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vsCommandEvent/Events/CommandEvents/IFilter.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | namespace net.r_eg.vsCE.Events.CommandEvents 9 | { 10 | /// 11 | /// Specifies filters for ICommandEvent 12 | /// 13 | public interface IFilter 14 | { 15 | /// 16 | /// For work with command ID 17 | /// 18 | int Id { get; set; } 19 | 20 | /// 21 | /// Scope by GUID 22 | /// 23 | string Guid { get; set; } 24 | 25 | /// 26 | /// Filter by Custom input parameters 27 | /// 28 | object CustomIn { get; set; } 29 | 30 | /// 31 | /// Filter by Custom output parameters 32 | /// 33 | object CustomOut { get; set; } 34 | 35 | /// 36 | /// Cancel command if it's possible 37 | /// 38 | bool Cancel { get; set; } 39 | 40 | /// 41 | /// Use Before executing command 42 | /// 43 | bool Pre { get; set; } 44 | 45 | /// 46 | /// Use After executed command 47 | /// 48 | bool Post { get; set; } 49 | 50 | /// 51 | /// User note. 52 | /// 53 | string Description { get; set; } 54 | 55 | /// 56 | /// Ignore if true. 57 | /// 58 | bool IgnoreCustomIn { get; set; } 59 | 60 | /// 61 | /// Ignore if true. 62 | /// 63 | bool IgnoreCustomOut { get; set; } 64 | } 65 | } -------------------------------------------------------------------------------- /vsCommandEvent/Events/Commands/ICommand.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace net.r_eg.vsCE.Events.Commands 12 | { 13 | /// 14 | /// Specifies basic fields for command. 15 | /// 16 | [Guid("F80C5586-6157-408A-9029-80FE2FC851B3")] 17 | public interface ICommand 18 | { 19 | /// 20 | /// Main command for handling. 21 | /// 22 | T Command { get; set; } 23 | } 24 | 25 | [Guid("E87D1386-1A8A-40E5-9379-D7790863FC90")] 26 | public interface ICommand: ICommand 27 | { 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vsCommandEvent/Events/Commands/ICommandArray.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace net.r_eg.vsCE.Events.Commands 12 | { 13 | /// 14 | /// Specifies basic fields for command list. 15 | /// 16 | [Guid("2229F68B-0FC7-46E3-953A-AFC53650DA63")] 17 | public interface ICommandArray 18 | { 19 | /// 20 | /// Atomic commands for handling. 21 | /// 22 | T[] Command { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vsCommandEvent/Events/EventProcess.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using net.r_eg.MvsSln.Extensions; 9 | 10 | namespace net.r_eg.vsCE.Events 11 | { 12 | public class EventProcess: IEventProcess 13 | { 14 | /// 15 | public bool Waiting { get; set; } = true; 16 | 17 | /// 18 | public bool Hidden { get; set; } = true; 19 | 20 | /// 21 | public int TimeLimit { get; set; } = 30; 22 | 23 | public static bool operator ==(EventProcess a, EventProcess b) => a.Equals(b); 24 | 25 | public static bool operator !=(EventProcess a, EventProcess b) => !(a == b); 26 | 27 | public override bool Equals(object obj) 28 | { 29 | if(obj is null || !(obj is EventProcess)) { 30 | return false; 31 | } 32 | 33 | var b = (EventProcess)obj; 34 | 35 | return Waiting == b.Waiting 36 | && Hidden == b.Hidden 37 | && TimeLimit == b.TimeLimit; 38 | } 39 | 40 | public override int GetHashCode() 41 | { 42 | return 0.CalculateHashCode 43 | ( 44 | Waiting, 45 | Hidden, 46 | TimeLimit 47 | ); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vsCommandEvent/Events/ICommandEvent.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | using net.r_eg.vsCE.Events.CommandEvents; 11 | 12 | namespace net.r_eg.vsCE.Events 13 | { 14 | /// 15 | /// Specifies work with CommandEvents from EnvDTE 16 | /// 17 | [Guid("F013837B-B624-44B0-B54F-7F7F988C9795")] 18 | public interface ICommandEvent: ISolutionEvent 19 | { 20 | /// 21 | /// Conditions from EnvDTE commands. 22 | /// 23 | IFilter[] Filters { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /vsCommandEvent/Events/IEventProcess.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | namespace net.r_eg.vsCE.Events 9 | { 10 | /// 11 | /// Declaring of handling process 12 | /// 13 | public interface IEventProcess 14 | { 15 | /// 16 | /// Waiting completion 17 | /// 18 | bool Waiting { get; set; } 19 | 20 | /// 21 | /// Hiding of processing or not 22 | /// 23 | bool Hidden { get; set; } 24 | 25 | /// 26 | /// How long to wait the execution, in seconds. 0 value - infinitely 27 | /// 28 | int TimeLimit { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vsCommandEvent/Events/IMode.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace net.r_eg.vsCE.Events 12 | { 13 | [Guid("905CFFE9-1C44-449A-939E-B0ABC4E871C5")] 14 | public interface IMode 15 | { 16 | /// 17 | /// Used type from available modes 18 | /// 19 | ModeType Type { get; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vsCommandEvent/Events/IModeCSharp.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | using net.r_eg.vsCE.Configuration.User; 11 | using net.r_eg.vsCE.Events.Commands; 12 | 13 | namespace net.r_eg.vsCE.Events 14 | { 15 | /// 16 | /// Mode of compilation C# code 17 | /// 18 | [Guid("25EA6943-800A-4D6E-BE14-9E26DB084172")] 19 | public interface IModeCSharp: ICommand 20 | { 21 | /// 22 | /// Additional assembly names that are referenced by the source to compile. 23 | /// 24 | string[] References { get; set; } 25 | 26 | /// 27 | /// Advanced searching of assemblies in 'References' set. 28 | /// 29 | bool SmartReferences { get; set; } 30 | 31 | /// 32 | /// Whether to generate the output in memory. 33 | /// 34 | bool GenerateInMemory { get; set; } 35 | 36 | /// 37 | /// The output path for binary result. 38 | /// 39 | string OutputPath { get; set; } 40 | 41 | /// 42 | /// Command-line arguments to use when invoking the compiler. 43 | /// 44 | string CompilerOptions { get; set; } 45 | 46 | /// 47 | /// Whether to treat warnings as errors. 48 | /// 49 | bool TreatWarningsAsErrors { get; set; } 50 | 51 | /// 52 | /// The warning level at which the compiler aborts compilation. 53 | /// 54 | int WarningLevel { get; set; } 55 | 56 | /// 57 | /// Switching between source code and list of files with source code for ICommand. 58 | /// 59 | bool FilesMode { get; set; } 60 | 61 | /// 62 | /// To cache bytecode if it's possible. 63 | /// 64 | bool CachingBytecode { get; set; } 65 | 66 | /// 67 | /// When the binary data has been updated. 68 | /// UTC 69 | /// 70 | [Obsolete("Deprecated and will be removed soon. Use CacheData instead.")] 71 | long LastTime { get; set; } 72 | 73 | /// 74 | /// Cache data from user settings. 75 | /// 76 | IUserValue CacheData { get; set; } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /vsCommandEvent/Events/IModeEnvCommand.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | using net.r_eg.vsCE.Events.Commands; 11 | using net.r_eg.vsCE.Events.Types; 12 | 13 | namespace net.r_eg.vsCE.Events 14 | { 15 | /// 16 | /// Processing with EnvDTE Commands of Visual Studio. 17 | /// 18 | [Guid("B29B9762-4316-4562-B0EB-266EAC8338AE")] 19 | public interface IModeEnvCommand: ICommandArray 20 | { 21 | /// 22 | /// Abort commands on first error 23 | /// 24 | bool AbortOnFirstError { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vsCommandEvent/Events/IModeFile.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | using net.r_eg.vsCE.Events.Commands; 11 | 12 | namespace net.r_eg.vsCE.Events 13 | { 14 | /// 15 | /// Processing with files 16 | /// 17 | [Guid("AFDDD7BE-C979-467E-8BA9-F7264B0C20E4")] 18 | public interface IModeFile: ICommand 19 | { 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /vsCommandEvent/Events/IModeInterpreter.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | using net.r_eg.vsCE.Events.Commands; 11 | 12 | namespace net.r_eg.vsCE.Events 13 | { 14 | /// 15 | /// Processing with streaming tools 16 | /// 17 | [Guid("DEF30B20-9A0B-41FC-97DD-E95BA770FDB0")] 18 | public interface IModeInterpreter: ICommand 19 | { 20 | /// 21 | /// Stream handler 22 | /// 23 | string Handler { get; set; } 24 | 25 | /// 26 | /// Treat newline as 27 | /// 28 | string Newline { get; set; } 29 | 30 | /// 31 | /// Symbol/s for wrapping of commands 32 | /// 33 | string Wrapper { get; set; } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vsCommandEvent/Events/IModeOperation.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | using net.r_eg.vsCE.Events.Commands; 11 | using net.r_eg.vsCE.Events.Types; 12 | 13 | namespace net.r_eg.vsCE.Events 14 | { 15 | /// 16 | /// Processing with environment of Visual Studio 17 | /// 18 | [Guid("1349D4E7-907A-4670-A752-7422FF0A0892")] 19 | public interface IModeOperation: ICommandArray 20 | { 21 | /// 22 | /// Abort operations on first error 23 | /// 24 | bool AbortOnFirstError { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vsCommandEvent/Events/IModeScript.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | using net.r_eg.vsCE.Events.Commands; 11 | 12 | namespace net.r_eg.vsCE.Events 13 | { 14 | /// 15 | /// Scripts from available engines like MSBuild, etc. 16 | /// 17 | [Guid("4F1765E1-CED5-4AA9-B229-617EE7B0B09D")] 18 | public interface IModeScript: ICommand 19 | { 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /vsCommandEvent/Events/IModeTargets.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | using net.r_eg.vsCE.Events.Commands; 11 | 12 | namespace net.r_eg.vsCE.Events 13 | { 14 | /// 15 | /// Processing with MSBuild targets 16 | /// 17 | [Guid("98564100-241E-4AB5-8B87-DB3C2523B71C")] 18 | public interface IModeTargets: ICommand 19 | { 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /vsCommandEvent/Events/ISolutionEvent.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | using net.r_eg.vsCE.Bridge; 11 | 12 | namespace net.r_eg.vsCE.Events 13 | { 14 | /// 15 | /// Main container of the 'Solution Events' 16 | /// 17 | [Guid("552AA0E0-9EFC-4394-B18B-41CF2F549FB3")] 18 | public interface ISolutionEvent 19 | { 20 | /// 21 | /// Status of activation. 22 | /// 23 | bool Enabled { get; set; } 24 | 25 | /// 26 | /// Unique name for identification. 27 | /// 28 | string Name { get; set; } 29 | 30 | /// 31 | /// About event. 32 | /// 33 | string Caption { get; set; } 34 | 35 | /// 36 | /// Support of the MSBuild engine. 37 | /// 38 | bool SupportMSBuild { get; set; } 39 | 40 | /// 41 | /// Support of the SBE-Scripts engine. 42 | /// 43 | bool SupportSBEScripts { get; set; } 44 | 45 | /// 46 | /// The context of action. 47 | /// 48 | BuildType BuildType { get; set; } 49 | 50 | /// 51 | /// User interaction. 52 | /// Waiting until user presses yes/no etc, 53 | /// 54 | bool Confirmation { get; set; } 55 | 56 | /// 57 | /// Used mode. 58 | /// 59 | IMode Mode { get; set; } 60 | 61 | /// 62 | /// Handling process. 63 | /// 64 | IEventProcess Process { get; set; } 65 | 66 | /// 67 | /// Unique identifier at runtime. 68 | /// 69 | Guid Id { get; } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /vsCommandEvent/Events/ISolutionEventOWP.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | using net.r_eg.vsCE.Events.OWP; 11 | 12 | namespace net.r_eg.vsCE.Events 13 | { 14 | /// 15 | /// Support of the OutputWindowPane 16 | /// 17 | [Guid("C27A1E8C-7808-4529-BAC4-E8322D4F11CD")] 18 | public interface ISolutionEventOWP: ISolutionEvent 19 | { 20 | /// 21 | /// List of statements. 22 | /// 23 | IMatching[] Match { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /vsCommandEvent/Events/Mapping/Json/ModeCommand.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.ComponentModel; 10 | using net.r_eg.vsCE.Events.Commands; 11 | using Newtonsoft.Json; 12 | 13 | namespace net.r_eg.vsCE.Events.Mapping.Json 14 | { 15 | /// 16 | /// Adds convenient and compatible way to working with ICommand objects for Json serializers. 17 | /// 18 | public abstract class ModeCommand: ICommand 19 | { 20 | /// 21 | /// Command for handling. 22 | /// 23 | [Browsable(false)] 24 | [JsonIgnore] // "Command" was never released for vsCE. Only for vsSBE but removed after 1.14.0 25 | public string Command 26 | { 27 | get => command; 28 | set 29 | { 30 | if(value != null) { 31 | _command = value.Replace("\r\n", "\n").Split('\n'); 32 | } 33 | command = value; 34 | } 35 | } 36 | protected string command = String.Empty; 37 | 38 | /// 39 | /// Readable or friendly 'Command' property as wrapper of original. 40 | /// 41 | [JsonProperty(PropertyName = "Command")] 42 | protected string[] _Command 43 | { 44 | get => _command; 45 | set 46 | { 47 | if(value != null) { 48 | command = String.Join("\n", value); 49 | } 50 | _command = value; 51 | } 52 | } 53 | protected string[] _command; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /vsCommandEvent/Events/ModeEnvCommand.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using net.r_eg.vsCE.Events.Types; 9 | using Newtonsoft.Json; 10 | 11 | namespace net.r_eg.vsCE.Events 12 | { 13 | /// 14 | /// Processing with EnvDTE Commands of Visual Studio. 15 | /// 16 | public class ModeEnvCommand: IMode, IModeEnvCommand 17 | { 18 | /// 19 | /// Type of implementation. 20 | /// 21 | public ModeType Type 22 | { 23 | get { return ModeType.EnvCommand; } 24 | } 25 | 26 | /// 27 | /// Atomic DTE-commands for handling. 28 | /// 29 | [JsonProperty(TypeNameHandling = TypeNameHandling.All)] 30 | public CommandDte[] Command 31 | { 32 | get; 33 | set; 34 | } 35 | 36 | /// 37 | /// Abort operations on the first error 38 | /// 39 | public bool AbortOnFirstError 40 | { 41 | get { return abortOnFirstError; } 42 | set { abortOnFirstError = value; } 43 | } 44 | private bool abortOnFirstError = true; 45 | 46 | /// 47 | public ModeEnvCommand(CommandDte[] command) 48 | { 49 | Command = command; 50 | } 51 | 52 | public ModeEnvCommand() 53 | { 54 | 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /vsCommandEvent/Events/ModeFile.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using net.r_eg.vsCE.Events.Mapping.Json; 9 | 10 | namespace net.r_eg.vsCE.Events 11 | { 12 | /// 13 | /// Processing with files 14 | /// 15 | public class ModeFile: ModeCommand, IMode, IModeFile 16 | { 17 | /// 18 | /// Type of implementation 19 | /// 20 | public ModeType Type 21 | { 22 | get { return ModeType.File; } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vsCommandEvent/Events/ModeInterpreter.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using net.r_eg.vsCE.Events.Mapping.Json; 9 | 10 | namespace net.r_eg.vsCE.Events 11 | { 12 | /// 13 | /// Processing with streaming tools 14 | /// 15 | public class ModeInterpreter: ModeCommand, IMode, IModeInterpreter 16 | { 17 | /// 18 | /// Type of implementation 19 | /// 20 | public ModeType Type 21 | { 22 | get { return ModeType.Interpreter; } 23 | } 24 | 25 | /// 26 | /// Stream handler 27 | /// 28 | public string Handler 29 | { 30 | get { return handler; } 31 | set { handler = value; } 32 | } 33 | private string handler = string.Empty; 34 | 35 | /// 36 | /// Treat newline as 37 | /// 38 | public string Newline 39 | { 40 | get { return newline; } 41 | set { newline = value; } 42 | } 43 | private string newline = string.Empty; 44 | 45 | /// 46 | /// Symbol/s for wrapping of commands 47 | /// 48 | public string Wrapper 49 | { 50 | get { return wrapper; } 51 | set { wrapper = value; } 52 | } 53 | private string wrapper = string.Empty; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /vsCommandEvent/Events/ModeOperation.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using Newtonsoft.Json; 9 | 10 | namespace net.r_eg.vsCE.Events 11 | { 12 | /// 13 | /// Processing with Environment of Visual Studio. 14 | /// 15 | public class ModeOperation: IMode, IModeOperation 16 | { 17 | /// 18 | /// Type of implementation. 19 | /// 20 | public ModeType Type 21 | { 22 | get { return ModeType.Operation; } 23 | } 24 | 25 | /// 26 | /// Atomic commands for handling. 27 | /// 28 | [JsonProperty(TypeNameHandling = TypeNameHandling.All)] 29 | public Types.Command[] Command 30 | { 31 | get; 32 | set; 33 | } 34 | 35 | /// 36 | /// Abort operations on first error. 37 | /// 38 | public bool AbortOnFirstError 39 | { 40 | get { return abortOnFirstError; } 41 | set { abortOnFirstError = value; } 42 | } 43 | private bool abortOnFirstError = false; 44 | 45 | /// 46 | public ModeOperation(Types.Command[] command) 47 | { 48 | Command = command; 49 | } 50 | 51 | public ModeOperation() 52 | { 53 | 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /vsCommandEvent/Events/ModeScript.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using net.r_eg.vsCE.Events.Mapping.Json; 9 | 10 | namespace net.r_eg.vsCE.Events 11 | { 12 | /// 13 | /// Scripts from available engines like MSBuild, etc. 14 | /// 15 | public class ModeScript: ModeCommand, IMode, IModeScript 16 | { 17 | /// 18 | /// Type of implementation 19 | /// 20 | public ModeType Type 21 | { 22 | get { return ModeType.Script; } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vsCommandEvent/Events/ModeTargets.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using net.r_eg.vsCE.Events.Mapping.Json; 9 | 10 | namespace net.r_eg.vsCE.Events 11 | { 12 | /// 13 | /// Processing with MSBuild targets 14 | /// 15 | public class ModeTargets: ModeCommand, IMode, IModeTargets 16 | { 17 | /// 18 | /// Type of implementation 19 | /// 20 | public ModeType Type 21 | { 22 | get { return ModeType.Targets; } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vsCommandEvent/Events/ModeType.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace net.r_eg.vsCE.Events 12 | { 13 | /// 14 | /// Type of available processing modes 15 | /// 16 | [Guid("F7E15CE6-F7B1-44A6-AB55-62F1C8BEDE26")] 17 | public enum ModeType 18 | { 19 | /// 20 | /// Unspecified mode. 21 | /// 22 | Common = 0x10, 23 | 24 | /// 25 | /// Alias to Common. 26 | /// 27 | General = Common, 28 | 29 | /// 30 | /// External handling with files. 31 | /// 32 | File = 0x100, 33 | 34 | /// 35 | /// Processing with external interpreter. 36 | /// generally, it's a stream processor etc. 37 | /// 38 | Interpreter = 0x101, 39 | 40 | /// 41 | /// DTE-commands - operations with EnvDTE. 42 | /// 43 | Operation = 0x102, 44 | 45 | /// 46 | /// Script processing. 47 | /// generally, it's internal handling with MSBuild / SBE-Scripts cores, and similar 48 | /// 49 | Script = 0x103, 50 | 51 | /// 52 | /// MSBuild targets 53 | /// 54 | Targets = 0x104, 55 | 56 | /// 57 | /// C# code 58 | /// 59 | CSharp = 0x105, 60 | 61 | /// 62 | /// Environment Commands 63 | /// 64 | EnvCommand = 0x106, 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /vsCommandEvent/Events/OWP/ComparisonType.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System.Runtime.InteropServices; 9 | 10 | namespace net.r_eg.vsCE.Events.OWP 11 | { 12 | /// 13 | /// Available methods of comparison. 14 | /// 15 | [Guid("2E81983C-2370-46F4-B951-8B1E30B887EB")] 16 | public enum ComparisonType 17 | { 18 | /// 19 | /// Equality with case sensitive. 20 | /// 21 | Default, 22 | 23 | /// 24 | /// Using .NET Framework Regular Expressions. 25 | /// 26 | Regexp, 27 | 28 | /// 29 | /// Using common wildcards. 30 | /// 31 | Wildcards 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vsCommandEvent/Events/OWP/Condition.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | namespace net.r_eg.vsCE.Events.OWP 9 | { 10 | public class Condition: IMatching 11 | { 12 | /// 13 | /// Phrase for comparison. 14 | /// 15 | public string Phrase 16 | { 17 | get; 18 | set; 19 | } 20 | 21 | /// 22 | /// How to compare. 23 | /// 24 | public ComparisonType Type 25 | { 26 | get; 27 | set; 28 | } 29 | 30 | /// 31 | /// The Name of pane for Condition. 32 | /// 33 | public string PaneName 34 | { 35 | get; 36 | set; 37 | } 38 | 39 | /// 40 | /// The Guid of pane for Condition. 41 | /// 42 | public string PaneGuid 43 | { 44 | get; 45 | set; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vsCommandEvent/Events/OWP/IMatching.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace net.r_eg.vsCE.Events.OWP 12 | { 13 | [Guid("AF518505-C235-47CA-BA65-72EF8110E3B1")] 14 | public interface IMatching 15 | { 16 | /// 17 | /// Phrase for comparison. 18 | /// 19 | string Phrase { get; set; } 20 | 21 | /// 22 | /// How to compare. 23 | /// 24 | ComparisonType Type { get; set; } 25 | 26 | /// 27 | /// The Name of pane for Condition. 28 | /// 29 | string PaneName { get; set; } 30 | 31 | /// 32 | /// The Guid of pane for Condition. 33 | /// 34 | string PaneGuid { get; set; } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vsCommandEvent/Events/Types/Command.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | namespace net.r_eg.vsCE.Events.Types 9 | { 10 | /// 11 | /// Simple commands with format like this: 12 | /// https://msdn.microsoft.com/en-us/library/envdte._dte.executecommand.aspx 13 | /// 14 | public struct Command 15 | { 16 | /// 17 | /// Name of command. 18 | /// 19 | public string name; 20 | 21 | /// 22 | /// Arguments of command. 23 | /// 24 | public string args; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vsCommandEvent/Events/Types/CommandDte.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | namespace net.r_eg.vsCE.Events.Types 9 | { 10 | /// 11 | /// Struct of EnvDTE Command. 12 | /// 13 | public struct CommandDte 14 | { 15 | /// 16 | /// Scope by GUID. 17 | /// 18 | public string Guid 19 | { 20 | get; 21 | set; 22 | } 23 | 24 | /// 25 | /// For work with command ID. 26 | /// 27 | public int Id 28 | { 29 | get; 30 | set; 31 | } 32 | 33 | /// 34 | /// Input parameters. 35 | /// 36 | public object CustomIn 37 | { 38 | get; 39 | set; 40 | } 41 | 42 | /// 43 | /// Output parameters. 44 | /// 45 | public object CustomOut 46 | { 47 | get; 48 | set; 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /vsCommandEvent/Exceptions/CompilerException.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.CodeDom.Compiler; 10 | 11 | namespace net.r_eg.vsCE.Exceptions 12 | { 13 | [Serializable] 14 | public class CompilerException: UnspecSBEException 15 | { 16 | public CompilerException(CompilerError error) 17 | : base(error.ToString(), error) 18 | { 19 | 20 | } 21 | 22 | public CompilerException(string message) 23 | : base(message) 24 | { 25 | 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vsCommandEvent/Exceptions/UnspecSBEException.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.Serialization; 10 | using System.Security.Permissions; 11 | 12 | namespace net.r_eg.vsCE.Exceptions 13 | { 14 | [Serializable] 15 | public class UnspecSBEException: Exception 16 | { 17 | public readonly object value; 18 | 19 | [SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)] 20 | public override void GetObjectData(SerializationInfo info, StreamingContext context) 21 | { 22 | base.GetObjectData(info, context); 23 | info.AddValue(nameof(value), value); 24 | } 25 | 26 | public UnspecSBEException() 27 | { 28 | 29 | } 30 | 31 | public UnspecSBEException(string message) 32 | : base(message) 33 | { 34 | 35 | } 36 | 37 | public UnspecSBEException(string message, object value) 38 | : base(message) 39 | { 40 | this.value = value; 41 | } 42 | 43 | public UnspecSBEException(string message, Exception innerException) 44 | : base(message, innerException) 45 | { 46 | 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /vsCommandEvent/Extensions/IVsHierarchyExtension.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using Microsoft.VisualStudio; 10 | using Microsoft.VisualStudio.Shell; 11 | using Microsoft.VisualStudio.Shell.Interop; 12 | using DProject = EnvDTE.Project; 13 | 14 | namespace net.r_eg.vsCE.Extensions 15 | { 16 | public static class IVsHierarchyExtension 17 | { 18 | public static Guid GetProjectGuid(this IVsHierarchy pHierProj) 19 | { 20 | if(pHierProj == null) { 21 | return Guid.Empty; 22 | } 23 | 24 | #if SDK15_OR_HIGH 25 | ThreadHelper.ThrowIfNotOnUIThread(); 26 | #endif 27 | 28 | pHierProj.GetGuidProperty( 29 | (uint)VSConstants.VSITEMID.Root, 30 | (int)__VSHPROPID.VSHPROPID_ProjectIDGuid, 31 | out Guid id 32 | ); 33 | 34 | return id; 35 | } 36 | 37 | public static DProject GetEnvDteProject(this IVsHierarchy pHierProj) 38 | { 39 | if(pHierProj == null) { 40 | return null; 41 | } 42 | 43 | #if SDK15_OR_HIGH 44 | ThreadHelper.ThrowIfNotOnUIThread(); 45 | #endif 46 | 47 | pHierProj.GetProperty( 48 | (uint)VSConstants.VSITEMID.Root, 49 | (int)__VSHPROPID.VSHPROPID_ExtObject, 50 | out object dteProject 51 | ); 52 | 53 | return (DProject)dteProject; 54 | } 55 | 56 | public static IVsHierarchy GetIVsHierarchy(this DProject dProject) 57 | { 58 | if(dProject == null) { 59 | return null; 60 | } 61 | 62 | #if SDK15_OR_HIGH 63 | ThreadHelper.ThrowIfNotOnUIThread(); 64 | #endif 65 | 66 | IVsSolution sln = (IVsSolution)Package.GetGlobalService(typeof(SVsSolution)); 67 | sln.GetProjectOfUniqueName(dProject.FullName, out IVsHierarchy hr); 68 | 69 | return hr; 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /vsCommandEvent/GuidList.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio; 3 | 4 | namespace net.r_eg.vsCE 5 | { 6 | public static class GuidList 7 | { 8 | /// 9 | /// General package identifier 10 | /// 11 | public const string PACKAGE_STRING = "DA5CEB32-1E09-44A5-A6AA-71D3149A53B7"; 12 | 13 | /// 14 | /// Identifier for used logger 15 | /// 16 | public const string PACKAGE_LOGGER = "0440C4E8-5557-4E9C-9DB2-778851CA08F5"; 17 | 18 | /// 19 | /// The Command of main UI. 20 | /// 21 | public const string CMD_MAIN_STRING = "C587CC93-95F6-4E7D-B6D2-A5B5A854A9FC"; 22 | 23 | /// 24 | /// Identifier for StatusPanel 25 | /// 26 | public const string PANEL_STRING = "56FED82A-2850-445B-AA29-49F19C6B9CC5"; 27 | 28 | /// 29 | /// Main item for OutputWindow 30 | /// 31 | public const string OWP_SBE_STRING = "2CCEC80E-9253-4573-8031-D17DBCEABC62"; 32 | 33 | /// 34 | /// BuildOutput pane 35 | /// 36 | public const string OWP_BUILD_STRING = "1BD8A850-02D1-11d1-BEE7-00A0C913D1F8"; 37 | 38 | /// 39 | /// Guid of main UI command 40 | /// 41 | public static readonly Guid CMD_MAIN = new Guid(CMD_MAIN_STRING); 42 | 43 | /// 44 | /// Guid of main item for OutputWindow 45 | /// 46 | public static readonly Guid OWP_SBE = new Guid(OWP_SBE_STRING); 47 | 48 | 49 | 50 | /// 51 | /// Guid alias to StandardCommandSet97 52 | /// 53 | public static readonly Guid VSStd97CmdID = VSConstants.CMDSETID.StandardCommandSet97_guid; 54 | 55 | /// 56 | /// Guid alias to StandardCommandSet2K 57 | /// 58 | public static readonly Guid VSStd2KCmdID = VSConstants.CMDSETID.StandardCommandSet2K_guid; 59 | 60 | } 61 | } -------------------------------------------------------------------------------- /vsCommandEvent/IAppSettings.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | using net.r_eg.vsCE.Configuration; 11 | using IUserData = net.r_eg.vsCE.Configuration.User.IData; 12 | 13 | namespace net.r_eg.vsCE 14 | { 15 | [Guid("06CBD536-36E8-4EB7-B51B-9767A315BE58")] 16 | internal interface IAppSettings 17 | { 18 | /// 19 | /// When DebugMode is updated. 20 | /// Useful for clients, for example with IEntryPointClient. 21 | /// 22 | event EventHandler> DebugModeUpdated; 23 | 24 | /// 25 | /// When IAppSettings.WorkPath was updated. 26 | /// 27 | event EventHandler> WorkPathUpdated; 28 | 29 | /// 30 | /// Debug mode for application. 31 | /// 32 | bool DebugMode { get; set; } 33 | 34 | /// 35 | /// Ignores all actions if value set as true. 36 | /// To support of cycle control, e.g.: PRE -> POST [recursive DTE: PRE -> POST] -> etc. 37 | /// 38 | bool IgnoreActions { get; set; } 39 | 40 | /// 41 | /// Checks availability data for used configurations. 42 | /// 43 | bool IsCfgExists { get; } 44 | 45 | /// 46 | /// Common path of library. 47 | /// 48 | string CommonPath { get; } 49 | 50 | /// 51 | /// Full path to library. 52 | /// 53 | string LibPath { get; } 54 | 55 | /// 56 | /// Working path for library. 57 | /// 58 | string WorkPath { get; } 59 | 60 | /// 61 | /// Manager of configurations. 62 | /// 63 | IManager ConfigManager { get; } 64 | 65 | /// 66 | /// Main configuration data. 67 | /// 68 | ISolutionEvents Config { get; } 69 | 70 | /// 71 | /// User configuration data. 72 | /// 73 | IUserData UserConfig { get; } 74 | 75 | /// 76 | /// OWP item name by default. 77 | /// 78 | string DefaultOWPItem { get; } 79 | 80 | /// 81 | /// Updates working path for library. 82 | /// 83 | /// New path. 84 | void setWorkPath(string path); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /vsCommandEvent/IEnvironmentExt.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using Microsoft.VisualStudio.Shell.Interop; 9 | 10 | namespace net.r_eg.vsCE 11 | { 12 | public interface IEnvironmentExt 13 | { 14 | /// 15 | /// Gets project name from IVsHierarchy. 16 | /// 17 | /// 18 | /// Load in global collection with __VSHPROPID.VSHPROPID_ExtObject if true. 19 | /// 20 | string getProjectNameFrom(IVsHierarchy pHierProj, bool force); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /vsCommandEvent/IEvLevel.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using net.r_eg.vsCE.Configuration; 10 | 11 | namespace net.r_eg.vsCE 12 | { 13 | public interface IEvLevel 14 | { 15 | /// 16 | /// When the solution has been opened or created 17 | /// 18 | event EventHandler OpenedSolution; 19 | 20 | /// 21 | /// When the solution has been closed 22 | /// 23 | event EventHandler ClosedSolution; 24 | 25 | /// 26 | /// Used Environment 27 | /// 28 | IEnvironment Environment { get; } 29 | 30 | /// 31 | /// Binder of action 32 | /// 33 | Actions.Binder Action { get; } 34 | 35 | /// 36 | /// Manager of configurations. 37 | /// 38 | IManager ConfigManager { get; } 39 | 40 | /// 41 | /// Solution has been opened. 42 | /// 43 | /// Reserved for future use. 44 | /// true if the solution is being created. false if the solution was created previously or is being loaded. 45 | /// If the method succeeds, it returns VSConstants.S_OK. If it fails, it returns an error code. 46 | int solutionOpened(object pUnkReserved, int fNewSolution); 47 | 48 | /// 49 | /// Solution has been closed. 50 | /// 51 | /// Reserved for future use. 52 | /// If the method succeeds, it returns VSConstants.S_OK. If it fails, it returns an error code. 53 | int solutionClosed(object pUnkReserved); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /vsCommandEvent/IOW.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace net.r_eg.vsCE 12 | { 13 | [Guid("7C0E9E6B-7BDC-4D0F-97D2-6F3F30FBA368")] 14 | public interface IOW 15 | { 16 | /// 17 | /// Access to OutputWindow. 18 | /// 19 | EnvDTE.OutputWindow OutputWindow { get; } 20 | 21 | /// 22 | /// Getting item of the output window by name. 23 | /// 24 | /// Name of item 25 | /// Flag of creating. It means ~create new pane if this item does not exist etc. 26 | /// 27 | EnvDTE.OutputWindowPane getByName(string name, bool createIfNotExist); 28 | 29 | /// 30 | /// Removes pane by name of item. 31 | /// 32 | /// 33 | void deleteByName(string name); 34 | 35 | /// 36 | /// Removes pane with selected GUID. 37 | /// 38 | /// 39 | void deleteByGuid(Guid guid); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /vsCommandEvent/IPkg.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Threading; 10 | using Microsoft.VisualStudio.Shell; 11 | 12 | #if SDK15_OR_HIGH 13 | using System.Threading.Tasks; 14 | #endif 15 | 16 | namespace net.r_eg.vsCE 17 | { 18 | internal interface IPkg 19 | { 20 | CancellationToken CancellationToken { get; } 21 | 22 | #if SDK15_OR_HIGH 23 | 24 | /// 25 | /// Finds or creates tool window. 26 | /// 27 | /// tool window type 28 | /// try to create tool when true 29 | /// tool window id 30 | /// 31 | Task getToolWindowAsync(Type type, bool create = true, int id = 0); 32 | 33 | /// service type. 34 | /// 35 | Task getSvcAsync(Type type); 36 | 37 | #else 38 | 39 | /// 40 | /// Finds or creates tool window. 41 | /// 42 | /// tool window type 43 | /// try to create tool when true 44 | /// tool window id 45 | /// 46 | ToolWindowPane getToolWindow(Type type, bool create = true, int id = 0); 47 | 48 | /// service type. 49 | /// 50 | object getSvc(Type type); 51 | 52 | #endif 53 | 54 | VSTools.ErrorList.IPane ErrorList { get; } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /vsCommandEvent/ISolutionEvents.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System.Runtime.InteropServices; 9 | using net.r_eg.vsCE.Configuration; 10 | using net.r_eg.vsCE.Events; 11 | 12 | namespace net.r_eg.vsCE 13 | { 14 | [Guid("8DFEA125-47CC-46A5-9A70-8202372A0680")] 15 | public interface ISolutionEvents 16 | { 17 | /// 18 | /// Header of information. 19 | /// 20 | Header Header { get; set; } 21 | 22 | /// 23 | /// Configuration of components. 24 | /// 25 | Component[] Components { get; set; } 26 | 27 | /// 28 | /// Configuration of event. 29 | /// 30 | Event[] Event { get; set; } 31 | 32 | /// 33 | /// Getting event by type. 34 | /// 35 | /// Available event. 36 | ISolutionEvent[] getEvent(SolutionEventType type); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vsCommandEvent/JsonSerializationBinder.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.Serialization; 10 | using Newtonsoft.Json.Serialization; 11 | 12 | namespace net.r_eg.vsCE 13 | { 14 | public class JsonSerializationBinder: SerializationBinder, ISerializationBinder 15 | { 16 | public override Type BindToType(string assemblyName, string typeName) 17 | { 18 | return Type.GetType($"{typeName}, {assemblyName}"); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vsCommandEvent/LICENSE.vsixinfo: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015-2022 Denis Kuzmin github/3F 2 | Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program. If not, see . -------------------------------------------------------------------------------- /vsCommandEvent/Logger/MessageArgs.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | 10 | namespace net.r_eg.vsCE.Logger 11 | { 12 | [Serializable] 13 | public class MessageArgs: EventArgs 14 | { 15 | /// 16 | /// Received message. 17 | /// 18 | public string Message 19 | { 20 | get; 21 | set; 22 | } 23 | 24 | /// 25 | /// Received level. 26 | /// 27 | public string Level 28 | { 29 | get; 30 | set; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vsCommandEvent/MSBuild.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using net.r_eg.EvMSBuild; 9 | using net.r_eg.Varhead; 10 | 11 | namespace net.r_eg.vsCE 12 | { 13 | internal static class MSBuild 14 | { 15 | internal static IEvMSBuild MakeEvaluator(IEnvironment env, IUVars uvars) 16 | => PostAction(env, new EvMSBuilder(env, uvars)); 17 | 18 | internal static IEvMSBuild MakeEvaluator(IEnvironment env) 19 | => PostAction(env, new EvMSBuilder(env)); 20 | 21 | private static IEvMSBuild PostAction(IEnvironment env, IEvMSBuild instance) 22 | { 23 | //instance.GlobalPropertyChanged += (object sender, PropertyArgs e) 24 | // => env?.CoreCmdSender?.fire(GetRawCommand(new[] 25 | // { 26 | // e.Removed ? "property.del" : "property.set", 27 | // e.name, 28 | // e.value 29 | // })); 30 | 31 | return instance; 32 | } 33 | 34 | //private static CoreCommandArgs GetRawCommand(object[] cmd) 35 | // => new CoreCommandArgs() { Type = CoreCommandType.RawCommand, Args = cmd }; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vsCommandEvent/OW.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using EnvDTE; 10 | using EnvDTE80; 11 | using Microsoft.VisualStudio.Shell; 12 | using Microsoft.VisualStudio.Shell.Interop; 13 | 14 | namespace net.r_eg.vsCE 15 | { 16 | public class OWP: IOW 17 | { 18 | /// 19 | /// DTE2 context 20 | /// 21 | protected DTE2 dte2; 22 | 23 | /// 24 | /// Access to OutputWindow. 25 | /// 26 | public OutputWindow OutputWindow 27 | { 28 | get { return dte2.ToolWindows.OutputWindow; } 29 | } 30 | 31 | /// 32 | /// Get item of the output window by name. 33 | /// 34 | /// Name of item 35 | /// If this value as true: Creates new pane if this item does not exist, otherwise exception. 36 | /// 37 | /// 38 | public OutputWindowPane getByName(string name, bool createIfNotExist) 39 | { 40 | OutputWindowPanes panes = dte2.ToolWindows.OutputWindow.OutputWindowPanes; 41 | if(createIfNotExist) { 42 | try { 43 | return panes.Item(name); 44 | } 45 | catch(ArgumentException) { 46 | return panes.Add(name); 47 | } 48 | } 49 | return panes.Item(name); 50 | } 51 | 52 | /// 53 | /// Remove pane by name of item. 54 | /// 55 | /// 56 | public void deleteByName(string name) 57 | { 58 | #if SDK15_OR_HIGH 59 | ThreadHelper.ThrowIfNotOnUIThread(); //TODO: upgrade to 15 60 | #endif 61 | 62 | OutputWindowPane pane = getByName(name, false); 63 | deleteByGuid(new Guid(pane.Guid)); 64 | } 65 | 66 | /// 67 | /// Remove pane with selected GUID. 68 | /// 69 | /// 70 | public void deleteByGuid(Guid guid) 71 | { 72 | #if SDK15_OR_HIGH 73 | ThreadHelper.ThrowIfNotOnUIThread(); //TODO: upgrade to 15 74 | #endif 75 | 76 | IVsOutputWindow ow = (IVsOutputWindow)Package.GetGlobalService(typeof(SVsOutputWindow)); 77 | ow.DeletePane(ref guid); 78 | } 79 | 80 | /// DTE2 context 81 | public OWP(DTE2 dte2) 82 | { 83 | this.dte2 = dte2; 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /vsCommandEvent/ParamPacker.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Text; 10 | using net.r_eg.SobaScript; 11 | 12 | namespace net.r_eg.vsCE 13 | { 14 | internal static class ParamPacker 15 | { 16 | /// Paired key=value values 17 | /// {"Key1":123},{"Key2":"val2"},{"Key3":true} 18 | /// 19 | internal static string Pack(params object[] input) 20 | { 21 | if(input == null || (input.Length & 1) == 1) 22 | { 23 | throw new ArgumentOutOfRangeException(nameof(input)); 24 | } 25 | 26 | StringBuilder sb = new(); 27 | for(int i = 0, n = input.Length - 1; true; ++i) 28 | { 29 | sb.Append($"{{\"{input[i]}\":"); 30 | 31 | object v = input[++i]; 32 | if(v is string str) 33 | { 34 | sb.Append($"\"{str}\""); 35 | } 36 | else if(v is bool flag) 37 | { 38 | sb.Append(Value.From(flag)); 39 | } 40 | else 41 | { 42 | sb.Append(Value.From(v)); 43 | } 44 | 45 | sb.Append('}'); 46 | 47 | if(i < n) 48 | { 49 | sb.Append(','); 50 | } 51 | else break; 52 | } 53 | return sb.ToString(); 54 | } 55 | 56 | internal static string PackRect(int left, int top, int width, int height) 57 | => $"{left}|{top}|{width}|{height}"; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /vsCommandEvent/PkgCmdID.cs: -------------------------------------------------------------------------------- 1 | namespace net.r_eg.vsCE 2 | { 3 | internal static class PkgCmdIDList 4 | { 5 | public const int CMD_MAIN = 0x0100; 6 | public const int CMD_MENU = 0x0101; 7 | public const int CMD_GROUP = 0x0102; 8 | public const int CMD_UNWARN = 0x0110; 9 | } 10 | } -------------------------------------------------------------------------------- /vsCommandEvent/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using net.r_eg.vsCE; 5 | 6 | [assembly: AssemblyTitle("vsCommandEvent")] 7 | [assembly: AssemblyDescription("Based on vsSolutionBuildEvent")] 8 | [assembly: AssemblyConfiguration("")] 9 | [assembly: AssemblyCompany("")] 10 | [assembly: AssemblyProduct("vsCommandEvent")] 11 | [assembly: AssemblyCopyright("github.com/3F/vsCommandEvent")] 12 | [assembly: AssemblyTrademark("")] 13 | [assembly: AssemblyCulture("")] 14 | 15 | [assembly: InternalsVisibleTo("vsCommandEventTest, PublicKey=002400000480000094000000060200000024000052534131000400000100010081bf72d485a2a107153efd0724ea8240336c7f11843c450ae576fbff8baa869ead9cdcc67bb47bce971888f7f0c79dcd5a24c8f5bdea4cc60d038a006ab909d09f173e6f12977a3cfa68a59f59549b6982c75d48eb8a8c0a34272938454826a3d724b18f9c123012a435e3a1c92ff3ff61e2b7f99e00cc5425005ee6ae1b25ad")] 16 | 17 | [assembly: ComVisible(false)] 18 | 19 | [assembly: Guid("017A799D-34E8-4CB9-B728-28CCA053ABBD")] 20 | 21 | [assembly: AssemblyVersion(Version.S_NUM)] 22 | [assembly: AssemblyFileVersion(Version.S_NUM)] -------------------------------------------------------------------------------- /vsCommandEvent/Receiver/Output/EWType.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace net.r_eg.vsCE.Receiver.Output 12 | { 13 | [Guid("71320C9F-3019-4FF1-B19C-BE2E63713937")] 14 | public enum EWType 15 | { 16 | /// 17 | /// Type of common warnings. 18 | /// 19 | Warnings, 20 | 21 | /// 22 | /// Type of common errors. 23 | /// 24 | Errors 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vsCommandEvent/Receiver/Output/IItem.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace net.r_eg.vsCE.Receiver.Output 12 | { 13 | /// 14 | /// Specifies basic item. 15 | /// 16 | [Guid("38C1F903-2584-4D1D-98A3-922A953280C8")] 17 | public interface IItem 18 | { 19 | /// 20 | /// Gets current raw data or sets new. 21 | /// 22 | string Raw { get; set; } 23 | 24 | /// 25 | /// Updating raw data. 26 | /// 27 | /// 28 | void updateRaw(string data); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vsCommandEvent/Receiver/Output/IItemEW.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Runtime.InteropServices; 11 | 12 | namespace net.r_eg.vsCE.Receiver.Output 13 | { 14 | /// 15 | /// Specifies item based on errors/warnings. 16 | /// 17 | [Guid("42B41C50-4BAD-48C2-9120-C43410D9F97C")] 18 | public interface IItemEW: IItem 19 | { 20 | /// 21 | /// Count of found errors. 22 | /// 23 | int ErrorsCount { get; } 24 | 25 | /// 26 | /// Count of found warnings. 27 | /// 28 | int WarningsCount { get; } 29 | 30 | /// 31 | /// Checks errors. 32 | /// 33 | bool IsErrors { get; } 34 | 35 | /// 36 | /// Checks warnings. 37 | /// 38 | bool IsWarnings { get; } 39 | 40 | /// 41 | /// Gets all errors in partial data. 42 | /// 43 | List Errors { get; } 44 | 45 | /// 46 | /// Gets all warnings in partial data. 47 | /// 48 | List Warnings { get; } 49 | 50 | /// 51 | /// Checking of rule for codes. 52 | /// 53 | /// Type of checking. 54 | /// The rule of whitelist or blacklist. 55 | /// List of codes for checking. 56 | /// true value if it correct for this rule. 57 | bool checkRule(EWType type, bool isWhitelist, List codes); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /vsCommandEvent/Receiver/Output/IItems.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace net.r_eg.vsCE.Receiver.Output 12 | { 13 | /// 14 | /// Specifies operations with items. 15 | /// 16 | [Guid("962E70D3-FBA4-4019-82AD-2473C45F7D7B")] 17 | public interface IItems 18 | { 19 | /// 20 | /// Get item for type and identifier. 21 | /// 22 | /// Type of item. 23 | /// Identifier of item. 24 | /// Unspecified common item. 25 | IItem get(ItemType type, Ident ident); 26 | 27 | /// 28 | /// Get EW item for identifier. 29 | /// 30 | /// Identifier of item. 31 | /// EW item. 32 | IItemEW getEW(Ident ident); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vsCommandEvent/Receiver/Output/Ident.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | namespace net.r_eg.vsCE.Receiver.Output 9 | { 10 | /// 11 | /// Identifier of items. 12 | /// 13 | public struct Ident 14 | { 15 | /// 16 | /// Guid string of pane. 17 | /// 18 | public string guid; 19 | 20 | /// 21 | /// Name of item pane. 22 | /// 23 | public string item; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vsCommandEvent/Receiver/Output/ItemType.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace net.r_eg.vsCE.Receiver.Output 12 | { 13 | /// 14 | /// Specifies types of available items. 15 | /// 16 | [Guid("3DD1EA27-A02E-4982-B71C-F72329CAC723")] 17 | public enum ItemType 18 | { 19 | /// 20 | /// The item based on errors/warnings container. 21 | /// 22 | EW, 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vsCommandEvent/Receiver/Output/PaneArgs.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | 10 | namespace net.r_eg.vsCE.Receiver.Output 11 | { 12 | [Serializable] 13 | public class PaneArgs: EventArgs 14 | { 15 | /// 16 | /// Raw message 17 | /// 18 | public string Raw 19 | { 20 | get; 21 | set; 22 | } 23 | 24 | /// 25 | /// Guid string of pane 26 | /// 27 | public string Guid 28 | { 29 | get; 30 | set; 31 | } 32 | 33 | /// 34 | /// Name of item pane 35 | /// 36 | public string Item 37 | { 38 | get; 39 | set; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vsCommandEvent/Resources/License.md: -------------------------------------------------------------------------------- 1 | # ./bug.png 2 | 3 | * License: Free for commercial use 4 | * By: Gasyoun 5 | * * http://twitter.com/gasyoun 6 | * url: https://www.iconfinder.com/icons/16140/bug_icon#size=16 7 | 8 | # ./help-16.png 9 | 10 | * License: MIT License 11 | * * http://opensource.org/licenses/MIT 12 | * By: Ionicons 13 | * * http://ionicons.com 14 | * url: https://www.iconfinder.com/icons/211757/help_outline_icon#size=16 15 | 16 | # ./Settings_16.png 17 | 18 | * License: Free for commercial use 19 | * By: Victor Erixon 20 | * * http://victorerixon.com 21 | * url: https://www.iconfinder.com/icons/106187/settings_icon#size=16 22 | 23 | # ./toggle-16.png 24 | 25 | * License: LGPL 26 | * By: Everaldo Coelho 27 | * * http://www.everaldo.com 28 | * url: https://www.iconfinder.com/icons/94514/all_navigator_or_sel_stock_toggle_icon#size=16 29 | 30 | # ./components/package.png 31 | 32 | * License: Creative Commons (Attribution 3.0 Unported) 33 | * By: Yusuke Kamiyamane 34 | * * http://p.yusukekamiyamane.com 35 | * url: https://www.iconfinder.com/icons/26548/arrange_layers_stack_icon#size=16 36 | 37 | # ./components/property.png 38 | 39 | * License: Creative Commons (Attribution 3.0 Unported) 40 | * By: Yusuke Kamiyamane 41 | * * http://p.yusukekamiyamane.com 42 | * url: https://www.iconfinder.com/icons/46195/property_icon#size=16 43 | 44 | # ./components/function.png 45 | 46 | * License: LGPL 47 | * By: Everaldo Coelho 48 | * * http://www.everaldo.com 49 | * url: https://www.iconfinder.com/icons/94928/function_selection_stock_view_icon#size=16 50 | 51 | # ./components/definition.png 52 | 53 | * License: Creative Commons (Attribution 3.0 Unported) 54 | * By: Yusuke Kamiyamane 55 | * * http://p.yusukekamiyamane.com 56 | * url: https://www.iconfinder.com/icons/58203/blue_folders_stack_icon#size=16 57 | 58 | # ./components/alias.png 59 | 60 | * License: Free for commercial use 61 | * By: Maxim Basinski 62 | * * https://www.iconfinder.com/vasabii 63 | * url: https://www.iconfinder.com/icons/473641/#size=16 64 | 65 | # ./cfg_exclamation.png 66 | 67 | * License: Creative Commons (Attribution 3.0 Unported) 68 | * By: Yusuke Kamiyamane 69 | * * http://p.yusukekamiyamane.com 70 | * url: https://www.iconfinder.com/icons/26386/exclamation_gear_icon#size=16 71 | 72 | # ./Package.ico & ./Package.png 73 | 74 | *!* Modified under the terms of CC BY 3.0: 75 | 76 | Original image: 77 | 78 | * License: Creative Commons Attribution 3.0 Unported (CC BY 3.0) 79 | * By: PixelKit 80 | * * http://pixelkit.com 81 | * url: https://www.iconfinder.com/icons/171268/tree_icon#size=512 82 | 83 | Modified by: 84 | 85 | * Denis Kuzmin github/3F 86 | 87 | # ./lightning.png 88 | 89 | * License: Free for commercial use (Do not redistribute) 90 | * By: Yannick Lung 91 | * * http://www.yanlu.de 92 | * url: https://www.iconfinder.com/icons/315946/lightning_icon#size=32 93 | -------------------------------------------------------------------------------- /vsCommandEvent/Resources/Package.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3F/vsCommandEvent/99bba678a94396df59a540f8286995613de64240/vsCommandEvent/Resources/Package.ico -------------------------------------------------------------------------------- /vsCommandEvent/Resources/Package.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3F/vsCommandEvent/99bba678a94396df59a540f8286995613de64240/vsCommandEvent/Resources/Package.png -------------------------------------------------------------------------------- /vsCommandEvent/Resources/Package_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3F/vsCommandEvent/99bba678a94396df59a540f8286995613de64240/vsCommandEvent/Resources/Package_16.png -------------------------------------------------------------------------------- /vsCommandEvent/Resources/Package_32.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3F/vsCommandEvent/99bba678a94396df59a540f8286995613de64240/vsCommandEvent/Resources/Package_32.ico -------------------------------------------------------------------------------- /vsCommandEvent/Resources/Settings_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3F/vsCommandEvent/99bba678a94396df59a540f8286995613de64240/vsCommandEvent/Resources/Settings_16.png -------------------------------------------------------------------------------- /vsCommandEvent/Resources/bug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3F/vsCommandEvent/99bba678a94396df59a540f8286995613de64240/vsCommandEvent/Resources/bug.png -------------------------------------------------------------------------------- /vsCommandEvent/Resources/cfg_exclamation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3F/vsCommandEvent/99bba678a94396df59a540f8286995613de64240/vsCommandEvent/Resources/cfg_exclamation.png -------------------------------------------------------------------------------- /vsCommandEvent/Resources/components/alias.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3F/vsCommandEvent/99bba678a94396df59a540f8286995613de64240/vsCommandEvent/Resources/components/alias.png -------------------------------------------------------------------------------- /vsCommandEvent/Resources/components/definition.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3F/vsCommandEvent/99bba678a94396df59a540f8286995613de64240/vsCommandEvent/Resources/components/definition.png -------------------------------------------------------------------------------- /vsCommandEvent/Resources/components/function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3F/vsCommandEvent/99bba678a94396df59a540f8286995613de64240/vsCommandEvent/Resources/components/function.png -------------------------------------------------------------------------------- /vsCommandEvent/Resources/components/package.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3F/vsCommandEvent/99bba678a94396df59a540f8286995613de64240/vsCommandEvent/Resources/components/package.png -------------------------------------------------------------------------------- /vsCommandEvent/Resources/components/property.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3F/vsCommandEvent/99bba678a94396df59a540f8286995613de64240/vsCommandEvent/Resources/components/property.png -------------------------------------------------------------------------------- /vsCommandEvent/Resources/help-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3F/vsCommandEvent/99bba678a94396df59a540f8286995613de64240/vsCommandEvent/Resources/help-16.png -------------------------------------------------------------------------------- /vsCommandEvent/Resources/lightning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3F/vsCommandEvent/99bba678a94396df59a540f8286995613de64240/vsCommandEvent/Resources/lightning.png -------------------------------------------------------------------------------- /vsCommandEvent/Resources/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3F/vsCommandEvent/99bba678a94396df59a540f8286995613de64240/vsCommandEvent/Resources/preview.png -------------------------------------------------------------------------------- /vsCommandEvent/Resources/separator-horizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3F/vsCommandEvent/99bba678a94396df59a540f8286995613de64240/vsCommandEvent/Resources/separator-horizontal.png -------------------------------------------------------------------------------- /vsCommandEvent/Resources/toggle-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3F/vsCommandEvent/99bba678a94396df59a540f8286995613de64240/vsCommandEvent/Resources/toggle-16.png -------------------------------------------------------------------------------- /vsCommandEvent/Resources/vsmenu_unwarn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3F/vsCommandEvent/99bba678a94396df59a540f8286995613de64240/vsCommandEvent/Resources/vsmenu_unwarn.png -------------------------------------------------------------------------------- /vsCommandEvent/SobaScript/Components/IDteCeEnv.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using net.r_eg.SobaScript.Z.VS.Dte; 9 | 10 | namespace net.r_eg.vsCE.SobaScript.Components 11 | { 12 | public interface IDteCeEnv: IDteEnv 13 | { 14 | /// 15 | /// Raise Command. 16 | /// 17 | /// Scope by Guid. 18 | /// The command ID. 19 | /// Custom input parameters. 20 | /// Custom output parameters. 21 | void Raise(string guid, int id, object customIn, object customOut); 22 | } 23 | } -------------------------------------------------------------------------------- /vsCommandEvent/SolutionEvents.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using net.r_eg.SobaScript.Exceptions; 10 | using net.r_eg.vsCE.Configuration; 11 | using net.r_eg.vsCE.Events; 12 | 13 | namespace net.r_eg.vsCE 14 | { 15 | [Serializable] 16 | public class SolutionEvents: ISolutionEvents 17 | { 18 | /// 19 | public Header Header { get; set; } = new Header(); 20 | 21 | /// 22 | public Component[] Components { get; set; } 23 | 24 | /// 25 | public Event[] Event { get; set; } = new Event[] { }; 26 | 27 | /// 28 | /// 29 | public ISolutionEvent[] getEvent(SolutionEventType type) 30 | { 31 | switch(type) 32 | { 33 | case SolutionEventType.Common: 34 | case SolutionEventType.CommandEvent: 35 | case SolutionEventType.OWP: { 36 | return Event; 37 | } 38 | } 39 | 40 | throw new NotFoundException(type); 41 | } 42 | 43 | public bool ShouldSerializeComponents() => Components?.Length > 0; 44 | public bool ShouldSerializePreBuild() => Event?.Length > 0; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vsCommandEvent/UI/EnumDecor.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | namespace net.r_eg.vsCE.UI 9 | { 10 | public static class EnumDecor 11 | { 12 | private const string VS_CONST = "Microsoft.VisualStudio.VSConstants"; 13 | 14 | public static string Shorten(string input) 15 | { 16 | if(input == null) return null; 17 | 18 | if(input.StartsWith(VS_CONST)) 19 | { 20 | return input.Substring(VS_CONST.Length); 21 | } 22 | 23 | return input; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vsCommandEvent/UI/ITransfer.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using net.r_eg.vsCE.Events; 9 | 10 | namespace net.r_eg.vsCE.UI 11 | { 12 | public interface ITransfer 13 | { 14 | /// 15 | /// Various commands such as a DTE, etc. 16 | /// 17 | void command(string data); 18 | 19 | /// 20 | /// Basic view of property by name/project. 21 | /// 22 | /// 23 | /// 24 | void property(string name, string project = null); 25 | 26 | /// 27 | /// Provides the action by event type. 28 | /// 29 | /// The type of event. 30 | /// The event configuration for action. 31 | void action(SolutionEventType type, ISolutionEvent cfg); 32 | 33 | /// 34 | /// EnvDTE command. 35 | /// 36 | void command(bool pre, string guid, int id, object customIn, object customOut, string description); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vsCommandEvent/UI/WForms/Controls/Lights.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing; 2 | using System.Windows.Forms; 3 | 4 | namespace net.r_eg.vsCE.UI.WForms.Controls 5 | { 6 | public partial class Lights: UserControl 7 | { 8 | public class PanelDt: Panel 9 | { 10 | protected override void OnPaint(PaintEventArgs e) 11 | { 12 | base.OnPaint(e); 13 | ControlPaint.DrawBorder(e.Graphics, ClientRectangle, Color.Gray, ButtonBorderStyle.Dotted); 14 | } 15 | } 16 | 17 | public enum FlashType 18 | { 19 | Red, 20 | Yellow, 21 | Green, 22 | } 23 | 24 | public void flush() 25 | { 26 | red(false); 27 | yellow(false); 28 | green(false); 29 | } 30 | 31 | public void switchOn(FlashType type) 32 | { 33 | switch(type) { 34 | case FlashType.Red: { 35 | switchOnRed(); 36 | return; 37 | } 38 | case FlashType.Yellow: { 39 | switchOnYellow(); 40 | return; 41 | } 42 | case FlashType.Green: { 43 | switchOnGreen(); 44 | return; 45 | } 46 | } 47 | } 48 | 49 | public void switchOnRed() 50 | { 51 | red(true); 52 | yellow(false); 53 | green(false); 54 | } 55 | 56 | public void switchOnYellow() 57 | { 58 | red(false); 59 | yellow(true); 60 | green(false); 61 | } 62 | 63 | public void switchOnGreen() 64 | { 65 | red(false); 66 | yellow(false); 67 | green(true); 68 | } 69 | 70 | public void red(bool enabled) 71 | { 72 | pRed.BackColor = (enabled)? Color.FromArgb(224, 13, 1) : Color.FromArgb(223, 210, 210); 73 | } 74 | 75 | public void yellow(bool enabled) 76 | { 77 | pYellow.BackColor = (enabled)? Color.FromArgb(255, 248, 29) : Color.FromArgb(240, 239, 193); 78 | } 79 | 80 | public void green(bool enabled) 81 | { 82 | pGreen.BackColor = (enabled)? Color.FromArgb(144, 191, 105) : Color.FromArgb(203, 225, 185); 83 | } 84 | 85 | public Lights() 86 | { 87 | InitializeComponent(); 88 | flush(); 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /vsCommandEvent/UI/WForms/Controls/TextEditorElements/BraceFoldingStrategy.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System.Collections.Generic; 9 | using ICSharpCode.AvalonEdit.Document; 10 | using ICSharpCode.AvalonEdit.Folding; 11 | 12 | namespace net.r_eg.vsCE.UI.WForms.Controls.TextEditorElements 13 | { 14 | /// 15 | /// Foldings based on braces. 16 | /// 17 | public class BraceFoldingStrategy 18 | { 19 | public IEnumerable CreateNewFoldings(ITextSource document) 20 | { 21 | List ret = new List(); 22 | 23 | ret.AddRange(getOffsets('{', '}', document)); 24 | ret.AddRange(getOffsets('[', ']', document)); // inc. SBE-Scripts #[ ... ] 25 | ret.AddRange(getOffsets('(', ')', document)); 26 | 27 | ret.Sort((a, b) => a.StartOffset.CompareTo(b.StartOffset)); 28 | return ret; 29 | } 30 | 31 | public IEnumerable CreateNewFoldings(TextDocument document, out int firstErrorOffset) 32 | { 33 | firstErrorOffset = -1; 34 | return CreateNewFoldings(document); 35 | } 36 | 37 | public void UpdateFoldings(FoldingManager manager, TextDocument document) 38 | { 39 | int firstErrorOffset; 40 | IEnumerable foldings = CreateNewFoldings(document, out firstErrorOffset); 41 | manager.UpdateFoldings(foldings, firstErrorOffset); 42 | } 43 | 44 | protected IEnumerable getOffsets(char opening, char closing, ITextSource document) 45 | { 46 | List ret = new List(); 47 | Stack openings = new Stack(); 48 | bool multiline = false; //flag of multiline braces 49 | 50 | for(int pos = 0; pos < document.TextLength; ++pos) 51 | { 52 | char c = document.GetCharAt(pos); 53 | 54 | if(c == opening) { 55 | openings.Push(pos + 1); 56 | multiline = false; 57 | } 58 | else if(char.IsControl(c)) { 59 | multiline = true; 60 | } 61 | else if(openings.Count > 0 && c == closing) 62 | { 63 | int offset = openings.Pop(); 64 | if(multiline) { 65 | ret.Add(new NewFolding(offset, pos)); 66 | } 67 | } 68 | } 69 | return ret; 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /vsCommandEvent/UI/WForms/Controls/TextEditorElements/SimilarWordsRenderer.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Linq; 10 | using System.Windows.Media; 11 | using ICSharpCode.AvalonEdit.Rendering; 12 | using ICSharpCode.AvalonEdit.Search; 13 | using AvalonEditorWPF = ICSharpCode.AvalonEdit.TextEditor; 14 | 15 | namespace net.r_eg.vsCE.UI.WForms.Controls.TextEditorElements 16 | { 17 | public class SimilarWordsRenderer: IBackgroundRenderer 18 | { 19 | /// 20 | /// Describes how the area is painted. 21 | /// 22 | public Brush BrushStyle 23 | { 24 | get; 25 | set; 26 | } 27 | 28 | /// 29 | /// Describes how a shape is outlined. 30 | /// 31 | public Pen PenStyle 32 | { 33 | get; 34 | set; 35 | } 36 | 37 | /// 38 | /// Gets the layer on which this background renderer should draw. 39 | /// 40 | public KnownLayer Layer 41 | { 42 | get { 43 | return KnownLayer.Selection; 44 | } 45 | } 46 | 47 | /// 48 | /// Reference to editor. 49 | /// 50 | protected AvalonEditorWPF editor; 51 | 52 | /// 53 | /// Causes the background renderer to draw. 54 | /// 55 | /// 56 | /// 57 | public void Draw(TextView textView, DrawingContext drawingContext) 58 | { 59 | if(String.IsNullOrWhiteSpace(editor.SelectedText) 60 | || !editor.SelectedText.All(Char.IsLetterOrDigit)) 61 | { 62 | return; 63 | } 64 | ISearchStrategy strategy = SearchStrategyFactory.Create(editor.SelectedText, false, true, SearchMode.Normal); 65 | 66 | foreach(ISearchResult result in strategy.FindAll(textView.Document, 0, textView.Document.TextLength)) 67 | { 68 | BackgroundGeometryBuilder builder = new BackgroundGeometryBuilder() { 69 | CornerRadius = 1 70 | }; 71 | builder.AddSegment(textView, result); 72 | drawingContext.DrawGeometry(BrushStyle, PenStyle, builder.CreateGeometry()); 73 | } 74 | } 75 | 76 | public SimilarWordsRenderer(AvalonEditorWPF editor) 77 | { 78 | this.editor = editor; 79 | BrushStyle = brushColorFromString("#DDE8CA"); 80 | PenStyle = new Pen(BrushStyle, 1); 81 | } 82 | 83 | protected Brush brushColorFromString(string color) 84 | { 85 | return new SolidColorBrush((Color)ColorConverter.ConvertFromString(color)); 86 | } 87 | } 88 | } -------------------------------------------------------------------------------- /vsCommandEvent/UI/WForms/DTECheckFrm.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Drawing; 10 | using System.Windows.Forms; 11 | using net.r_eg.vsCE.Actions; 12 | 13 | namespace net.r_eg.vsCE.UI.WForms 14 | { 15 | public partial class DTECheckFrm: Form 16 | { 17 | /// 18 | /// Work with DTE-Commands 19 | /// 20 | private DTEOperation _dteo; 21 | /// 22 | /// Flag of sample 23 | /// 24 | private bool _isHiddenSample = false; 25 | 26 | /// 27 | /// obj synch. 28 | /// 29 | private Object _lock = new Object(); 30 | 31 | public DTECheckFrm(IEnvironment env) 32 | { 33 | _dteo = new DTEOperation(env, vsCE.Events.SolutionEventType.General); 34 | 35 | InitializeComponent(); 36 | Icon = Resource.Package_32; 37 | } 38 | 39 | private void btnExecute_Click(object sender, EventArgs e) 40 | { 41 | richTextBoxExecuted.Text = String.Empty; 42 | 43 | var hlog = new EventHandler(delegate(object _sender, Logger.MessageArgs _e) { 44 | richTextBoxExecuted.Text += _e.Message; 45 | }); 46 | 47 | lock(_lock) 48 | { 49 | Log._.Received -= hlog; 50 | Log._.Received += hlog; 51 | 52 | try { 53 | _dteo.exec(richTextBoxCommand.Text.Split('\n'), false); 54 | } 55 | catch(Exception ex) { 56 | richTextBoxExecuted.Text += ex.Message; 57 | } 58 | Log._.Received -= hlog; 59 | } 60 | } 61 | 62 | private void richTextBoxCommand_Click(object sender, EventArgs e) 63 | { 64 | if(_isHiddenSample) { 65 | return; 66 | } 67 | _isHiddenSample = true; 68 | setCommand("", Color.FromArgb(0, 0, 0)); 69 | } 70 | 71 | private void DTECheckFrm_Load(object sender, EventArgs e) 72 | { 73 | setCommand("Build.SolutionConfigurations(Debug)\nBuild.SolutionPlatforms(x86)", Color.FromArgb(128, 128, 128)); 74 | } 75 | 76 | private void setCommand(string str, Color foreColor) 77 | { 78 | richTextBoxCommand.Text = str; 79 | richTextBoxCommand.ForeColor = foreColor; 80 | } 81 | 82 | private void btnDoc_Click(object sender, EventArgs e) 83 | { 84 | Util.openUrl("http://vsce.r-eg.net/doc/Scripts/DTE-Commands/"); 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /vsCommandEvent/UI/WForms/DTECommandsFrm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing; 4 | using System.Linq; 5 | using System.Windows.Forms; 6 | 7 | namespace net.r_eg.vsCE.UI.WForms 8 | { 9 | public partial class DTECommandsFrm: Form 10 | { 11 | /// 12 | /// Transport support 13 | /// 14 | private readonly ITransfer _pin; 15 | 16 | private readonly IEnumerable _commands; 17 | 18 | public DTECommandsFrm(IEnumerable commands, ITransfer pin) 19 | { 20 | _commands = commands ?? Enumerable.Empty(); 21 | _pin = pin; 22 | 23 | InitializeComponent(); 24 | Icon = Resource.Package_32; 25 | } 26 | 27 | private void DTECommandsFrm_Load(object sender, EventArgs e) 28 | { 29 | fill(dataGridViewDTE); 30 | } 31 | 32 | private void textBoxFilter_TextChanged(object sender, EventArgs e) 33 | { 34 | fill(dataGridViewDTE, textBoxFilter.Text); 35 | } 36 | 37 | private void fill(DataGridView grid, string filter = null) 38 | { 39 | if(!String.IsNullOrWhiteSpace(filter)) { 40 | filter = filter.ToLower(); 41 | } 42 | 43 | grid.SuspendLayout(); 44 | grid.Rows.Clear(); 45 | foreach(EnvDTE.Command cmd in _commands) 46 | { 47 | if(String.IsNullOrWhiteSpace(cmd.Name) || (filter != null && !cmd.Name.ToLower().Contains(filter))) { 48 | continue; 49 | } 50 | grid.Rows.Add(cmd.Name); 51 | } 52 | grid.ResumeLayout(); 53 | labelPropCount.Text = grid.Rows.Count.ToString(); 54 | } 55 | 56 | private void dataGridViewDTE_CellDoubleClick(object sender, DataGridViewCellEventArgs e) 57 | { 58 | _pin.command(String.Format("{0}", dataGridViewDTE[0, e.RowIndex].Value)); 59 | 60 | dataGridViewDTE.Rows[e.RowIndex].DefaultCellStyle.SelectionBackColor = Color.FromArgb(245, 242, 203); 61 | dataGridViewDTE.Rows[e.RowIndex].DefaultCellStyle.SelectionForeColor = Color.FromArgb(23, 36, 47); 62 | } 63 | 64 | private void dataGridViewDTE_CellClick(object sender, DataGridViewCellEventArgs e) 65 | { 66 | dataGridViewDTE.Rows[e.RowIndex].DefaultCellStyle.SelectionBackColor = Color.FromArgb(248, 243, 243); 67 | dataGridViewDTE.Rows[e.RowIndex].DefaultCellStyle.SelectionForeColor = Color.FromArgb(23, 36, 47); 68 | } 69 | 70 | private void dataGridViewDTE_KeyDown(object sender, KeyEventArgs e) 71 | { 72 | if(e.KeyCode == Keys.Enter) { 73 | e.SuppressKeyPress = true; 74 | return; 75 | } 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /vsCommandEvent/UI/WForms/Logic/RestoreData.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System.Collections.Generic; 9 | using net.r_eg.vsCE.Configuration; 10 | using IUserData = net.r_eg.vsCE.Configuration.User.IData; 11 | using UserData = net.r_eg.vsCE.Configuration.User.Data; 12 | 13 | namespace net.r_eg.vsCE.UI.WForms.Logic 14 | { 15 | /// 16 | /// Logic for restoring settings. 17 | /// 18 | public sealed class RestoreData 19 | { 20 | /// 21 | /// All instances of Config. 22 | /// 23 | private Dictionary configs = new Dictionary(); 24 | 25 | /// 26 | /// All instances of UserConfig. 27 | /// 28 | private Dictionary userConfigs = new Dictionary(); 29 | 30 | /// 31 | /// Get Configuration data for selected context. 32 | /// 33 | /// Context for using. 34 | /// 35 | public ISolutionEvents getConfig(ContextType context) 36 | { 37 | if(configs.ContainsKey(context)) { 38 | return configs[context]; 39 | } 40 | return new SolutionEvents(); 41 | } 42 | 43 | /// 44 | /// Get User-Configuration data for selected context. 45 | /// 46 | /// Context for using. 47 | /// 48 | public IUserData getUserConfig(ContextType context) 49 | { 50 | if(userConfigs.ContainsKey(context)) { 51 | return userConfigs[context]; 52 | } 53 | return new UserData(); 54 | } 55 | 56 | /// 57 | /// Update Configuration data for specific context. 58 | /// 59 | /// Configuration data. 60 | /// Specific context. 61 | public void update(ISolutionEvents data, ContextType context) 62 | { 63 | configs[context] = data; 64 | } 65 | 66 | /// 67 | /// Update User-Configuration data for specific context. 68 | /// 69 | /// Configuration data. 70 | /// Specific context. 71 | public void update(IUserData data, ContextType context) 72 | { 73 | userConfigs[context] = data; 74 | } 75 | } 76 | } -------------------------------------------------------------------------------- /vsCommandEvent/UI/WForms/Logic/SBEWrap.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System.Collections.Generic; 9 | using net.r_eg.vsCE.Events; 10 | 11 | namespace net.r_eg.vsCE.UI.WForms.Logic 12 | { 13 | public class SBEWrap 14 | { 15 | /// 16 | /// Wrapped event 17 | /// 18 | public List evt; 19 | 20 | /// 21 | /// Specific type 22 | /// 23 | public SolutionEventType type; 24 | 25 | /// 26 | public SBEWrap(SolutionEventType type) 27 | { 28 | this.type = type; 29 | update(); 30 | } 31 | 32 | /// 33 | /// Updating list from used array data 34 | /// 35 | public void update() 36 | { 37 | if(Settings.Cfg.getEvent(type) != null) { 38 | evt = new List(Settings.Cfg.getEvent(type)); 39 | return; 40 | } 41 | 42 | Log.Debug("SBEWrap: evt is null for type '{0}'", type); 43 | evt = new List(); 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /vsCommandEvent/UI/WForms/PropertyCheckFrm.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Drawing; 10 | using System.Windows.Forms; 11 | using net.r_eg.EvMSBuild; 12 | 13 | namespace net.r_eg.vsCE.UI.WForms 14 | { 15 | public partial class PropertyCheckFrm: Form 16 | { 17 | /// 18 | /// Work with MSBuild 19 | /// 20 | private IEvMSBuild _parser; 21 | 22 | /// 23 | /// Flag of sample 24 | /// 25 | private bool _isHiddenSample = false; 26 | 27 | public PropertyCheckFrm(IEnvironment env) 28 | { 29 | _parser = MSBuild.MakeEvaluator(env); 30 | 31 | InitializeComponent(); 32 | Icon = Resource.Package_32; 33 | } 34 | 35 | private void btnEvaluate_Click(object sender, EventArgs e) 36 | { 37 | string evaluated; 38 | try { 39 | // for a specific project use like this: $($(var):project) 40 | evaluated = _parser.Eval(textBoxUnevaluated.Text.Trim()); 41 | } 42 | catch(Exception ex) { 43 | evaluated = String.Format("Fail: {0}", ex.Message); 44 | } 45 | richTextBoxEvaluated.Text = evaluated; 46 | } 47 | 48 | private void textBoxUnevaluated_Click(object sender, EventArgs e) 49 | { 50 | if(_isHiddenSample) { 51 | return; 52 | } 53 | _isHiddenSample = true; 54 | setUnevaluated("", Color.FromArgb(0, 0, 0)); 55 | } 56 | 57 | private void PropertyCheckFrm_Load(object sender, EventArgs e) 58 | { 59 | setUnevaluated("$([System.Guid]::NewGuid())", Color.FromArgb(128, 128, 128)); 60 | } 61 | 62 | private void setUnevaluated(string str, Color foreColor) 63 | { 64 | textBoxUnevaluated.Text = str; 65 | textBoxUnevaluated.ForeColor = foreColor; 66 | } 67 | 68 | private void btnDoc_Click(object sender, EventArgs e) 69 | { 70 | Util.openUrl("https://vsce.r-eg.net/doc/Scripts/MSBuild/"); 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /vsCommandEvent/UI/WForms/Wizards/Version/Fields.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System.Collections.Generic; 9 | 10 | namespace net.r_eg.vsCE.UI.WForms.Wizards.Version 11 | { 12 | internal static class Fields 13 | { 14 | public enum Type 15 | { 16 | /// 17 | /// None used. 18 | /// 19 | Null, 20 | 21 | /// 22 | /// The general number. 23 | /// 24 | Number, 25 | 26 | /// 27 | /// The number as string. 28 | /// 29 | NumberString, 30 | 31 | /// 32 | /// The number with revision as string. 33 | /// 34 | NumberWithRevString, 35 | 36 | /// 37 | /// SCM. name of branch. 38 | /// 39 | BranchName, 40 | 41 | /// 42 | /// SCM. SHA-1 of commit. 43 | /// 44 | BranchSha1, 45 | 46 | /// 47 | /// SCM. branch revision number. 48 | /// 49 | BranchRevCount, 50 | 51 | /// 52 | /// Informational string of version. 53 | /// 54 | Informational, 55 | 56 | /// 57 | /// Full informational string of version. 58 | /// 59 | InformationalFull, 60 | } 61 | 62 | /// 63 | /// List of available fields. 64 | /// 65 | public static List> List 66 | { 67 | get { return list; } 68 | } 69 | private static List> list = new List>() 70 | { 71 | new KeyValuePair(Type.Number, "The general number"), 72 | new KeyValuePair(Type.NumberString, "The number as string"), 73 | new KeyValuePair(Type.NumberWithRevString, "The number with revision as string"), 74 | new KeyValuePair(Type.BranchName, "SCM. name of branch"), 75 | new KeyValuePair(Type.BranchSha1, "SCM. SHA-1 of commit"), 76 | new KeyValuePair(Type.BranchRevCount, "SCM. branch revision number"), 77 | new KeyValuePair(Type.Informational, "Informational string of version"), 78 | new KeyValuePair(Type.InformationalFull, "Full informational string of version"), 79 | }; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /vsCommandEvent/UI/WForms/Wizards/Version/GenType.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | namespace net.r_eg.vsCE.UI.WForms.Wizards.Version 9 | { 10 | internal enum GenType 11 | { 12 | /// 13 | /// C# Struct 14 | /// 15 | CSharpStruct, 16 | 17 | /// 18 | /// C++ Struct 19 | /// 20 | CppStruct, 21 | 22 | /// 23 | /// C++ macro definitions ( #define ) 24 | /// 25 | CppDefinitions, 26 | 27 | /// 28 | /// Direct replacement 29 | /// 30 | Direct, 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vsCommandEvent/UI/WForms/Wizards/Version/IStep.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | namespace net.r_eg.vsCE.UI.WForms.Wizards.Version 9 | { 10 | internal interface IStep 11 | { 12 | /// 13 | /// The type of step. 14 | /// 15 | StepsType Type { get; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vsCommandEvent/UI/WForms/Wizards/Version/RevNumber/DeltaTime.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Linq; 11 | 12 | namespace net.r_eg.vsCE.UI.WForms.Wizards.Version.RevNumber 13 | { 14 | internal sealed class DeltaTime: IRevNumber 15 | { 16 | /// 17 | /// Interval for time. 18 | /// 19 | public IntervalType interval = IntervalType.TotalMinutes; 20 | 21 | /// 22 | /// Basis for time. 23 | /// 24 | public DateTime timeBase = DateTime.Today; 25 | 26 | /// 27 | /// The revision of modulo 28 | /// 29 | public TRevModulo revMod; 30 | 31 | /// 32 | /// The type of this revision number. 33 | /// 34 | public Type Type 35 | { 36 | get { return Type.DeltaTime; } 37 | } 38 | 39 | /// 40 | /// Available types of intervals for 'Delta of time' method. 41 | /// 42 | public enum IntervalType 43 | { 44 | TotalMinutes, 45 | TotalHours, 46 | TotalSeconds, 47 | TotalDays, 48 | //TotalMilliseconds, :) 49 | } 50 | 51 | /// 52 | /// The type for revision of modulo 53 | /// 54 | public struct TRevModulo 55 | { 56 | public bool enabled; 57 | public int min; 58 | public int max; 59 | } 60 | 61 | /// 62 | /// List of available types of intervals for 'Delta of time' method. 63 | /// 64 | public List> IntervalTypeList 65 | { 66 | get; 67 | private set; 68 | } 69 | 70 | public DeltaTime() 71 | { 72 | timeBase = DateTime.Today.AddDays(-2); 73 | 74 | revMod = new TRevModulo() { 75 | enabled = true, 76 | min = 100, 77 | max = 100000 78 | }; 79 | 80 | IntervalTypeList = Enum.GetValues(typeof(IntervalType)) 81 | .Cast() 82 | .Select(v => new KeyValuePair(v, v.ToString())) 83 | .ToList(); 84 | } 85 | } 86 | } -------------------------------------------------------------------------------- /vsCommandEvent/UI/WForms/Wizards/Version/RevNumber/IRevNumber.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | namespace net.r_eg.vsCE.UI.WForms.Wizards.Version.RevNumber 9 | { 10 | internal interface IRevNumber 11 | { 12 | /// 13 | /// The type of this revision number. 14 | /// 15 | Type Type { get; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vsCommandEvent/UI/WForms/Wizards/Version/RevNumber/Raw.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | namespace net.r_eg.vsCE.UI.WForms.Wizards.Version.RevNumber 9 | { 10 | internal struct Raw: IRevNumber 11 | { 12 | /// 13 | /// The type of this revision number. 14 | /// 15 | public Type Type 16 | { 17 | get { return Type.Raw; } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vsCommandEvent/UI/WForms/Wizards/Version/RevNumber/Type.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | namespace net.r_eg.vsCE.UI.WForms.Wizards.Version.RevNumber 9 | { 10 | /// 11 | /// Available types of methods for using as revision number. 12 | /// 13 | internal enum Type 14 | { 15 | /// 16 | /// From Input number 17 | /// 18 | Raw, 19 | 20 | /// 21 | /// Delta of time 22 | /// 23 | DeltaTime, 24 | 25 | //TODO: 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vsCommandEvent/UI/WForms/Wizards/Version/StepGen.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | namespace net.r_eg.vsCE.UI.WForms.Wizards.Version 9 | { 10 | internal sealed class StepGen: IStep 11 | { 12 | /// 13 | /// The type of generation. 14 | /// 15 | public GenType gtype = GenType.CSharpStruct; 16 | 17 | /// 18 | /// The type of step. 19 | /// 20 | public StepsType Type 21 | { 22 | get { return StepsType.Gen; } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vsCommandEvent/UI/WForms/Wizards/Version/StepsType.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | namespace net.r_eg.vsCE.UI.WForms.Wizards.Version 9 | { 10 | internal enum StepsType 11 | { 12 | /// 13 | /// To select type of generation. 14 | /// 15 | Gen, 16 | 17 | /// 18 | /// To configure struct or class. 19 | /// 20 | Struct, 21 | 22 | /// 23 | /// To configure data of struct or class. 24 | /// 25 | CfgData, 26 | 27 | /// 28 | /// To configure the direct replacement. 29 | /// 30 | DirectRepl, 31 | 32 | /// 33 | /// To reconfigure of available fields. 34 | /// 35 | Fields, 36 | 37 | /// 38 | /// Final step with result. 39 | /// 40 | Final, 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vsCommandEvent/UnifiedTypes/DTEC.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | namespace net.r_eg.vsCE.UnifiedTypes 9 | { 10 | /// 11 | /// Represents a unified commands for used environment with commands from DTE 12 | /// 13 | public sealed class DTEC 14 | { 15 | /// 16 | /// Cancel build operation 17 | /// 18 | public const string BuildCancel = "Build.Cancel"; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vsCommandEvent/VSTools/ErrorList/IPane.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace net.r_eg.vsCE.VSTools.ErrorList 12 | { 13 | [Guid("EA256A50-31B6-45A3-A0BA-773E5CBB6165")] 14 | public interface IPane 15 | { 16 | /// 17 | /// To add new error in ErrorList. 18 | /// 19 | /// 20 | void error(string message); 21 | 22 | /// 23 | /// To add new warning in ErrorList. 24 | /// 25 | /// 26 | void warn(string message); 27 | 28 | /// 29 | /// To add new information in ErrorList. 30 | /// 31 | /// 32 | void info(string message); 33 | 34 | /// 35 | /// To clear all messages. 36 | /// 37 | void clear(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vsCommandEvent/VSTools/OW/IPane.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using System.Runtime.InteropServices; 10 | 11 | namespace net.r_eg.vsCE.VSTools.OW 12 | { 13 | [Guid("9C9CEFB5-BECE-4DB8-87EF-5C38AFA5EBD7")] 14 | public interface IPane 15 | { 16 | /// 17 | /// Gets the GUID for the pane. 18 | /// 19 | Guid Guid { get; } 20 | 21 | /// 22 | /// Moves the focus to the current item. 23 | /// 24 | void Activate(); 25 | 26 | /// 27 | /// Clears all text from pane. 28 | /// 29 | void Clear(); 30 | 31 | /// 32 | /// Sends a text string into pane. 33 | /// 34 | /// 35 | void OutputString(string text); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vsCommandEvent/VSTools/OW/PaneCOM.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using Microsoft.VisualStudio.Shell; 10 | using Microsoft.VisualStudio.Shell.Interop; 11 | 12 | namespace net.r_eg.vsCE.VSTools.OW 13 | { 14 | public class PaneCOM: IPane 15 | { 16 | /// 17 | /// The OutputWindowPane by SVsOutputWindow 18 | /// 19 | protected IVsOutputWindowPane pane = null; 20 | 21 | /// 22 | /// Gets the GUID for the pane. 23 | /// 24 | public Guid Guid 25 | { 26 | get; 27 | protected set; 28 | } 29 | 30 | /// 31 | /// Moves the focus to the current item. 32 | /// 33 | public void Activate() 34 | { 35 | #if SDK15_OR_HIGH 36 | ThreadHelper.ThrowIfNotOnUIThread(); //TODO: upgrade to 15 37 | #endif 38 | 39 | pane.Activate(); 40 | } 41 | 42 | /// 43 | /// Clears all text from pane. 44 | /// 45 | public void Clear() 46 | { 47 | #if SDK15_OR_HIGH 48 | ThreadHelper.ThrowIfNotOnUIThread(); //TODO: upgrade to 15 49 | #endif 50 | 51 | pane.Clear(); 52 | } 53 | 54 | /// 55 | /// Sends a text string into pane. 56 | /// 57 | /// 58 | public void OutputString(string text) 59 | { 60 | #if SDK15_OR_HIGH 61 | ThreadHelper.ThrowIfNotOnUIThread(); 62 | pane.OutputStringThreadSafe(text); 63 | #else 64 | pane.OutputString(text); 65 | #endif 66 | } 67 | 68 | /// 69 | /// Name of the pane 70 | public PaneCOM(IVsOutputWindow ow, string name) 71 | { 72 | if(ow == null) throw new ArgumentNullException(nameof(ow)); 73 | 74 | #if SDK15_OR_HIGH 75 | ThreadHelper.ThrowIfNotOnUIThread(); //TODO: upgrade to 15 76 | #endif 77 | 78 | Guid id = GuidList.OWP_SBE; 79 | ow.CreatePane(ref id, name, 1, 1); 80 | ow.GetPane(ref id, out pane); 81 | 82 | this.Guid = id; 83 | } 84 | 85 | /// 86 | public PaneCOM(IVsOutputWindowPane owp) 87 | { 88 | pane = owp; 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /vsCommandEvent/VSTools/OW/PaneDTE.cs: -------------------------------------------------------------------------------- 1 | /*! 2 | * Copyright (c) 2015 Denis Kuzmin github/3F 3 | * Copyright (c) vsCommandEvent contributors https://github.com/3F/vsCommandEvent/graphs/contributors 4 | * Licensed under the GNU LGPLv3. 5 | * See accompanying LICENSE file or visit https://github.com/3F/vsCommandEvent 6 | */ 7 | 8 | using System; 9 | using EnvDTE; 10 | 11 | namespace net.r_eg.vsCE.VSTools.OW 12 | { 13 | public class PaneDTE: IPane 14 | { 15 | /// 16 | /// The OutputWindowPane by EnvDTE 17 | /// 18 | protected OutputWindowPane pane = null; 19 | 20 | /// 21 | /// Gets the GUID for the pane. 22 | /// 23 | public Guid Guid 24 | { 25 | get { 26 | return new Guid(pane.Guid); //TODO: provide GuidList.OWP_SBE 27 | } 28 | } 29 | 30 | /// 31 | /// Moves the focus to the current item. 32 | /// 33 | public void Activate() 34 | { 35 | pane.Activate(); 36 | } 37 | 38 | /// 39 | /// Clears all text from pane. 40 | /// 41 | public void Clear() 42 | { 43 | pane.Clear(); 44 | } 45 | 46 | /// 47 | /// Sends a text string into pane. 48 | /// 49 | /// 50 | public void OutputString(string text) 51 | { 52 | pane.OutputString(text); 53 | } 54 | 55 | /// DTE2 Context. 56 | /// Name of the pane. 57 | public PaneDTE(EnvDTE80.DTE2 dte2, string name) 58 | { 59 | if(dte2 == null) { 60 | throw new ArgumentNullException(nameof(dte2)); 61 | } 62 | 63 | try { 64 | pane = dte2.ToolWindows.OutputWindow.OutputWindowPanes.Item(name); 65 | } 66 | catch(ArgumentException) { 67 | pane = dte2.ToolWindows.OutputWindow.OutputWindowPanes.Add(name); 68 | } 69 | catch(Exception ex) { 70 | Log.Error($"Failed PaneDTE init: {ex.Message}"); 71 | Log.Debug(ex.StackTrace); 72 | } 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /vsCommandEvent/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /vsCommandEvent/sdk10.vsixmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | vsCommandEvent 6 | GitHub3F 7 | 1.4.0 8 | Extending Visual Studio on the fly via E-MSBuild, SobaScript, C#, ... An powerful manager of the commands and data. 9 | 1033 10 | https://github.com/3F/vsCommandEvent 11 | LICENSE.vsixinfo 12 | https://github.com/3F/vsCommandEvent 13 | Resources/Package.png 14 | Resources/preview.png 15 | false 16 | 17 | 18 | Ultimate 19 | Premium 20 | Pro 21 | IntegratedShell 22 | 23 | 24 | Ultimate 25 | Premium 26 | Pro 27 | IntegratedShell 28 | 29 | 30 | Community 31 | Enterprise 32 | Ultimate 33 | Premium 34 | Pro 35 | IntegratedShell 36 | 37 | 38 | Community 39 | Enterprise 40 | Ultimate 41 | Premium 42 | Pro 43 | IntegratedShell 44 | 45 | 46 | Community 47 | Enterprise 48 | Ultimate 49 | Premium 50 | Pro 51 | IntegratedShell 52 | 53 | 54 | 55 | 56 | 57 | 58 | Visual Studio MPF 59 | 60 | 61 | 62 | |%CurrentProject%;PkgdefProjectOutputGroup| 63 | 64 | 65 | -------------------------------------------------------------------------------- /vsCommandEvent/sdk15.vsixmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | vsCommandEvent 7 | Extending Visual Studio on the fly via E-MSBuild, SobaScript, C#, ... An powerful manager of the commands and data. 8 | https://github.com/3F/vsCommandEvent 9 | LICENSE.vsixinfo 10 | https://github.com/3F/vsCommandEvent 11 | https://github.com/3F/vsCommandEvent/blob/master/changelog.txt 12 | Resources\Package.png 13 | Resources\preview.png 14 | EnvDTE, events, SobaScript, SBE-Scripts, Script, shell, E-MSBuild, Varhead, Usability, Errors, file, NuGet, Output, project, Version, Command, Compiler, downloader, DTE, Versioning, Warnings, zip, build, automation, DevOps, MSBuild, Scripts, DevTools, http, Productivity, CSharp, solution, files, ftp, Commands, projects, cmd, build automation, batch, scripting, GetNuTool, replace in files, targets, 7z, 7zip, archiver 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /vsCommandEvent/sdk17.vsixmanifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | vsCommandEvent 7 | Extending Visual Studio on the fly via E-MSBuild, SobaScript, C#, ... An powerful manager of the commands and data. 8 | https://github.com/3F/vsCommandEvent 9 | LICENSE.vsixinfo 10 | https://github.com/3F/vsCommandEvent 11 | https://github.com/3F/vsCommandEvent/blob/master/changelog.txt 12 | Resources\Package.png 13 | Resources\preview.png 14 | EnvDTE, events, SobaScript, SBE-Scripts, Script, shell, E-MSBuild, Varhead, Usability, Errors, file, NuGet, Output, project, Version, Command, Compiler, downloader, DTE, Versioning, Warnings, zip, build, automation, DevOps, MSBuild, Scripts, DevTools, http, Productivity, CSharp, solution, files, ftp, Commands, projects, cmd, build automation, batch, scripting, GetNuTool, replace in files, targets, 7z, 7zip, archiver 15 | 16 | 17 | 18 | amd64 19 | 20 | 21 | amd64 22 | 23 | 24 | amd64 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /vsCommandEvent/xshd/FilesMode.xshd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | [.()\[\]{}\/!]+ 10 | 11 | 12 | 13 | [0-9]+ 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /vsCommandEvent/xshd/OperationMode.xshd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | [?,.;()\[\]{}+\-/%*<>^+~!|&]+ 12 | 13 | 14 | 15 | [0-9]+ 16 | 17 | 18 | 19 | " 20 | " 21 | 22 | 23 | 24 | 25 | 26 | 27 | false 28 | null 29 | true 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /vsCommandEventTest/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | [assembly: ComVisible(false)] 4 | 5 | [assembly: Guid("0784A68F-DDBD-4286-8B29-010F3F57B31B")] -------------------------------------------------------------------------------- /vsCommandEventTest/MSBuild/ParserTest.cs: -------------------------------------------------------------------------------- 1 | using Moq; 2 | using net.r_eg.EvMSBuild; 3 | using net.r_eg.MvsSln; 4 | using Xunit; 5 | 6 | namespace net.r_eg.vsCE.Test.MSBuild 7 | { 8 | public class ParserTest 9 | { 10 | [Fact] 11 | public void getPropertyTest() 12 | { 13 | var mockDte2 = new Mock(); 14 | var mockSolution = new Mock(); 15 | var mockSolutionBuild = new Mock(); 16 | var mockSolutionConfiguration2 = new Mock(); 17 | 18 | mockSolutionConfiguration2.SetupGet(p => p.Name).Returns("Release"); 19 | mockSolutionConfiguration2.SetupGet(p => p.PlatformName).Returns("x86"); 20 | 21 | mockSolutionBuild.SetupGet(p => p.ActiveConfiguration).Returns(mockSolutionConfiguration2.Object); 22 | mockSolution.SetupGet(p => p.SolutionBuild).Returns(mockSolutionBuild.Object); 23 | mockDte2.SetupGet(p => p.Solution).Returns(mockSolution.Object); 24 | 25 | var target = new EvMSBuilder(new Environment(mockDte2.Object)); 26 | Assert.NotNull(target.GetPropValue(PropertyNames.CONFIG)); 27 | Assert.NotNull(target.GetPropValue(PropertyNames.PLATFORM)); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /vsCommandEventTest/Receiver/Output/MatcherTest.cs: -------------------------------------------------------------------------------- 1 | using net.r_eg.vsCE.Receiver.Output; 2 | using Xunit; 3 | 4 | namespace net.r_eg.vsCE.Test.Receiver.Output 5 | { 6 | public class MatcherTest 7 | { 8 | [Fact] 9 | public void mWildcardsTest() 10 | { 11 | MatcherAccessor.ToWildcards target = new MatcherAccessor.ToWildcards(); 12 | 13 | string raw = "new tes;ted project-12, and 75_protection of various systems."; 14 | string rawExpected = raw; 15 | 16 | bool actual = target.mWildcards("pro*system", ref raw); 17 | Assert.Equal(rawExpected, raw); 18 | Assert.True(actual); 19 | } 20 | 21 | [Fact] 22 | public void mWildcardsTest1() 23 | { 24 | MatcherAccessor.ToWildcards target = new MatcherAccessor.ToWildcards(); 25 | 26 | string raw = "new tes;ted project-12, and 75_protection of various systems"; 27 | 28 | Assert.True(target.mWildcards("new*7*systems", ref raw)); 29 | Assert.True(target.mWildcards("", ref raw)); 30 | Assert.True(target.mWildcards("*", ref raw)); 31 | Assert.False(target.mWildcards("new*express", ref raw)); 32 | Assert.False(target.mWildcards("tes*ting*project", ref raw)); 33 | 34 | Assert.True(target.mWildcards("?", ref raw)); 35 | Assert.True(target.mWildcards("project?12", ref raw)); 36 | Assert.False(target.mWildcards("pro?tect", ref raw)); 37 | 38 | Assert.True(target.mWildcards("+", ref raw)); 39 | Assert.True(target.mWildcards("new+systems", ref raw)); 40 | Assert.False(target.mWildcards("systems+", ref raw)); 41 | } 42 | 43 | private class MatcherAccessor 44 | { 45 | public class Accessor: Matcher {} 46 | 47 | public class ToWildcards: Accessor 48 | { 49 | public new bool mWildcards(string term, ref string raw) 50 | { 51 | return base.mWildcards(term, ref raw); 52 | } 53 | } 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /vsCommandEventTest/SobaAcs.cs: -------------------------------------------------------------------------------- 1 | using net.r_eg.SobaScript; 2 | using net.r_eg.Varhead; 3 | 4 | namespace net.r_eg.vsCE.Test 5 | { 6 | internal static class SobaAcs 7 | { 8 | public static ISobaScript MakeNew() 9 | => MakeNew(new StubEnv()); 10 | 11 | public static ISobaScript MakeNew(IEnvironment env) 12 | => Bootloader.Configure(new Soba(), env); 13 | 14 | public static ISobaScript MakeNew(IUVars uvars) 15 | => MakeNew(uvars, new StubEnv()); 16 | 17 | public static ISobaScript MakeNew(IUVars uvars, IEnvironment env) 18 | => Bootloader.Configure(new Soba(uvars), env); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vsCommandEventTest/StubEnv.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.IO; 3 | using Microsoft.Build.Evaluation; 4 | using net.r_eg.MvsSln; 5 | using net.r_eg.MvsSln.Core; 6 | 7 | namespace net.r_eg.vsCE.Test 8 | { 9 | public class StubEnv: IsolatedEnv, IEnvironment 10 | { 11 | public override string SolutionFile 12 | { 13 | get => SlnParser.MEM_FILE; 14 | } 15 | 16 | public override Project getProject(string name = null) 17 | { 18 | return new Project(slnProperties, null, ProjectCollection.GlobalProjectCollection); 19 | } 20 | 21 | /// Solution properties. 22 | public StubEnv(Dictionary properties) 23 | : base(properties) 24 | { 25 | 26 | } 27 | 28 | [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times")] 29 | public StubEnv() 30 | : this(new Dictionary() { { PropertyNames.CONFIG, "Debug" }, { PropertyNames.PLATFORM, "x86" } }) 31 | { 32 | using(var ms = new MemoryStream()) 33 | using(var stream = new StreamReader(ms)) 34 | { 35 | Sln = new SlnParser().Parse(stream, SlnItems.None); 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vsCommandEventTest/TempFile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.IO; 4 | using Xunit; 5 | 6 | namespace net.r_eg.vsCE.Test 7 | { 8 | internal sealed class TempFile: IDisposable 9 | { 10 | public string Dir { get; private set; } 11 | 12 | public string FullPath { get; private set; } 13 | 14 | public TempFile(bool insideDir = false, string ext = null) 15 | { 16 | string path = Path.GetTempPath(); 17 | string name = Guid.NewGuid().ToString(); 18 | 19 | if(ext != null) { 20 | name += ext; 21 | } 22 | 23 | FullPath = Path.Combine(path, name); 24 | if(insideDir) 25 | { 26 | Dir = Directory.CreateDirectory(FullPath).FullName; 27 | FullPath = Path.Combine(Dir, name); 28 | } 29 | using FileStream f = File.Create(FullPath); 30 | } 31 | 32 | #region IDisposable 33 | 34 | private bool disposed; 35 | 36 | private void Dispose(bool _) 37 | { 38 | if(!disposed) 39 | { 40 | try 41 | { 42 | File.Delete(FullPath); 43 | if(Dir != null) Directory.Delete(Dir); 44 | } 45 | catch(Exception ex) 46 | { 47 | Debug.Assert(false, $"Failed disposing: {ex.Message}"); 48 | } 49 | disposed = true; 50 | } 51 | } 52 | 53 | public void Dispose() 54 | { 55 | Dispose(true); 56 | GC.SuppressFinalize(this); 57 | } 58 | 59 | #endregion 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /vsCommandEventTest/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | --------------------------------------------------------------------------------