├── .gitignore ├── Doc ├── Images │ ├── AddGroupIcon.png │ ├── AddIcon.png │ ├── ContextMenuGroup.png │ ├── ContextMenuItem.png │ ├── CopyCommandlineIcon.png │ ├── MainWindow.png │ ├── MoveDownIcon.png │ ├── MoveUpIcon.png │ ├── RemoveIcon.png │ ├── SettingsIcon.png │ └── ShowAllProjectsIcon.png ├── SmartCommandLineIcon-Readme.png └── SmartCommandLineIcon.svg ├── GatherVsixFiles.ps1 ├── LICENSE.txt ├── MarketplaceOverview.md ├── README.md ├── SmartCmdArgs ├── .editorconfig ├── SharedResources │ ├── CmdArgsPackage.cs │ ├── CmdArgsPackage.vsct │ ├── Key.snk │ ├── Monikers │ │ ├── CopyCmdLine.xaml │ │ ├── FoProjectNode.xaml │ │ ├── FoProjectNodeOld.xaml │ │ └── SVGs │ │ │ ├── CopyCmdLine.svg │ │ │ ├── FoProjectNode.svg │ │ │ └── FoProjectNodeOld.svg │ ├── Resources │ │ ├── BigIcon.png │ │ ├── SmartCommandLineIcon.ico │ │ ├── VSMeuIcon.png │ │ └── vsix_preview_image.png │ └── VSPackage.resx ├── SmartCmdArgs.Shared │ ├── CmdArgsOptionPage.cs │ ├── CmdArgsPackage.cs │ ├── Commands.cs │ ├── CustomMonikers.cs │ ├── DataSerialization │ │ ├── DataSerializer.cs │ │ ├── JsonDataObjects.cs │ │ ├── ProjectDataSerializer.cs │ │ ├── SettingsSerializer.cs │ │ ├── SolutionDataSerializer.cs │ │ └── SuoDataSerializer.cs │ ├── Helper │ │ ├── BindingListEx.cs │ │ ├── CpsProjectSupport.cs │ │ ├── Debouncer.cs │ │ ├── DelayExecution.cs │ │ ├── EnumDescConverter.cs │ │ ├── Extensions.cs │ │ ├── FileSystemWatcherDisabledContext.cs │ │ ├── FolderSelectDialog.cs │ │ ├── Logger.cs │ │ ├── ObservableCollectionEx.cs │ │ ├── ObservableDictionary.cs │ │ ├── ObservableItemsRangeCollection.cs │ │ ├── ObservableRangeCollection.cs │ │ ├── PathHelper.cs │ │ ├── PropertyChangedBase.cs │ │ ├── RelayCommand.cs │ │ ├── SymbolicLinkUtils.cs │ │ └── TreeHelper.cs │ ├── Services │ │ ├── FileStorageEventHandlingService.cs │ │ ├── FileStorageService.cs │ │ ├── ItemAggregationService.cs │ │ ├── ItemEvaluationService.cs │ │ ├── ItemPathService.cs │ │ ├── LifeCycleService.cs │ │ ├── OptionsSettingsEventHandlingService.cs │ │ ├── OptionsSettingsService.cs │ │ ├── ProjectConfigService.cs │ │ ├── SettingsService.cs │ │ ├── SuoDataService.cs │ │ ├── ToolWindowHistory.cs │ │ ├── TreeViewEventHandlingService.cs │ │ ├── Utils │ │ │ ├── AbstractFactory.cs │ │ │ ├── AsyncInitializable.cs │ │ │ └── LazyServiceExtension.cs │ │ ├── ViewModelUpdateService.cs │ │ ├── VisualStudioHelperService.cs │ │ └── VsEventHandlingService.cs │ ├── SmartCmdArgs.Shared.projitems │ ├── SmartCmdArgs.Shared.shproj │ ├── ToolWindow.cs │ ├── View │ │ ├── ArgumentItemView.xaml │ │ ├── ArgumentItemView.xaml.cs │ │ ├── Converter │ │ │ ├── BoolToBoolConverter.cs │ │ │ ├── BoolToBoolMultiConverter.cs │ │ │ ├── BoolToVisibilityConverter.cs │ │ │ ├── BoolToVisibilityMultiConverter.cs │ │ │ ├── BooleanBoldFontConverter.cs │ │ │ ├── ConverterBase.cs │ │ │ ├── EmptyToVisibilityConverter.cs │ │ │ ├── FontSizeConverter.cs │ │ │ ├── ItemMonikerConverter.cs │ │ │ ├── ItemTagTextConverter.cs │ │ │ ├── ItemTagVisibilityConverter.cs │ │ │ ├── ItemVisibilityConverter.cs │ │ │ ├── MultiConverterBase.cs │ │ │ ├── NullToVisibilityConverter.cs │ │ │ ├── NullToVisibilityMultiConverter.cs │ │ │ ├── StringConcatConverter.cs │ │ │ └── TreeLevelMarginConverter.cs │ │ ├── DragDrop.cs │ │ ├── DropTargetAdorner.cs │ │ ├── RedBorderAdorner.cs │ │ ├── SetCustomDelimiterControl.xaml │ │ ├── SetCustomDelimiterControl.xaml.cs │ │ ├── SetCustomDelimiterDialog.cs │ │ ├── SettingsControl.xaml │ │ ├── SettingsControl.xaml.cs │ │ ├── SettingsDialog.cs │ │ ├── ToggleButtonEx.cs │ │ ├── ToolWindowControl.xaml │ │ ├── ToolWindowControl.xaml.cs │ │ ├── TreeItemStyleSelector.cs │ │ ├── TreeViewEx.cs │ │ ├── TreeViewStyles.xaml │ │ └── UserControls │ │ │ ├── SettingsCheckBox.xaml │ │ │ └── SettingsCheckBox.xaml.cs │ ├── ViewModel │ │ ├── CmdBase.cs │ │ ├── CmdContainer.cs │ │ ├── CmdGroup.cs │ │ ├── CmdItem.cs │ │ ├── CmdProject.cs │ │ ├── DataObjectGenerator.cs │ │ ├── SettingsViewModel.cs │ │ ├── ToolWindowViewModel.cs │ │ ├── TreeEvents.cs │ │ └── TreeViewModel.cs │ └── Wrapper │ │ └── IVsHierarchyWrapper.cs ├── SmartCmdArgs.sln ├── SmartCmdArgs15 │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SmartCmdArgs15.args.json │ ├── SmartCmdArgs15.csproj │ ├── SmartCmdArgs15.imagemanifest │ ├── source.extension.cs │ └── source.extension.vsixmanifest ├── SmartCmdArgs16 │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SmartCmdArgs16.args.json │ ├── SmartCmdArgs16.csproj │ ├── SmartCmdArgs16.imagemanifest │ ├── source.extension.cs │ └── source.extension.vsixmanifest ├── SmartCmdArgs17 │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SmartCmdArgs17.args.json │ ├── SmartCmdArgs17.csproj │ ├── SmartCmdArgs17.imagemanifest │ ├── source.extension.cs │ └── source.extension.vsixmanifest └── Testing │ ├── SmartCmdArgs.Tests.Shared │ ├── LanguageSpecificTests.cs │ ├── SmartCmdArgs.Tests.Shared.projitems │ ├── SmartCmdArgs.Tests.Shared.shproj │ ├── TestBase.cs │ ├── UiActionTests.cs │ └── Utils │ │ ├── Config.cs │ │ └── Helper.cs │ ├── SmartCmdArgs.Tests │ ├── Services │ │ ├── ItemAggregationServiceTests.cs │ │ ├── ItemEvaluationServiceTests.cs │ │ └── ItemPathServiceTests.cs │ ├── SmartCmdArgs.Tests.csproj │ └── Utils │ │ └── Extensions.cs │ ├── SmartCmdArgs15.Tests │ └── SmartCmdArgs15.Tests.csproj │ ├── SmartCmdArgs16.Tests │ └── SmartCmdArgs16.Tests.csproj │ ├── SmartCmdArgs17.Tests │ └── SmartCmdArgs17.Tests.csproj │ └── TestSolutions │ ├── C#_.NetCore │ ├── CollectArgsDistinctTest │ │ ├── Project1 │ │ │ ├── Program.cs │ │ │ ├── Project1.csproj │ │ │ └── Properties │ │ │ │ └── launchSettings.json │ │ └── Solution.sln │ ├── CollectArgsTest │ │ ├── Project1 │ │ │ ├── Program.cs │ │ │ ├── Project1.csproj │ │ │ └── Properties │ │ │ │ └── launchSettings.json │ │ ├── Solution.ArgsCfg.json │ │ └── Solution.sln │ ├── DefaultProject │ │ ├── Project1 │ │ │ ├── Program.cs │ │ │ └── Project1.csproj │ │ └── Solution.sln │ └── ReadCmdArgsProject │ │ ├── Project1 │ │ ├── Program.cs │ │ └── Project1.csproj │ │ └── Solution.sln │ ├── C#_.NetFW │ ├── CollectArgsDistinctTest │ │ ├── Project1 │ │ │ ├── App.config │ │ │ ├── Program.cs │ │ │ ├── Project1.csproj │ │ │ ├── Project1.csproj.user │ │ │ └── Properties │ │ │ │ └── AssemblyInfo.cs │ │ └── Solution.sln │ ├── CollectArgsTest │ │ ├── Project1 │ │ │ ├── App.config │ │ │ ├── Program.cs │ │ │ ├── Project1.csproj │ │ │ ├── Project1.csproj.user │ │ │ └── Properties │ │ │ │ └── AssemblyInfo.cs │ │ ├── Solution.ArgsCfg.json │ │ └── Solution.sln │ ├── DefaultProject │ │ ├── Project1 │ │ │ ├── App.config │ │ │ ├── Program.cs │ │ │ ├── Project1.csproj │ │ │ └── Properties │ │ │ │ └── AssemblyInfo.cs │ │ └── Solution.sln │ └── ReadCmdArgsProject │ │ ├── Project1 │ │ ├── App.config │ │ ├── Program.cs │ │ ├── Project1.csproj │ │ └── Properties │ │ │ └── AssemblyInfo.cs │ │ └── Solution.sln │ ├── C++ │ ├── CollectArgsDistinctTest │ │ ├── Project1 │ │ │ ├── Project1.cpp │ │ │ ├── Project1.vcxproj │ │ │ ├── Project1.vcxproj.filters │ │ │ ├── Project1.vcxproj.user │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ │ └── Solution.sln │ ├── CollectArgsTest │ │ ├── Project1 │ │ │ ├── Project1.cpp │ │ │ ├── Project1.vcxproj │ │ │ ├── Project1.vcxproj.filters │ │ │ ├── Project1.vcxproj.user │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ │ ├── Solution.ArgsCfg.json │ │ └── Solution.sln │ ├── DefaultProject │ │ ├── Project1 │ │ │ ├── Project1.cpp │ │ │ ├── Project1.vcxproj │ │ │ ├── Project1.vcxproj.filters │ │ │ ├── ReadMe.txt │ │ │ ├── stdafx.cpp │ │ │ ├── stdafx.h │ │ │ └── targetver.h │ │ └── Solution.sln │ └── ReadCmdArgsProject │ │ ├── Project1 │ │ ├── Project1.cpp │ │ ├── Project1.vcxproj │ │ ├── Project1.vcxproj.filters │ │ ├── ReadMe.txt │ │ ├── stdafx.cpp │ │ ├── stdafx.h │ │ └── targetver.h │ │ └── Solution.sln │ ├── F#_.NetFW │ ├── CollectArgsDistinctTest │ │ ├── Project1 │ │ │ ├── App.config │ │ │ ├── AssemblyInfo.fs │ │ │ ├── Program.fs │ │ │ └── Project1.fsproj │ │ └── Solution.sln │ ├── CollectArgsTest │ │ ├── Project1 │ │ │ ├── App.config │ │ │ ├── AssemblyInfo.fs │ │ │ ├── Program.fs │ │ │ └── Project1.fsproj │ │ ├── Solution.ArgsCfg.json │ │ └── Solution.sln │ ├── DefaultProject │ │ ├── Project1 │ │ │ ├── App.config │ │ │ ├── AssemblyInfo.fs │ │ │ ├── Program.fs │ │ │ └── Project1.fsproj │ │ └── Solution.sln │ └── ReadCmdArgsProject │ │ ├── Project1 │ │ ├── App.config │ │ ├── AssemblyInfo.fs │ │ ├── Program.fs │ │ └── Project1.fsproj │ │ └── Solution.sln │ ├── Node.js │ ├── CollectArgsDistinctTest │ │ ├── Project1 │ │ │ ├── Project1.njsproj │ │ │ ├── README.md │ │ │ ├── Scripts │ │ │ │ └── typings │ │ │ │ │ └── node │ │ │ │ │ └── node.d.ts │ │ │ ├── app.ts │ │ │ └── package.json │ │ └── Solution.sln │ ├── CollectArgsTest │ │ ├── Project1 │ │ │ ├── Project1.njsproj │ │ │ ├── README.md │ │ │ ├── Scripts │ │ │ │ └── typings │ │ │ │ │ └── node │ │ │ │ │ └── node.d.ts │ │ │ ├── app.ts │ │ │ └── package.json │ │ ├── Solution.ArgsCfg.json │ │ └── Solution.sln │ ├── DefaultProject │ │ ├── Project1 │ │ │ ├── Project1.njsproj │ │ │ ├── README.md │ │ │ ├── Scripts │ │ │ │ └── typings │ │ │ │ │ └── node │ │ │ │ │ └── node.d.ts │ │ │ ├── app.ts │ │ │ └── package.json │ │ └── Solution.sln │ └── ReadCmdArgsProject │ │ ├── Project1 │ │ ├── Project1.njsproj │ │ ├── README.md │ │ ├── Scripts │ │ │ └── typings │ │ │ │ └── node │ │ │ │ └── node.d.ts │ │ ├── app.ts │ │ └── package.json │ │ └── Solution.sln │ └── VB_.NetFW │ ├── CollectArgsDistinctTest │ ├── Project1 │ │ ├── App.config │ │ ├── Module1.vb │ │ ├── My Project │ │ │ ├── Application.Designer.vb │ │ │ ├── Application.myapp │ │ │ ├── AssemblyInfo.vb │ │ │ ├── Resources.Designer.vb │ │ │ ├── Resources.resx │ │ │ ├── Settings.Designer.vb │ │ │ └── Settings.settings │ │ ├── Project1.vbproj │ │ └── Project1.vbproj.user │ └── Solution.sln │ ├── CollectArgsTest │ ├── Project1 │ │ ├── App.config │ │ ├── Module1.vb │ │ ├── My Project │ │ │ ├── Application.Designer.vb │ │ │ ├── Application.myapp │ │ │ ├── AssemblyInfo.vb │ │ │ ├── Resources.Designer.vb │ │ │ ├── Resources.resx │ │ │ ├── Settings.Designer.vb │ │ │ └── Settings.settings │ │ ├── Project1.vbproj │ │ └── Project1.vbproj.user │ ├── Solution.ArgsCfg.json │ └── Solution.sln │ ├── DefaultProject │ ├── Project1 │ │ ├── App.config │ │ ├── Module1.vb │ │ ├── My Project │ │ │ ├── Application.Designer.vb │ │ │ ├── Application.myapp │ │ │ ├── AssemblyInfo.vb │ │ │ ├── Resources.Designer.vb │ │ │ ├── Resources.resx │ │ │ ├── Settings.Designer.vb │ │ │ └── Settings.settings │ │ └── Project1.vbproj │ └── Solution.sln │ └── ReadCmdArgsProject │ ├── Project1 │ ├── App.config │ ├── Module1.vb │ ├── My Project │ │ ├── Application.Designer.vb │ │ ├── Application.myapp │ │ ├── AssemblyInfo.vb │ │ ├── Resources.Designer.vb │ │ ├── Resources.resx │ │ ├── Settings.Designer.vb │ │ └── Settings.settings │ └── Project1.vbproj │ └── Solution.sln └── TestProjects ├── BlaBlubb_RenameDummy ├── App.config ├── BlaBlubb_RenameDummy.csproj ├── Program.cs └── Properties │ └── AssemblyInfo.cs ├── CPP_Windows ├── CPP_Windows.cpp ├── CPP_Windows.vcxproj ├── CPP_Windows.vcxproj.filters ├── pch.cpp └── pch.h ├── CS_DotNetCore ├── CS_DotNetCore.csproj └── Program.cs ├── CS_DotNetFramework ├── App.config ├── CS_DotNetFramework.csproj ├── Program.cs └── Properties │ └── AssemblyInfo.cs ├── FS_DotNetCore ├── FS_DotNetCore.fsproj └── Program.fs ├── JS_NodeJS ├── JS_NodeJS.njsproj ├── README.md ├── app.js └── package.json ├── PY_Python ├── PY_Python.py └── PY_Python.pyproj ├── TestProjects.sln ├── VB_DotNetCore ├── Program.vb └── VB_DotNetCore.vbproj └── VB_DotNetFramework ├── App.config ├── My Project ├── Application.Designer.vb ├── Application.myapp ├── AssemblyInfo.vb ├── Resources.Designer.vb ├── Resources.resx ├── Settings.Designer.vb └── Settings.settings ├── Program.vb └── VB_DotNetFramework.vbproj /Doc/Images/AddGroupIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MBulli/SmartCommandlineArgs/62008494db06786418797eab09f3174180a9b3ed/Doc/Images/AddGroupIcon.png -------------------------------------------------------------------------------- /Doc/Images/AddIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MBulli/SmartCommandlineArgs/62008494db06786418797eab09f3174180a9b3ed/Doc/Images/AddIcon.png -------------------------------------------------------------------------------- /Doc/Images/ContextMenuGroup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MBulli/SmartCommandlineArgs/62008494db06786418797eab09f3174180a9b3ed/Doc/Images/ContextMenuGroup.png -------------------------------------------------------------------------------- /Doc/Images/ContextMenuItem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MBulli/SmartCommandlineArgs/62008494db06786418797eab09f3174180a9b3ed/Doc/Images/ContextMenuItem.png -------------------------------------------------------------------------------- /Doc/Images/CopyCommandlineIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MBulli/SmartCommandlineArgs/62008494db06786418797eab09f3174180a9b3ed/Doc/Images/CopyCommandlineIcon.png -------------------------------------------------------------------------------- /Doc/Images/MainWindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MBulli/SmartCommandlineArgs/62008494db06786418797eab09f3174180a9b3ed/Doc/Images/MainWindow.png -------------------------------------------------------------------------------- /Doc/Images/MoveDownIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MBulli/SmartCommandlineArgs/62008494db06786418797eab09f3174180a9b3ed/Doc/Images/MoveDownIcon.png -------------------------------------------------------------------------------- /Doc/Images/MoveUpIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MBulli/SmartCommandlineArgs/62008494db06786418797eab09f3174180a9b3ed/Doc/Images/MoveUpIcon.png -------------------------------------------------------------------------------- /Doc/Images/RemoveIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MBulli/SmartCommandlineArgs/62008494db06786418797eab09f3174180a9b3ed/Doc/Images/RemoveIcon.png -------------------------------------------------------------------------------- /Doc/Images/SettingsIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MBulli/SmartCommandlineArgs/62008494db06786418797eab09f3174180a9b3ed/Doc/Images/SettingsIcon.png -------------------------------------------------------------------------------- /Doc/Images/ShowAllProjectsIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MBulli/SmartCommandlineArgs/62008494db06786418797eab09f3174180a9b3ed/Doc/Images/ShowAllProjectsIcon.png -------------------------------------------------------------------------------- /Doc/SmartCommandLineIcon-Readme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MBulli/SmartCommandlineArgs/62008494db06786418797eab09f3174180a9b3ed/Doc/SmartCommandLineIcon-Readme.png -------------------------------------------------------------------------------- /GatherVsixFiles.ps1: -------------------------------------------------------------------------------- 1 | $tag = git describe --tags 2 | 3 | if ($LastExitCode -eq 0 -and -not [string]::IsNullOrWhiteSpace($tag)) { 4 | $filesMap = @{ 5 | "SmartCmdArgs\SmartCmdArgs15\bin\Release\SmartCmdArgs15.vsix" = "SmartCmdArgs-vs2017-{0}.vsix"; 6 | "SmartCmdArgs\SmartCmdArgs16\bin\Release\SmartCmdArgs16.vsix" = "SmartCmdArgs-vs2019-{0}.vsix"; 7 | "SmartCmdArgs\SmartCmdArgs17\bin\Release\SmartCmdArgs17.vsix" = "SmartCmdArgs-vs2022-{0}.vsix"; 8 | } 9 | 10 | foreach ($file in $filesMap.Keys) { 11 | $newFileName = $filesMap[$file] -f $tag 12 | $destinationPath = ".\$newFileName" 13 | Copy-Item $file -Destination $destinationPath 14 | 15 | if ($LastExitCode -eq 0) { 16 | Write-Host "Copied and renamed $file to $newFileName successfully." 17 | } else { 18 | Write-Host "Failed to copy $file." 19 | } 20 | } 21 | } else { 22 | Write-Host "Failed to get the latest git tag." 23 | } -------------------------------------------------------------------------------- /SmartCmdArgs/.editorconfig: -------------------------------------------------------------------------------- 1 | [*Tests.cs] 2 | dotnet_diagnostic.VSTHRD200.severity = none -------------------------------------------------------------------------------- /SmartCmdArgs/SharedResources/Key.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MBulli/SmartCommandlineArgs/62008494db06786418797eab09f3174180a9b3ed/SmartCmdArgs/SharedResources/Key.snk -------------------------------------------------------------------------------- /SmartCmdArgs/SharedResources/Monikers/CopyCmdLine.xaml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /SmartCmdArgs/SharedResources/Monikers/FoProjectNode.xaml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /SmartCmdArgs/SharedResources/Monikers/FoProjectNodeOld.xaml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /SmartCmdArgs/SharedResources/Monikers/SVGs/CopyCmdLine.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 18 | 38 | 42 | 47 | 51 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /SmartCmdArgs/SharedResources/Resources/BigIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MBulli/SmartCommandlineArgs/62008494db06786418797eab09f3174180a9b3ed/SmartCmdArgs/SharedResources/Resources/BigIcon.png -------------------------------------------------------------------------------- /SmartCmdArgs/SharedResources/Resources/SmartCommandLineIcon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MBulli/SmartCommandlineArgs/62008494db06786418797eab09f3174180a9b3ed/SmartCmdArgs/SharedResources/Resources/SmartCommandLineIcon.ico -------------------------------------------------------------------------------- /SmartCmdArgs/SharedResources/Resources/VSMeuIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MBulli/SmartCommandlineArgs/62008494db06786418797eab09f3174180a9b3ed/SmartCmdArgs/SharedResources/Resources/VSMeuIcon.png -------------------------------------------------------------------------------- /SmartCmdArgs/SharedResources/Resources/vsix_preview_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MBulli/SmartCommandlineArgs/62008494db06786418797eab09f3174180a9b3ed/SmartCmdArgs/SharedResources/Resources/vsix_preview_image.png -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/CustomMonikers.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.Imaging.Interop; 2 | using System; 3 | 4 | namespace SmartCmdArgs 5 | { 6 | internal class CustomMonikers 7 | { 8 | private static readonly Guid ManifestGuid = new Guid("cafdbdaf-1847-4824-8957-a169d25d0cfb"); 9 | 10 | public static ImageMoniker FoProjectNode => new ImageMoniker { Guid = ManifestGuid, Id = 0 }; 11 | public static ImageMoniker CopyCmdLine => new ImageMoniker { Guid = ManifestGuid, Id = 1 }; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/DataSerialization/DataSerializer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using SmartCmdArgs.ViewModel; 3 | 4 | namespace SmartCmdArgs.DataSerialization 5 | { 6 | class DataSerializer 7 | { 8 | protected static List TransformCmdList(ICollection items) 9 | { 10 | var result = new List(items.Count); 11 | foreach (var item in items) 12 | { 13 | var newElement = new CmdItemJson 14 | { 15 | Id = item.Id, 16 | Command = item.Value, 17 | ProjectConfig = item.ProjectConfig, 18 | ProjectPlatform = item.ProjectPlatform, 19 | LaunchProfile = item.LaunchProfile, 20 | 21 | // not in JSON 22 | Selected = item.IsSelected, 23 | }; 24 | 25 | if (item is CmdParameter param) 26 | { 27 | newElement.DefaultChecked = param.DefaultChecked; 28 | newElement.Type = param.ParamType; 29 | 30 | // not in JSON 31 | newElement.Enabled = item.IsChecked ?? false; 32 | } 33 | 34 | if (item is CmdContainer container) 35 | { 36 | newElement.Items = TransformCmdList(container.Items); 37 | newElement.ExclusiveMode = container.ExclusiveMode; 38 | newElement.Delimiter = container.Delimiter; 39 | newElement.Prefix = container.Prefix; 40 | newElement.Postfix = container.Postfix; 41 | 42 | // not in JSON 43 | newElement.Expanded = container.IsExpanded; 44 | } 45 | 46 | result.Add(newElement); 47 | } 48 | return result; 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/DataSerialization/SettingsSerializer.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using SmartCmdArgs.Helper; 3 | using SmartCmdArgs.ViewModel; 4 | using System; 5 | 6 | namespace SmartCmdArgs.DataSerialization 7 | { 8 | public class SettingsSerializer 9 | { 10 | public static string Serialize(SettingsViewModel vm) 11 | { 12 | if (vm == null) 13 | throw new ArgumentNullException(nameof(vm)); 14 | 15 | var data = new SettingsJson(vm); 16 | 17 | return JsonConvert.SerializeObject(data, Formatting.Indented, new JsonSerializerSettings { DefaultValueHandling = DefaultValueHandling.Ignore }); 18 | } 19 | 20 | public static SettingsJson Deserialize(string jsonStr) 21 | { 22 | Logger.Info($"Try to parse settings json: '{jsonStr}'"); 23 | 24 | if (string.IsNullOrEmpty(jsonStr)) 25 | { 26 | // If the file is empty return empty solution data 27 | Logger.Info("Got empty settings json string. Returning default SettingsJson"); 28 | return new SettingsJson(); 29 | } 30 | 31 | return JsonConvert.DeserializeObject(jsonStr); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/Helper/DelayExecution.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.Shell; 2 | using Microsoft.VisualStudio.Threading; 3 | using System; 4 | using System.Threading; 5 | using Task = System.Threading.Tasks.Task; 6 | 7 | namespace SmartCmdArgs.Helper 8 | { 9 | static class DelayExecution 10 | { 11 | internal static void ExecuteAfter(TimeSpan delay, Action action) 12 | { 13 | ExecuteAfter(delay, CancellationToken.None, action); 14 | } 15 | 16 | internal static void ExecuteAfter(TimeSpan delay, CancellationToken cancelToken, Action action) 17 | { 18 | ThreadHelper.JoinableTaskFactory.RunAsync(async () => 19 | { 20 | await Task.Delay(delay, cancelToken); 21 | 22 | if (!cancelToken.IsCancellationRequested) 23 | { 24 | action(); 25 | } 26 | }).Task.Forget(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/Helper/Extensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace SmartCmdArgs.Helper 6 | { 7 | static class Extensions 8 | { 9 | public static T GetValueOrDefault(this IDictionary dict, K key, T defaultValue = default(T)) 10 | { 11 | T item; 12 | return dict.TryGetValue(key, out item) ? item : defaultValue; 13 | } 14 | 15 | public static FileSystemWatcherDisabledContext TemporarilyDisable(this System.IO.FileSystemWatcher watcher) 16 | { 17 | return new FileSystemWatcherDisabledContext(watcher); 18 | } 19 | 20 | public static bool Contains(this string str, string value, StringComparison comparisonType) 21 | { 22 | return str.IndexOf(value, comparisonType) >= 0; 23 | } 24 | 25 | public static void ForEach(this IEnumerable enumerable, Action action) 26 | { 27 | foreach (var item in enumerable) 28 | { 29 | action(item); 30 | } 31 | } 32 | 33 | public static void AddRange(this HashSet that, IEnumerable items) 34 | { 35 | foreach (var item in items) 36 | { 37 | that.Add(item); 38 | } 39 | } 40 | 41 | public static bool HasMultipleItems(this IEnumerable enumerable) 42 | { 43 | return enumerable.Skip(1).Any(); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/Helper/FileSystemWatcherDisabledContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace SmartCmdArgs.Helper 5 | { 6 | class FileSystemWatcherDisabledContext : IDisposable 7 | { 8 | private FileSystemWatcher watcher; 9 | 10 | public FileSystemWatcherDisabledContext(FileSystemWatcher watcher) 11 | { 12 | this.watcher = watcher; 13 | 14 | if (this.watcher != null) 15 | { 16 | this.watcher.EnableRaisingEvents = false; 17 | } 18 | } 19 | 20 | public void Dispose() 21 | { 22 | if (watcher != null) 23 | { 24 | this.watcher.EnableRaisingEvents = true; 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/Helper/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using Microsoft.VisualStudio.Shell; 4 | 5 | namespace SmartCmdArgs.Helper 6 | { 7 | static class Logger 8 | { 9 | private static string LogSource = "SmartCommandlineArgs"; 10 | 11 | public static void Info(string message) 12 | { 13 | ActivityLog.TryLogInformation(LogSource, PrependThreadId(message)); 14 | WriteToDebugConsole("Info", message); 15 | } 16 | 17 | public static void Warn(string message) 18 | { 19 | ActivityLog.TryLogWarning(LogSource, PrependThreadId(message)); 20 | WriteToDebugConsole("Warning", message); 21 | } 22 | 23 | public static void Error(string message, Exception ex = null) 24 | { 25 | ActivityLog.TryLogError(LogSource, AppendException(PrependThreadId(message), ex)); 26 | WriteToDebugConsole("Error", message, ex); 27 | } 28 | 29 | [Conditional("DEBUG")] 30 | private static void WriteToDebugConsole(string type, string message, Exception ex = null) 31 | { 32 | Debug.WriteLine($"{LogSource}[{System.Threading.Thread.CurrentThread.ManagedThreadId}]|{type}: {AppendException(message, ex)}"); 33 | } 34 | 35 | private static string PrependThreadId(string message) 36 | { 37 | return $"[{System.Threading.Thread.CurrentThread.ManagedThreadId}] {message}"; 38 | } 39 | 40 | private static string AppendException(string message, Exception ex) 41 | { 42 | if (ex == null) 43 | return message; 44 | 45 | return message + Environment.NewLine + ex.ToString(); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/Helper/RelayCommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Windows.Input; 4 | 5 | namespace SmartCmdArgs.Helper 6 | { 7 | public class RelayCommand : ICommand 8 | { 9 | #region Fields 10 | 11 | readonly Action execute; 12 | readonly Predicate canExecute; 13 | 14 | #endregion 15 | 16 | #region Constructors 17 | 18 | public RelayCommand(Action execute) 19 | : this(execute, null) 20 | { 21 | } 22 | 23 | public RelayCommand(Action execute, Predicate canExecute) 24 | { 25 | if (execute == null) 26 | throw new ArgumentNullException("execute"); 27 | 28 | this.execute = execute; 29 | this.canExecute = canExecute; 30 | } 31 | #endregion 32 | 33 | #region ICommand Members 34 | 35 | [DebuggerStepThrough] 36 | public bool CanExecute(object parameter) 37 | { 38 | return canExecute == null || canExecute((T)parameter); 39 | } 40 | 41 | public event EventHandler CanExecuteChanged 42 | { 43 | add { CommandManager.RequerySuggested += value; } 44 | remove { CommandManager.RequerySuggested -= value; } 45 | } 46 | 47 | public void Execute(object parameter) 48 | { 49 | execute((T)parameter); 50 | } 51 | 52 | #endregion 53 | } 54 | 55 | public class RelayCommand : RelayCommand 56 | { 57 | #region Constructors 58 | 59 | public RelayCommand(Action execute) 60 | : this(execute, null) 61 | {} 62 | 63 | public RelayCommand(Action execute, Predicate canExecute) 64 | : base(x => execute(), canExecute) {} 65 | #endregion 66 | } 67 | 68 | public static class CommandExtensions 69 | { 70 | public static bool SafeExecute(this ICommand command, object obj = null) 71 | { 72 | if (!command.CanExecute(obj)) 73 | return false; 74 | 75 | command.Execute(obj); 76 | return true; 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/Services/SettingsService.cs: -------------------------------------------------------------------------------- 1 | using SmartCmdArgs.DataSerialization; 2 | using SmartCmdArgs.ViewModel; 3 | 4 | namespace SmartCmdArgs.Services 5 | { 6 | public interface ISettingsService 7 | { 8 | bool Loaded { get; } 9 | 10 | void Load(); 11 | void Save(); 12 | void Reset(); 13 | } 14 | 15 | internal class SettingsService : ISettingsService 16 | { 17 | private readonly SettingsViewModel settingsViewModel; 18 | private readonly IFileStorageService fileStorage; 19 | private readonly ISuoDataService suoData; 20 | 21 | public bool Loaded { get; set; } 22 | 23 | public SettingsService(SettingsViewModel settingsViewModel, IFileStorageService fileStorage, ISuoDataService suoData) 24 | { 25 | this.settingsViewModel = settingsViewModel; 26 | this.fileStorage = fileStorage; 27 | this.suoData = suoData; 28 | } 29 | 30 | public void Save() 31 | { 32 | fileStorage.SaveSettings(); 33 | } 34 | 35 | public void Load() 36 | { 37 | var settings = fileStorage.ReadSettings(); 38 | 39 | var areSettingsFromFile = settings != null; 40 | 41 | if (settings == null) 42 | settings = suoData.SuoDataJson.Settings; 43 | 44 | if (settings == null) 45 | settings = new SettingsJson(); 46 | 47 | settingsViewModel.Assign(settings); 48 | settingsViewModel.SaveSettingsToJson = areSettingsFromFile; 49 | 50 | Loaded = true; 51 | } 52 | 53 | public void Reset() 54 | { 55 | Loaded = false; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/Services/Utils/AbstractFactory.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using System; 3 | 4 | namespace SmartCmdArgs.Services 5 | { 6 | public static class FactoryServiceExtension 7 | { 8 | public static void AddFactory(this IServiceCollection services) 9 | where T : class 10 | { 11 | services.AddTransient(); 12 | services.AddSingleton, Factory>(); 13 | } 14 | } 15 | 16 | public interface IFactory 17 | { 18 | T Create(); 19 | } 20 | 21 | internal class Factory : IFactory 22 | { 23 | private readonly IServiceProvider serviceProvider; 24 | 25 | public Factory(IServiceProvider serviceProvider) 26 | { 27 | this.serviceProvider = serviceProvider; 28 | } 29 | 30 | public T Create() 31 | { 32 | return serviceProvider.GetRequiredService(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/Services/Utils/AsyncInitializable.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace SmartCmdArgs.Services 4 | { 5 | internal interface IAsyncInitializable 6 | { 7 | Task InitializeAsync(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/Services/Utils/LazyServiceExtension.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using System; 3 | 4 | namespace SmartCmdArgs.Services.Utils 5 | { 6 | public static class LazyServiceExtension 7 | { 8 | public static void AddLazySingleton(this IServiceCollection services) 9 | where TService : class 10 | where TImplementation : class, TService 11 | { 12 | services.AddSingleton(); 13 | services.AddSingleton(x => new Lazy(() => x.GetRequiredService())); 14 | } 15 | 16 | public static void AddLazySingleton(this IServiceCollection services) 17 | where TService : class 18 | { 19 | services.AddSingleton(); 20 | services.AddSingleton(x => new Lazy(() => x.GetRequiredService())); 21 | } 22 | 23 | public static void AddLazySingleton(this IServiceCollection services, Func implementationFactory) 24 | where TService : class 25 | { 26 | services.AddSingleton(implementationFactory); 27 | services.AddSingleton(x => new Lazy(() => x.GetRequiredService())); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/SmartCmdArgs.Shared.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 676c8571-fc9d-43dd-948e-897817a07039 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/View/Converter/BoolToBoolConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | 4 | namespace SmartCmdArgs.View.Converter 5 | { 6 | class BoolToBoolConverter : ConverterBase 7 | { 8 | public bool NullValue { get; set; } = false; 9 | 10 | public bool Inverted { get; set; } = false; 11 | 12 | public override object Convert(object value, Type targetType, object parameter, CultureInfo culture) 13 | { 14 | if (value == null) { 15 | return Inverted != NullValue; 16 | } 17 | 18 | if (value is bool boolVal) 19 | { 20 | return Inverted != boolVal; 21 | } 22 | 23 | return null; 24 | } 25 | 26 | public override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 27 | { 28 | throw new NotImplementedException(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/View/Converter/BoolToBoolMultiConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Linq; 4 | using System.Windows; 5 | 6 | namespace SmartCmdArgs.View.Converter 7 | { 8 | class BoolToBoolMultiConverter : MultiConverterBase 9 | { 10 | public bool NullValue { get; set; } = false; 11 | 12 | public enum TrueCond { AllTrue, AnyTrue, AllFalse, AnyFalse }; 13 | 14 | public TrueCond TrueCondition { get; set; } = TrueCond.AllTrue; 15 | 16 | public Visibility HideVisibility { get; set; } = Visibility.Hidden; 17 | 18 | public override object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 19 | { 20 | switch (TrueCondition) 21 | { 22 | case TrueCond.AllTrue: 23 | return values.All(x => (bool?)x ?? NullValue); 24 | case TrueCond.AnyTrue: 25 | return values.Any(x => (bool?)x ?? NullValue); 26 | case TrueCond.AllFalse: 27 | return values.All(x => !((bool?)x ?? NullValue)); 28 | case TrueCond.AnyFalse: 29 | return values.Any(x => !((bool?)x ?? NullValue)); 30 | default: 31 | return false; 32 | } 33 | } 34 | 35 | public override object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) 36 | { 37 | throw new NotImplementedException(); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/View/Converter/BoolToVisibilityConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SmartCmdArgs.View.Converter 4 | { 5 | class BoolToVisibilityConverter : ConverterBase 6 | { 7 | public bool Inverted { get; set; } = false; 8 | 9 | public System.Windows.Visibility HideVisibility { get; set; } = System.Windows.Visibility.Collapsed; 10 | 11 | public override object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 12 | { 13 | if (value == null) 14 | return HideVisibility; 15 | if (Inverted) 16 | return (value as bool?) == true ? HideVisibility : System.Windows.Visibility.Visible; 17 | else 18 | return (value as bool?) != true ? HideVisibility : System.Windows.Visibility.Visible; 19 | } 20 | 21 | public override object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 22 | { 23 | return null; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/View/Converter/BoolToVisibilityMultiConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Linq; 4 | using System.Windows; 5 | 6 | namespace SmartCmdArgs.View.Converter 7 | { 8 | class BoolToVisibilityMultiConverter : MultiConverterBase 9 | { 10 | public bool NullValue { get; set; } = false; 11 | 12 | public enum VisibleCond { AllTrue, AnyTrue, AllFalse, AnyFalse }; 13 | 14 | public VisibleCond VisibleCondition { get; set; } = VisibleCond.AllTrue; 15 | 16 | public Visibility HideVisibility { get; set; } = Visibility.Collapsed; 17 | 18 | public override object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 19 | { 20 | bool isVisible = false; 21 | switch (VisibleCondition) 22 | { 23 | case VisibleCond.AllTrue: 24 | isVisible = values.All(x => (bool?)x ?? NullValue); break; 25 | case VisibleCond.AnyTrue: 26 | isVisible = values.Any(x => (bool?)x ?? NullValue); break; 27 | case VisibleCond.AllFalse: 28 | isVisible = values.All(x => !((bool?)x ?? NullValue)); break; 29 | case VisibleCond.AnyFalse: 30 | isVisible = values.Any(x => !((bool?)x ?? NullValue)); break; 31 | } 32 | 33 | return isVisible ? Visibility.Visible : HideVisibility; 34 | } 35 | 36 | public override object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) 37 | { 38 | throw new NotImplementedException(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/View/Converter/BooleanBoldFontConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | 4 | namespace SmartCmdArgs.View.Converter 5 | { 6 | class BooleanBoldFontConverter : ConverterBase 7 | { 8 | public override object Convert(object value, Type targetType, object parameter, CultureInfo culture) 9 | { 10 | if ((value as bool?) == true) 11 | return System.Windows.FontWeights.Bold; 12 | else 13 | return System.Windows.FontWeights.Normal; 14 | } 15 | 16 | public override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 17 | { 18 | throw new NotImplementedException(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/View/Converter/ConverterBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Data; 3 | 4 | namespace SmartCmdArgs.View.Converter 5 | { 6 | [System.Windows.Markup.MarkupExtensionReturnType(typeof(ConverterBase))] 7 | abstract class ConverterBase : System.Windows.Markup.MarkupExtension, IValueConverter 8 | { 9 | public ConverterBase() 10 | { 11 | } 12 | 13 | public override object ProvideValue(IServiceProvider serviceProvider) 14 | { 15 | return this; 16 | } 17 | 18 | public abstract object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture); 19 | public abstract object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/View/Converter/EmptyToVisibilityConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | 4 | namespace SmartCmdArgs.View.Converter 5 | { 6 | class EmptyToVisibilityConverter : ConverterBase 7 | { 8 | public EmptyToVisibilityConverter() 9 | { 10 | } 11 | 12 | public bool Inverted 13 | { 14 | get; 15 | set; 16 | } 17 | 18 | public override object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 19 | { 20 | bool empty = false; 21 | if (value is ICollection collection && collection.Count == 0) 22 | empty = true; 23 | else if (value is IEnumerable enumerable && !enumerable.GetEnumerator().MoveNext()) 24 | empty = true; 25 | 26 | if (Inverted) 27 | return !empty ? System.Windows.Visibility.Hidden : System.Windows.Visibility.Visible; 28 | else 29 | return empty ? System.Windows.Visibility.Hidden : System.Windows.Visibility.Visible; 30 | } 31 | 32 | public override object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 33 | { 34 | return null; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/View/Converter/FontSizeConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | 4 | namespace SmartCmdArgs.View.Converter 5 | { 6 | class FontSizeConverter : ConverterBase 7 | { 8 | public override object Convert(object value, Type targetType, object parameter, CultureInfo culture) 9 | { 10 | // add input parameter testing as needed. 11 | var originalFontSize = (double)value; 12 | double alteredFontSize = originalFontSize * Ratio; ; 13 | 14 | return alteredFontSize; 15 | } 16 | 17 | public override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 18 | { 19 | throw new NotImplementedException(); 20 | } 21 | 22 | // Create a ratio property 23 | // allows the converter to be used for different font ratios 24 | public double Ratio { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/View/Converter/ItemMonikerConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using Microsoft.VisualStudio.Imaging; 4 | using SmartCmdArgs.Services; 5 | using SmartCmdArgs.ViewModel; 6 | 7 | namespace SmartCmdArgs.View.Converter 8 | { 9 | class ItemMonikerConverter : MultiConverterBase 10 | { 11 | public override object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 12 | { 13 | var item = values[0]; 14 | var isExpanded = (bool) values[1]; 15 | if (item is CmdGroup grp) 16 | { 17 | if (isExpanded) 18 | return KnownMonikers.FolderOpened; 19 | else 20 | return KnownMonikers.FolderClosed; 21 | } 22 | if (item is CmdProject prj) 23 | { 24 | if (prj.Kind == ProjectKinds.CS) return KnownMonikers.CSProjectNode; 25 | if (prj.Kind == ProjectKinds.CSCore) return KnownMonikers.CSProjectNode; 26 | if (prj.Kind == ProjectKinds.CPP) return KnownMonikers.CPPProjectNode; 27 | if (prj.Kind == ProjectKinds.VB) return KnownMonikers.VBProjectNode; 28 | if (prj.Kind == ProjectKinds.FS) return KnownMonikers.FSProjectNode; 29 | if (prj.Kind == ProjectKinds.Node) return KnownMonikers.JSProjectNode; 30 | if (prj.Kind == ProjectKinds.Py) return KnownMonikers.PYProjectNode; 31 | if (prj.Kind == ProjectKinds.Fortran) return CustomMonikers.FoProjectNode; 32 | return KnownMonikers.CSProjectNode; 33 | } 34 | return null; 35 | } 36 | 37 | public override object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) 38 | { 39 | throw new NotImplementedException(); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/View/Converter/ItemTagTextConverter.cs: -------------------------------------------------------------------------------- 1 | using SmartCmdArgs.ViewModel; 2 | using System; 3 | using System.Globalization; 4 | 5 | namespace SmartCmdArgs.View.Converter 6 | { 7 | class ItemTagTextConverter : ConverterBase 8 | { 9 | public override object Convert(object value, Type targetType, object parameter, CultureInfo culture) 10 | { 11 | if (value is CmdParamType argType) 12 | { 13 | switch (argType) 14 | { 15 | case CmdParamType.CmdArg: return "CLA"; 16 | case CmdParamType.EnvVar: return "ENV"; 17 | case CmdParamType.WorkDir: return "WD"; 18 | case CmdParamType.LaunchApp: return "APP"; 19 | } 20 | } 21 | 22 | return null; 23 | } 24 | 25 | public override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 26 | { 27 | throw new NotImplementedException(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/View/Converter/ItemTagVisibilityConverter.cs: -------------------------------------------------------------------------------- 1 | using SmartCmdArgs.ViewModel; 2 | using System; 3 | using System.Globalization; 4 | using System.Windows; 5 | 6 | namespace SmartCmdArgs.View.Converter 7 | { 8 | class ItemTagVisibilityConverter : MultiConverterBase 9 | { 10 | public override object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 11 | { 12 | var argType = values[0] as CmdParamType?; 13 | var showClaTag = values[1] as bool?; 14 | 15 | if (argType == CmdParamType.EnvVar || argType == CmdParamType.WorkDir || argType == CmdParamType.LaunchApp || showClaTag == true) 16 | { 17 | return Visibility.Visible; 18 | } 19 | 20 | return Visibility.Collapsed; 21 | } 22 | 23 | public override object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) 24 | { 25 | throw new NotImplementedException(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/View/Converter/ItemVisibilityConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using SmartCmdArgs.ViewModel; 4 | 5 | namespace SmartCmdArgs.View.Converter 6 | { 7 | class ItemVisibilityConverter : ConverterBase 8 | { 9 | public override object Convert(object value, Type targetType, object parameter, CultureInfo culture) 10 | { 11 | if (value is CmdParameter) 12 | return System.Windows.Visibility.Collapsed; 13 | return System.Windows.Visibility.Visible; 14 | } 15 | 16 | public override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 17 | { 18 | throw new NotImplementedException(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/View/Converter/MultiConverterBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Windows.Data; 4 | 5 | namespace SmartCmdArgs.View.Converter 6 | { 7 | [System.Windows.Markup.MarkupExtensionReturnType(typeof(MultiConverterBase))] 8 | abstract class MultiConverterBase : System.Windows.Markup.MarkupExtension, IMultiValueConverter 9 | { 10 | public MultiConverterBase() 11 | { } 12 | 13 | public override object ProvideValue(IServiceProvider serviceProvider) 14 | { 15 | return this; 16 | } 17 | 18 | public abstract object Convert(object[] values, Type targetType, object parameter, CultureInfo culture); 19 | public abstract object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/View/Converter/NullToVisibilityConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SmartCmdArgs.View.Converter 4 | { 5 | class NullToVisibilityConverter : ConverterBase 6 | { 7 | public NullToVisibilityConverter() 8 | { } 9 | 10 | public bool Inverted { get; set; } 11 | 12 | public System.Windows.Visibility HideVisibility { get; set; } = System.Windows.Visibility.Hidden; 13 | 14 | public override object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 15 | { 16 | if (Inverted) 17 | return value != null ? HideVisibility : System.Windows.Visibility.Visible; 18 | else 19 | return value == null ? HideVisibility : System.Windows.Visibility.Visible; 20 | } 21 | 22 | public override object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 23 | { 24 | return null; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/View/Converter/NullToVisibilityMultiConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Linq; 4 | 5 | namespace SmartCmdArgs.View.Converter 6 | { 7 | class NullToVisibilityMultiConverter : MultiConverterBase 8 | { 9 | public enum VisibleCond { AllNotNull, AnyNotNull, AllNull, AnyNull }; 10 | 11 | public VisibleCond VisibleCondition { get; set; } = VisibleCond.AllNotNull; 12 | 13 | public System.Windows.Visibility HideVisibility { get; set; } = System.Windows.Visibility.Hidden; 14 | 15 | public override object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 16 | { 17 | bool isVisible = false; 18 | switch (VisibleCondition) 19 | { 20 | case VisibleCond.AllNotNull: 21 | isVisible = values.All(x => x != null); break; 22 | case VisibleCond.AnyNotNull: 23 | isVisible = values.Any(x => x != null); break; 24 | case VisibleCond.AllNull: 25 | isVisible = values.All(x => x == null); break; 26 | case VisibleCond.AnyNull: 27 | isVisible = values.Any(x => x == null); break; 28 | } 29 | 30 | return isVisible ? System.Windows.Visibility.Visible : HideVisibility; 31 | } 32 | 33 | public override object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) 34 | { 35 | throw new NotImplementedException(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/View/Converter/StringConcatConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Linq; 4 | 5 | namespace SmartCmdArgs.View.Converter 6 | { 7 | class StringConcatConverter : MultiConverterBase 8 | { 9 | public string Seperator { get; set; } = ", "; 10 | 11 | public override object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) 12 | { 13 | return string.Join(Seperator, values.OfType()); 14 | } 15 | 16 | public override object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) 17 | { 18 | throw new NotImplementedException(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/View/Converter/TreeLevelMarginConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SmartCmdArgs.View.Converter 4 | { 5 | class TreeLevelMarginConverter : ConverterBase 6 | { 7 | public TreeLevelMarginConverter() 8 | { 9 | } 10 | 11 | public int Ident { get; set; } = 4; 12 | 13 | public override object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 14 | { 15 | int? treeLevel = value as int?; 16 | return new System.Windows.Thickness((treeLevel ?? 0) * Ident, 0, 0, 0); 17 | } 18 | 19 | public override object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 20 | { 21 | return null; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /SmartCmdArgs/SmartCmdArgs.Shared/View/SetCustomDelimiterControl.xaml: -------------------------------------------------------------------------------- 1 |  12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | Delimiter: 28 | 29 | 30 | Prefix: 31 | 32 | 33 | Postfix: 34 | 35 | 36 | 37 |