Skip to content
Browse files

Remove my old fork

  • Loading branch information...
1 parent 81988a8 commit 5063a715682844abdcd6f633f107f7f3909a5c57 @monoman committed
Showing with 0 additions and 9,827 deletions.
  1. +0 −85 knowingnupack/Build/Build.proj
  2. +0 −43 knowingnupack/Build/NuPack.Settings.targets
  3. +0 −12 knowingnupack/Build/NuPack.Test.targets
  4. +0 −24 knowingnupack/Build/PackageBuild.proj
  5. +0 −1 knowingnupack/Build/ilmerge.internalize.ignore.txt
  6. +0 −13 knowingnupack/COPYRIGHT.txt
  7. +0 −14 knowingnupack/CREDITS.txt
  8. +0 −15 knowingnupack/Common/CommonAssemblyInfo.cs
  9. +0 −135 knowingnupack/Common/CommonResources.cs
  10. +0 −144 knowingnupack/Common/CommonResources.resx
  11. +0 −1 knowingnupack/Common/GlobalSuppressions.cs
  12. +0 −177 knowingnupack/LICENSE.txt
  13. +0 −327 knowingnupack/NuPack.Console/NuPackConsole/Console/ConsoleDispatcher.cs
  14. +0 −10 knowingnupack/NuPack.Console/NuPackConsole/Console/IHostNameMetadata.cs
  15. +0 −31 knowingnupack/NuPack.Console/NuPackConsole/Console/InputHistory.cs
  16. +0 −64 knowingnupack/NuPack.Console/NuPackConsole/Console/OleCommandFilter.cs
  17. +0 −238 knowingnupack/NuPack.Console/NuPackConsole/Console/OrderedSpans.cs
  18. +0 −109 knowingnupack/NuPack.Console/NuPackConsole/Console/TextFormatClassifier.cs
  19. +0 −604 knowingnupack/NuPack.Console/NuPackConsole/Console/WpfConsole.cs
  20. +0 −295 knowingnupack/NuPack.Console/NuPackConsole/Console/WpfConsoleClassifier.cs
  21. +0 −68 knowingnupack/NuPack.Console/NuPackConsole/Console/WpfConsoleCompletionSource.cs
  22. +0 −406 knowingnupack/NuPack.Console/NuPackConsole/Console/WpfConsoleKeyProcessor.cs
  23. +0 −134 knowingnupack/NuPack.Console/NuPackConsole/Console/WpfConsoleService.cs
  24. +0 −11 knowingnupack/NuPack.Console/NuPackConsole/GlobalSuppressions.cs
  25. +0 −11 knowingnupack/NuPack.Console/NuPackConsole/Guids.cs
  26. +0 −179 knowingnupack/NuPack.Console/NuPackConsole/NuPack.Console.csproj
  27. +0 −10 knowingnupack/NuPack.Console/NuPackConsole/NuPack.Console.csproj.vspscc
  28. +0 −18 knowingnupack/NuPack.Console/NuPackConsole/PkgCmdID.cs
  29. +0 −21 knowingnupack/NuPack.Console/NuPackConsole/PowerConsole/ClassifierProvider.cs
  30. +0 −22 knowingnupack/NuPack.Console/NuPackConsole/PowerConsole/CompletionSourceProvider.cs
  31. +0 −79 knowingnupack/NuPack.Console/NuPackConsole/PowerConsole/HostInfo.cs
  32. +0 −18 knowingnupack/NuPack.Console/NuPackConsole/PowerConsole/IHostMetadata.cs
  33. +0 −171 knowingnupack/NuPack.Console/NuPackConsole/PowerConsole/PowerConsoleWindow.cs
  34. +0 −85 knowingnupack/NuPack.Console/NuPackConsole/PowerConsole/Settings.cs
  35. +0 −468 knowingnupack/NuPack.Console/NuPackConsole/PowerConsoleToolWindow.cs
  36. +0 −12 knowingnupack/NuPack.Console/NuPackConsole/Properties/AssemblyInfo.cs
  37. +0 −72 knowingnupack/NuPack.Console/NuPackConsole/Resources.Designer.cs
  38. +0 −123 knowingnupack/NuPack.Console/NuPackConsole/Resources.resx
  39. +0 −32 knowingnupack/NuPack.Console/NuPackConsole/Types/DisplayNameAttribute.cs
  40. +0 −33 knowingnupack/NuPack.Console/NuPackConsole/Types/HostNameAttribute.cs
  41. +0 −16 knowingnupack/NuPack.Console/NuPackConsole/Types/ICommandExpansion.cs
  42. +0 −18 knowingnupack/NuPack.Console/NuPackConsole/Types/ICommandExpansionProvider.cs
  43. +0 −17 knowingnupack/NuPack.Console/NuPackConsole/Types/ICommandTokenizer.cs
  44. +0 −18 knowingnupack/NuPack.Console/NuPackConsole/Types/ICommandTokenizerProvider.cs
  45. +0 −55 knowingnupack/NuPack.Console/NuPackConsole/Types/IConsole.cs
  46. +0 −31 knowingnupack/NuPack.Console/NuPackConsole/Types/IConsoleDispatcher.cs
  47. +0 −52 knowingnupack/NuPack.Console/NuPackConsole/Types/IHost.cs
  48. +0 −17 knowingnupack/NuPack.Console/NuPackConsole/Types/IHostProvider.cs
  49. +0 −31 knowingnupack/NuPack.Console/NuPackConsole/Types/IPowerConsoleWindow.cs
  50. +0 −20 knowingnupack/NuPack.Console/NuPackConsole/Types/IWpfConsole.cs
  51. +0 −35 knowingnupack/NuPack.Console/NuPackConsole/Types/IWpfConsoleService.cs
  52. +0 −36 knowingnupack/NuPack.Console/NuPackConsole/Types/SimpleExpansion.cs
  53. +0 −50 knowingnupack/NuPack.Console/NuPackConsole/Types/Token.cs
  54. +0 −88 knowingnupack/NuPack.Console/NuPackConsole/Types/TokenType.cs
  55. +0 −30 knowingnupack/NuPack.Console/NuPackConsole/Utils/CommonExtensionMethods.cs
  56. +0 −17 knowingnupack/NuPack.Console/NuPackConsole/Utils/EventArgs.cs
  57. +0 −99 knowingnupack/NuPack.Console/NuPackConsole/Utils/ExtensionMethods.cs
  58. +0 −36 knowingnupack/NuPack.Console/NuPackConsole/Utils/Marshaler.cs
  59. +0 −17 knowingnupack/NuPack.Console/NuPackConsole/Utils/ObjectWithFactory.cs
  60. +0 −23 knowingnupack/NuPack.Console/NuPackConsole/Utils/UtilityMethods.cs
  61. +0 −61 knowingnupack/NuPack.Console/PowerShellHost/CommandTokenizer.cs
  62. +0 −199 knowingnupack/NuPack.Console/PowerShellHost/HostUtilities.cs
  63. +0 −99 knowingnupack/NuPack.Console/PowerShellHost/MyHost.cs
  64. +0 −156 knowingnupack/NuPack.Console/PowerShellHost/MyHostRawUserInterface.cs
  65. +0 −167 knowingnupack/NuPack.Console/PowerShellHost/MyHostUI.cs
  66. +0 −151 knowingnupack/NuPack.Console/PowerShellHost/PSTypeWrapper.cs
  67. +0 −11 knowingnupack/NuPack.Console/PowerShellHost/PowerShellCommandExpansion.cs
  68. +0 −400 knowingnupack/NuPack.Console/PowerShellHost/PowerShellHost.cs
  69. +0 −104 knowingnupack/NuPack.Console/PowerShellHost/PowerShellHost.csproj
  70. +0 −10 knowingnupack/NuPack.Console/PowerShellHost/PowerShellHost.csproj.vspscc
  71. +0 −74 knowingnupack/NuPack.Console/PowerShellHost/PowerShellHostProvider.cs
  72. +0 −18 knowingnupack/NuPack.Console/PowerShellHost/PowerShellHostService.cs
  73. +0 −8 knowingnupack/NuPack.Console/PowerShellHost/Properties/AssemblyInfo.cs
  74. +0 −96 knowingnupack/NuPack.Console/PowerShellHost/Resources.Designer.cs
  75. +0 −124 knowingnupack/NuPack.Console/PowerShellHost/Resources.resx
  76. +0 −63 knowingnupack/NuPack.Console/PowerShellHost/Scripts/Add-WrapperMembers.ps1
  77. +0 −144 knowingnupack/NuPack.Console/PowerShellHost/Scripts/Profile.ps1
  78. +0 −141 knowingnupack/NuPack.Console/PowerShellHost/Scripts/nupack.ps1
  79. +0 −144 knowingnupack/NuPack.Console/PowerShellHost/SolutionProjectsHelper.cs
  80. +0 −15 knowingnupack/NuPack.Console/PowerShellHost/Types/IPowerShellHost.cs
  81. +0 −11 knowingnupack/NuPack.Console/PowerShellHost/Types/IPowerShellHostService.cs
  82. +0 −147 knowingnupack/NuPack.Console/PowerShellHost/Utils/CommandExpansion.cs
  83. +0 −107 knowingnupack/NuPack.Console/PowerShellHost/Utils/ComplexCommand.cs
  84. +0 −11 knowingnupack/NuPack.Console/PowerShellHost/Utils/IPathExpansion.cs
  85. +0 −11 knowingnupack/NuPack.Console/PowerShellHost/Utils/ITabExpansion.cs
  86. +0 −226 knowingnupack/NuPack.Console/PowerShellHost/Utils/MethodBinder.cs
  87. +0 −141 knowingnupack/NuPack.Console/PowerShellHost/Utils/TypeWrapper.cs
  88. +0 −16 knowingnupack/NuPack.Console/PowerShellHost/VSConstants.cs
  89. +0 −193 knowingnupack/NuPack.Core/Authoring/PackageBuilder.cs
  90. +0 −80 knowingnupack/NuPack.Core/Authoring/PathResolver.cs
  91. +0 −17 knowingnupack/NuPack.Core/Authoring/PathSearchFilter.cs
  92. +0 −35 knowingnupack/NuPack.Core/Authoring/PhysicalPackageFile.cs
  93. +0 −193 knowingnupack/NuPack.Core/Authoring/XmlManifestReader.cs
  94. +0 −79 knowingnupack/NuPack.Core/Authoring/XmlManifestWriter.cs
  95. +0 −59 knowingnupack/NuPack.Core/Authoring/nuspec.xsd
  96. +0 −67 knowingnupack/NuPack.Core/Class diagrams/PackageWalkers.cd
  97. +0 −62 knowingnupack/NuPack.Core/Class diagrams/Packages.cd
  98. +0 −40 knowingnupack/NuPack.Core/Class diagrams/Repositories.cd
  99. +0 −44 knowingnupack/NuPack.Core/Feed/PackageFeedDependency.cs
  100. +0 −121 knowingnupack/NuPack.Core/Feed/PackageSyndicationFeed.cs
  101. +0 −97 knowingnupack/NuPack.Core/Feed/PackageSyndicationItem.cs
  102. +0 −16 knowingnupack/NuPack.Core/FileModifiers/IPackageFileTransformer.cs
  103. +0 −42 knowingnupack/NuPack.Core/FileModifiers/Preprocessor.cs
  104. +0 −47 knowingnupack/NuPack.Core/FileModifiers/XmlTransfomer.cs
  105. +0 −15 knowingnupack/NuPack.Core/GlobalSuppressions.cs
  106. +0 −21 knowingnupack/NuPack.Core/Logging/CallbackLogger.cs
  107. +0 −5 knowingnupack/NuPack.Core/Logging/ILogger.cs
  108. +0 −7 knowingnupack/NuPack.Core/Logging/MessageLevel.cs
  109. +0 −8 knowingnupack/NuPack.Core/Logging/NullLogger.cs
  110. +0 −157 knowingnupack/NuPack.Core/NuPack.Core.csproj
  111. +0 −300 knowingnupack/NuPack.Core/PackageManager.cs
  112. +0 −20 knowingnupack/NuPack.Core/PackageOperationEventArgs.cs
  113. +0 −38 knowingnupack/NuPack.Core/PackagePlan.cs
  114. +0 −53 knowingnupack/NuPack.Core/PackageSource/PackageSource.cs
  115. +0 −35 knowingnupack/NuPack.Core/PackageWalker/BasicPackageWalker.cs
  116. +0 −100 knowingnupack/NuPack.Core/PackageWalker/DependencyManager.cs
Sorry, we could not display the entire diff because too many files (511) changed.
View
85 knowingnupack/Build/Build.proj
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Go" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <DebugOrRelease>Debug</DebugOrRelease>
- <NuPackRoot>$(MSBuildProjectDirectory)\..</NuPackRoot>
- <DropDirectory>$(NuPackRoot)\bin</DropDirectory>
- <ArtifactDropDirectory>$(DropDirectory)\artifacts</ArtifactDropDirectory>
- <NuPackDropDirectory>$(DropDirectory)\NuPack</NuPackDropDirectory>
- <ExeBuildDirectory>$(NuPackRoot)\NuPack\bin\$(DebugOrRelease)</ExeBuildDirectory>
- <ExeDropDirectory>$(NuPackDropDirectory)\Console</ExeDropDirectory>
- <VisualStudioAddInBuildDirectory>$(NuPackRoot)\NuPack.Tools\bin\$(DebugOrRelease)</VisualStudioAddInBuildDirectory>
- <VisualStudioAddInDropDirectory>$(NuPackDropDirectory)\VisualStudioAddIn</VisualStudioAddInDropDirectory>
- <ServerBuildDirectory>$(NuPackRoot)\NuPack.Server</ServerBuildDirectory>
- <ServerDropDirectory>$(NuPackDropDirectory)\Server</ServerDropDirectory>
- <ILMergeExe>$(NuPackRoot)\Tools\ILMerge\ILMerge.exe</ILMergeExe>
- <ILMergeArtifactDirectory>$(ArtifactDropDirectory)\ILMerge</ILMergeArtifactDirectory>
- <ILMergeFileFinalName>NuPack.exe</ILMergeFileFinalName>
- <ILMergeInternalizeIgnoreFile>$(NuPackRoot)\Build\ilmerge.internalize.ignore.txt</ILMergeInternalizeIgnoreFile>
- <MergeDirectory>$(ExeDropDirectory)</MergeDirectory>
- </PropertyGroup>
- <ItemGroup>
- <LicenseFileItems Include="$(MSBuildProjectDirectory)\..\LICENSE.txt" />
- <ExeOutputItems Exclude="$(ExeBuildDirectory)\**\*.pdb" Include="$(ExeBuildDirectory)\**\*.*" />
- <VisualStudioAddInOutputItems Include="$(VisualStudioAddInBuildDirectory)\**\*.vsix" />
- <ServerOutputItems Exclude="$(ServerBuildDirectory)\obj\*.*;$(ServerBuildDirectory)\**\*.cs;$(ServerBuildDirectory)\**\*.csproj" Include="$(ServerBuildDirectory)\**\*.*" />
- </ItemGroup>
-
- <Target Name="Go" DependsOnTargets="Build; RunTests; BuildPackages; CreateDropDirectories; CopyExecutableOutputToDropDirectory; CopyVisualStudioAddInOutputToDropDirectory; CopyServerOutputToDropDirectory; CopyLicenseToAllDirectories; ILMergeTheExecutable">
- </Target>
-
- <Target Name="Build">
- <MSBuild Projects="$(NuPackRoot)\NuPack.sln" Targets="Build" />
- </Target>
-
- <Target Name="RunTests">
- <MSBuild Projects="$(NuPackRoot)\NuPack.Test\NuPack.Test.csproj" Targets="RunTests">
- </MSBuild>
- </Target>
-
- <Target Name="BuildPackages">
- <MSBuild Projects="$(NuPackRoot)\Build\PackageBuild.proj" Targets="BuildPackages" />
- </Target>
-
- <Target Name="CreateDropDirectories">
- <Message Text="Making the output directories for the compiled output at '$(DropDirectory)'." />
- <RemoveDir Directories="$(DropDirectory)" Condition="Exists('$(DropDirectory)')" ContinueOnError="True" />
- <MakeDir Directories="$(DropDirectory)" Condition="!Exists('$(DropDirectory)')" />
- <MakeDir Directories="$(ArtifactDropDirectory)" Condition="!Exists('$(ArtifactDropDirectory)')" />
- <MakeDir Directories="$(NuPackDropDirectory)" Condition="!Exists('$(NuPackDropDirectory)')" />
- <MakeDir Directories="$(ExeDropDirectory)" Condition="!Exists('$(ExeDropDirectory)')" />
- <MakeDir Directories="$(VisualStudioAddInDropDirectory)" Condition="!Exists('$(VisualStudioAddInDropDirectory)')" />
- <MakeDir Directories="$(ServerDropDirectory)" Condition="!Exists('$(ServerDropDirectory)')" />
- </Target>
-
- <Target Name="CopyExecutableOutputToDropDirectory">
- <Message Text="Copying the NuPack Console output to $(ExeDropDirectory)" />
- <Copy ContinueOnError="false" SourceFiles="@(ExeOutputItems)" DestinationFiles="@(ExeOutputItems -&gt;'$(ExeDropDirectory)\%(RecursiveDir)%(Filename)%(Extension)')" />
- </Target>
-
- <Target Name="CopyVisualStudioAddInOutputToDropDirectory">
- <Message Text="Copying the NuPack Visual Studio Add-In output to $(VisualStudioAddInDropDirectory)" />
- <Copy ContinueOnError="false" SourceFiles="@(VisualStudioAddInOutputItems)" DestinationFiles="@(VisualStudioAddInOutputItems -&gt;'$(VisualStudioAddInDropDirectory)\%(RecursiveDir)%(Filename)%(Extension)')" />
- </Target>
- <Target Name="CopyServerOutputToDropDirectory">
- <Message Text="Copying the NuPack Server output to $(ServerDropDirectory)" />
- <Copy ContinueOnError="false" SourceFiles="@(ServerOutputItems)" DestinationFiles="@(ServerOutputItems -&gt;'$(ServerDropDirectory)\%(RecursiveDir)%(Filename)%(Extension)')" />
- </Target>
- <Target Name="CopyLicenseToAllDirectories">
- <Message Text="Copying the License to all drop directories" />
- <Copy ContinueOnError="false" SourceFiles="@(LicenseFileItems)" DestinationFiles="@(LicenseFileItems -&gt;'$(ExeDropDirectory)\%(RecursiveDir)%(Filename)%(Extension)')" />
- <Copy ContinueOnError="false" SourceFiles="@(LicenseFileItems)" DestinationFiles="@(LicenseFileItems -&gt;'$(VisualStudioAddInDropDirectory)\%(RecursiveDir)%(Filename)%(Extension)')" />
- <Copy ContinueOnError="false" SourceFiles="@(LicenseFileItems)" DestinationFiles="@(LicenseFileItems -&gt;'$(ServerDropDirectory)\%(RecursiveDir)%(Filename)%(Extension)')" />
- </Target>
- <Target Name="ILMergeTheExecutable">
- <Message Text="ILMerging the executable contents in $(ExeDropDirectory)" />
- <ItemGroup>
- <ILMergeItems Include="$(MergeDirectory)\*.dll" />
- </ItemGroup>
- <MakeDir Directories="$(ILMergeArtifactDirectory)" Condition="!Exists('$(ILMergeArtifactDirectory)')" />
- <!-- ILMerge does not yet support .NET 4.0 http://nitoprograms.blogspot.com/2010/09/using-ilmerge-with-net-40-andor-rx.html /targetplatform:v4,"%ProgramFiles%\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0" -->
- <Exec Command="$(ILMergeExe) /targetplatform:&quot;v4, %ProgramFiles%\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0&quot; /internalize:$(ILMergeInternalizeIgnoreFile) /target:exe /out:$(ILMergeFileFinalName) /log:$(ILMergeArtifactDirectory)\ilmerge.log /ndebug /allowDup $(ILMergeFileFinalName) %(ILMergeItems.FileName)%(ILMergeItems.Extension)" WorkingDirectory="$(MergeDirectory)" />
- <!-- For some reason ILMerge is not deleting files that are merged in - but they are merging in just fine -->
- <Delete Files="@(ILMergeItems)" />
- </Target>
-</Project>
View
43 knowingnupack/Build/NuPack.Settings.targets
@@ -1,43 +0,0 @@
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <!-- Common Build Settings and Configurations -->
- <PropertyGroup>
- <NuPackRoot Condition=" '$(NuPackRoot)' == '' ">$(MSBuildProjectDirectory)\..</NuPackRoot>
- <Configuration Condition=" '$(Configuration)' == '' Or '$(Configuration)' == 'CI' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <TargetFrameworkProfile />
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <DefineConstants>$(DefineConstants);TRACE</DefineConstants>
- <AdditionalSettingsImport>$(NuPackRoot)\Extended.Settings.targets</AdditionalSettingsImport>
- </PropertyGroup>
-
- <!-- Common settings for Debug and Coverage builds -->
- <PropertyGroup Condition=" '$(Configuration)' == 'Debug' Or '$(Configuration)' == 'Coverage'">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>$(DefineConstants);DEBUG;CODE_ANALYSIS</DefineConstants>
- </PropertyGroup>
-
- <!-- Settings only for Release builds -->
- <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- </PropertyGroup>
-
- <!-- Settings only for Coverage builds -->
- <PropertyGroup Condition=" '$(Configuration)' == 'Coverage' ">
- <OutputPath>bin\Coverage\</OutputPath>
- <Coverage>true</Coverage>
- </PropertyGroup>
-
- <Import Project="$(AdditionalSettingsImport)" Condition="Exists('$(AdditionalSettingsImport)')" />
-</Project>
View
12 knowingnupack/Build/NuPack.Test.targets
@@ -1,12 +0,0 @@
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-<PropertyGroup>
- <ProgramFilesDir>$(ProgramFiles)</ProgramFilesDir>
- <ProgramFilesDir Condition="Exists('$(ProgramFiles) %28x86%29')">$(ProgramFiles) (x86)</ProgramFilesDir>
- <VsDir>$(ProgramFilesDir)\Microsoft Visual Studio 10.0</VsDir>
- <DevEnvDir>$(VsDir)\Common7\IDE</DevEnvDir>
-</PropertyGroup>
-
-<Target Name="RunTests">
- <Exec Command="&quot;$(DevEnvDir)\MsTest.exe&quot; /testcontainer:&quot;$(TargetDir)\$(AssemblyName).dll&quot;" WorkingDirectory="$(NuPackRoot)" ContinueOnError="false" />
-</Target>
-</Project>
View
24 knowingnupack/Build/PackageBuild.proj
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="BuildPackages" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-
- <PropertyGroup>
- <NuPackRoot>$(MSBuildProjectDirectory)\..</NuPackRoot>
- <NuPackConsoleExe>$(NuPackRoot)\NuPack\bin\Debug\NuPack.exe</NuPackConsoleExe>
- <PackagesDirectory>$(NuPackRoot)\PackageSources</PackagesDirectory>
- <ServerPackagesDirectory>$(NuPackRoot)\NuPack.Server\Packages</ServerPackagesDirectory>
- </PropertyGroup>
-
- <ItemGroup>
- <Specs Include="$(PackagesDirectory)\**\*.nuspec" />
- </ItemGroup>
-
- <Target Name="BuildPackages">
- <Message Text="Building the test packages to $(ServerPackagesDirectory)."/>
- <MakeDir
- Directories="$(ServerPackagesDirectory)"
- Condition="!Exists('$(ServerPackagesDirectory)')" />
- <Exec
- Command="$(NuPackConsoleExe) %(Specs.FullPath)"
- WorkingDirectory="$(ServerPackagesDirectory)"/>
- </Target>
-</Project>
View
1 knowingnupack/Build/ilmerge.internalize.ignore.txt
@@ -1 +0,0 @@
-NuPack.*
View
13 knowingnupack/COPYRIGHT.txt
@@ -1,13 +0,0 @@
- Copyright 2010 Outercurve Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
View
14 knowingnupack/CREDITS.txt
@@ -1,14 +0,0 @@
-NuPack Project
-ASP.NET Open Source Gallery at Outercurve Foundation
-Copyright 2010 Outercurve Foundation
-
-This product includes software developed at
-The Outercurve Foundation (http://www.outercurve.org/).
-
-NuPack includes or is derivative of works distributed under the licenses listed below. The full text for most of the licenses listed below can be found in the LICENSE.txt file accompanying each work. The original copyright notices have been preserved within the respective files and or packages. Please refer to the specific files and/or packages for more detailed information about the authors, copyright notices, and licenses.
-
-ProvideBindingPathAttribute (Visual Studio SDK)
------
-Website: http://msdn.microsoft.com/en-us/library/bb166441(VS.80).aspx
-Copyright: Copyright (c) 2010 Microsoft
-License: Apache 2.0
View
15 knowingnupack/Common/CommonAssemblyInfo.cs
@@ -1,15 +0,0 @@
-using System.Reflection;
-using System.Resources;
-using System.Runtime.InteropServices;
-
-[assembly: AssemblyCompany("Outercurve Foundation")]
-[assembly: AssemblyProduct("NuPack")]
-[assembly: AssemblyCopyright("\x00a9 Outercurve Foundation. All rights reserved.")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyTrademark("")]
-
-[assembly: ComVisible(false)]
-
-[assembly: AssemblyVersion("1.0.0.0")]
-
-[assembly: NeutralResourcesLanguage("en-US")]
View
135 knowingnupack/Common/CommonResources.cs
@@ -1,135 +0,0 @@
-namespace Microsoft.Internal.Web.Utils {
- using System;
- using System.Diagnostics.CodeAnalysis;
- using System.Linq;
- using System.Reflection;
- using System.Runtime.CompilerServices;
-
-
- /// <summary>
- /// A strongly-typed resource class, for looking up localized strings, etc.
- /// </summary>
- [CompilerGenerated()]
- internal static class CommonResources {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- /// <summary>
- /// Returns the cached ResourceManager instance used by this class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- // Find the CommonResources.resources file's full resource name in this assembly
- string commonResourcesName = Assembly.GetExecutingAssembly().GetManifestResourceNames().Where(s => s.EndsWith("CommonResources.resources", StringComparison.OrdinalIgnoreCase)).Single();
-
- // Trim off the ".resources"
- commonResourcesName = commonResourcesName.Substring(0, commonResourcesName.Length - 10);
-
- // Load the resource manager
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(commonResourcesName, typeof(CommonResources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- /// <summary>
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- /// </summary>
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Property may not be used in every assembly it is imported into")]
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to {0} cannot be null or an empty string.
- /// </summary>
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Property may not be used in every assembly it is imported into")]
- internal static string Argument_Cannot_Be_Null_Or_Empty {
- get {
- return ResourceManager.GetString("Argument_Cannot_Be_Null_Or_Empty", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to {0} must be between {1} and {2}.
- /// </summary>
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Property may not be used in every assembly it is imported into")]
- internal static string Argument_Must_Be_Between {
- get {
- return ResourceManager.GetString("Argument_Must_Be_Between", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to {0} must be a valid value from the {1} enumeration.
- /// </summary>
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Property may not be used in every assembly it is imported into")]
- internal static string Argument_Must_Be_Enum_Member {
- get {
- return ResourceManager.GetString("Argument_Must_Be_Enum_Member", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to {0} must be greater than {1}.
- /// </summary>
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Property may not be used in every assembly it is imported into")]
- internal static string Argument_Must_Be_GreaterThan {
- get {
- return ResourceManager.GetString("Argument_Must_Be_GreaterThan", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to {0} must be greater than or equal to {1}.
- /// </summary>
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Property may not be used in every assembly it is imported into")]
- internal static string Argument_Must_Be_GreaterThanOrEqualTo {
- get {
- return ResourceManager.GetString("Argument_Must_Be_GreaterThanOrEqualTo", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to {0} must be less than {1}.
- /// </summary>
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Property may not be used in every assembly it is imported into")]
- internal static string Argument_Must_Be_LessThan {
- get {
- return ResourceManager.GetString("Argument_Must_Be_LessThan", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to {0} must be less than or equal to {1}.
- /// </summary>
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Property may not be used in every assembly it is imported into")]
- internal static string Argument_Must_Be_LessThanOrEqualTo {
- get {
- return ResourceManager.GetString("Argument_Must_Be_LessThanOrEqualTo", resourceCulture);
- }
- }
-
- /// <summary>
- /// Looks up a localized string similar to {0} cannot be an empty string, it must either be null or a non-empty string.
- /// </summary>
- [SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Property may not be used in every assembly it is imported into")]
- internal static string Argument_Must_Be_Null_Or_Non_Empty {
- get {
- return ResourceManager.GetString("Argument_Must_Be_Null_Or_Non_Empty", resourceCulture);
- }
- }
- }
-}
View
144 knowingnupack/Common/CommonResources.resx
@@ -1,144 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <data name="Argument_Cannot_Be_Null_Or_Empty" xml:space="preserve">
- <value>Value cannot be null or an empty string.</value>
- </data>
- <data name="Argument_Must_Be_Between" xml:space="preserve">
- <value>Value must be between {0} and {1}.</value>
- </data>
- <data name="Argument_Must_Be_Enum_Member" xml:space="preserve">
- <value>Value must be a value from the "{0}" enumeration.</value>
- </data>
- <data name="Argument_Must_Be_GreaterThan" xml:space="preserve">
- <value>Value must be greater than {0}.</value>
- </data>
- <data name="Argument_Must_Be_GreaterThanOrEqualTo" xml:space="preserve">
- <value>Value must be greater than or equal to {0}.</value>
- </data>
- <data name="Argument_Must_Be_LessThan" xml:space="preserve">
- <value>Value must be less than {0}.</value>
- </data>
- <data name="Argument_Must_Be_LessThanOrEqualTo" xml:space="preserve">
- <value>Value must be less than or equal to {0}.</value>
- </data>
- <data name="Argument_Must_Be_Null_Or_Non_Empty" xml:space="preserve">
- <value>Value cannot be an empty string. It must either be null or a non-empty string.</value>
- </data>
-</root>
View
1 knowingnupack/Common/GlobalSuppressions.cs
@@ -1 +0,0 @@
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA2210:AssembliesShouldHaveValidStrongNames", Justification = "Assembly is delay-signed")]
View
177 knowingnupack/LICENSE.txt
@@ -1,177 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
View
327 knowingnupack/NuPack.Console/NuPackConsole/Console/ConsoleDispatcher.cs
@@ -1,327 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using Microsoft.VisualStudio.Text;
-
-namespace NuPackConsole.Implementation.Console
-{
- interface IPrivateConsoleDispatcher : IConsoleDispatcher
- {
- event EventHandler<EventArgs<Tuple<SnapshotSpan, bool>>> ExecuteInputLine;
- void PostInputLine(InputLine inputLine);
- }
-
- /// <summary>
- /// This class handles input line posting and command line dispatching/execution.
- /// </summary>
- class ConsoleDispatcher : IPrivateConsoleDispatcher
- {
- /// <summary>
- /// The IPrivateWpfConsole instance this dispatcher works with.
- /// </summary>
- IPrivateWpfConsole WpfConsole { get; set; }
-
- /// <summary>
- /// Child dispatcher based on host type. Its creation is postponed to Start(), so that
- /// a WpfConsole's dispatcher can be accessed while inside a host construction.
- /// </summary>
- Dispatcher _dispatcher;
-
- public ConsoleDispatcher(IPrivateWpfConsole wpfConsole)
- {
- UtilityMethods.ThrowIfArgumentNull(wpfConsole);
- this.WpfConsole = wpfConsole;
- }
-
- #region IConsoleDispatcher
- public event EventHandler BeforeStart;
-
- public void Start()
- {
- // Only Start once
- if (_dispatcher == null)
- {
- IHost host = WpfConsole.Host;
- if (host == null)
- {
- throw new InvalidOperationException("Can't start ConsoleDispatcher. Host is null.");
- }
- else if (host is IAsyncHost)
- {
- _dispatcher = new AsyncHostConsoleDispatcher(this);
- }
- else
- {
- _dispatcher = new SyncHostConsoleDispatcher(this);
- }
-
- this.BeforeStart.Raise(this);
- _dispatcher.Start();
- }
- }
-
- public void ClearConsole()
- {
- Debug.Assert(_dispatcher != null);
- if (_dispatcher != null)
- {
- _dispatcher.ClearConsole();
- }
- }
- #endregion
-
- #region IPrivateConsoleDispatcher
- public event EventHandler<EventArgs<Tuple<SnapshotSpan, bool>>> ExecuteInputLine;
-
- void OnExecute(SnapshotSpan inputLineSpan, bool isComplete)
- {
- ExecuteInputLine.Raise(this, Tuple.Create(inputLineSpan, isComplete));
- }
-
- public void PostInputLine(InputLine inputLine)
- {
- Debug.Assert(_dispatcher != null);
- if (_dispatcher != null)
- {
- _dispatcher.PostInputLine(inputLine);
- }
- }
- #endregion
-
- abstract class Dispatcher
- {
- protected ConsoleDispatcher ParentDispatcher { get; private set; }
- protected IPrivateWpfConsole WpfConsole { get; private set; }
-
- protected Dispatcher(ConsoleDispatcher parentDispatcher)
- {
- ParentDispatcher = parentDispatcher;
- WpfConsole = parentDispatcher.WpfConsole;
- }
-
- /// <summary>
- /// Process a input line.
- /// </summary>
- /// <param name="inputLine"></param>
- /// <returns></returns>
- protected Tuple<bool, bool> Process(InputLine inputLine)
- {
- SnapshotSpan inputSpan = inputLine.SnapshotSpan;
-
- if (inputLine.Flags.HasFlag(InputLineFlag.Echo))
- {
- WpfConsole.BeginInputLine();
-
- if (inputLine.Flags.HasFlag(InputLineFlag.Execute))
- {
- WpfConsole.WriteLine(inputLine.Text);
- inputSpan = WpfConsole.EndInputLine(true).Value;
- }
- else
- {
- WpfConsole.Write(inputLine.Text);
- }
- }
-
- if (inputLine.Flags.HasFlag(InputLineFlag.Execute))
- {
- string command = inputLine.Text;
- bool isExecuted = WpfConsole.Host.Execute(command);
- WpfConsole.InputHistory.Add(command);
- ParentDispatcher.OnExecute(inputSpan, isExecuted);
- return Tuple.Create(true, isExecuted);
- }
- return Tuple.Create(false, false);
- }
-
- public void PromptNewLine()
- {
- WpfConsole.Write(WpfConsole.Host.Prompt + " ");
- WpfConsole.BeginInputLine();
- }
-
- public void ClearConsole()
- {
- // When inputting commands
- if (WpfConsole.InputLineStart != null)
- {
- WpfConsole.Host.Abort(); // Clear constructing multi-line command
- WpfConsole.Clear();
- PromptNewLine();
- }
- else
- {
- WpfConsole.Clear();
- }
- }
-
- public abstract void Start();
- public abstract void PostInputLine(InputLine inputLine);
- }
-
- /// <summary>
- /// This class dispatches inputs for synchronous hosts.
- /// </summary>
- class SyncHostConsoleDispatcher : Dispatcher
- {
- public SyncHostConsoleDispatcher(ConsoleDispatcher parentDispatcher)
- : base(parentDispatcher)
- {
- }
-
- public override void Start()
- {
- PromptNewLine();
- }
-
- public override void PostInputLine(InputLine inputLine)
- {
- if (Process(inputLine).Item1)
- {
- PromptNewLine();
- }
- }
- }
-
- /// <summary>
- /// This class dispatches inputs for asynchronous hosts.
- /// </summary>
- class AsyncHostConsoleDispatcher : Dispatcher
- {
- Queue<InputLine> _buffer;
- bool _isExecuting;
- _Marshaler _marshaler;
-
- public AsyncHostConsoleDispatcher(ConsoleDispatcher parentDispatcher)
- : base(parentDispatcher)
- {
- _marshaler = new _Marshaler(this);
- }
-
- bool IsStarted
- {
- get
- {
- return _buffer != null;
- }
- }
-
- public override void Start()
- {
- if (IsStarted)
- {
- // Can only start once... ConsoleDispatcher is already protecting this.
- throw new InvalidOperationException();
- }
- _buffer = new Queue<InputLine>();
-
- IAsyncHost asyncHost = WpfConsole.Host as IAsyncHost;
- if (asyncHost == null)
- {
- // ConsoleDispatcher is already checking this.
- throw new InvalidOperationException();
- }
-
- asyncHost.ExecuteEnd += _marshaler.AsyncHost_ExecuteEnd;
- PromptNewLine();
- }
-
- public override void PostInputLine(InputLine inputLine)
- {
- // The editor should be completely readonly unless started.
- Debug.Assert(IsStarted);
-
- if (IsStarted)
- {
- _buffer.Enqueue(inputLine);
- ProcessInputs();
- }
- }
-
- void ProcessInputs()
- {
- if (_isExecuting)
- {
- return;
- }
-
- if (_buffer.Count > 0)
- {
- InputLine inputLine = _buffer.Dequeue();
- Tuple<bool, bool> executeState = Process(inputLine);
- if (executeState.Item1)
- {
- _isExecuting = true;
-
- if (!executeState.Item2)
- {
- // If NOT really executed, processing the same as ExecuteEnd event
- OnExecuteEnd();
- }
- }
- }
- }
-
- void OnExecuteEnd()
- {
- if (IsStarted) // Filter out noise. A host could execute private commands.
- {
- Debug.Assert(_isExecuting);
- _isExecuting = false;
-
- PromptNewLine();
- ProcessInputs();
- }
- }
-
- /// <summary>
- /// This private Marshaler marshals async host event to main thread so that the dispatcher
- /// doesn't need to worry about threading.
- /// </summary>
- class _Marshaler : Marshaler<AsyncHostConsoleDispatcher>
- {
- public _Marshaler(AsyncHostConsoleDispatcher impl)
- : base(impl)
- {
- }
-
- public void AsyncHost_ExecuteEnd(object sender, EventArgs e)
- {
- Invoke(() => _impl.OnExecuteEnd());
- }
- }
- }
- }
-
- [Flags]
- enum InputLineFlag
- {
- Echo = 1,
- Execute = 2
- }
-
- class InputLine
- {
- public SnapshotSpan SnapshotSpan { get; private set; }
- public string Text { get; private set; }
- public InputLineFlag Flags { get; private set; }
-
- public InputLine(string text, bool execute)
- {
- this.Text = text;
- this.Flags = InputLineFlag.Echo;
-
- if (execute)
- {
- this.Flags |= InputLineFlag.Execute;
- }
- }
-
- public InputLine(SnapshotSpan snapshotSpan)
- {
- this.SnapshotSpan = snapshotSpan;
- this.Text = snapshotSpan.GetText();
- this.Flags = InputLineFlag.Execute;
- }
- }
-}
View
10 knowingnupack/NuPack.Console/NuPackConsole/Console/IHostNameMetadata.cs
@@ -1,10 +0,0 @@
-namespace NuPackConsole.Implementation.Console
-{
- /// <summary>
- /// HostName MEF metadata viewer.
- /// </summary>
- public interface IHostNameMetadata
- {
- string HostName { get; }
- }
-}
View
31 knowingnupack/NuPack.Console/NuPackConsole/Console/InputHistory.cs
@@ -1,31 +0,0 @@
-using System.Collections.Generic;
-
-namespace NuPackConsole.Implementation.Console
-{
- /// <summary>
- /// Simple console input history manager.
- /// </summary>
- class InputHistory
- {
- const int MAX_HISTORY = 50;
-
- Queue<string> _inputs = new Queue<string>();
-
- public void Add(string input)
- {
- if (!string.IsNullOrEmpty(input))
- {
- _inputs.Enqueue(input);
- if (_inputs.Count >= MAX_HISTORY)
- {
- _inputs.Dequeue();
- }
- }
- }
-
- public IList<string> History
- {
- get { return _inputs.ToArray(); }
- }
- }
-}
View
64 knowingnupack/NuPack.Console/NuPackConsole/Console/OleCommandFilter.cs
@@ -1,64 +0,0 @@
-using System;
-using System.Diagnostics;
-using Microsoft.VisualStudio.OLE.Interop;
-using Microsoft.VisualStudio.TextManager.Interop;
-using Microsoft.VisualStudio;
-
-namespace NuPackConsole.Implementation.Console
-{
- class OleCommandFilter : IOleCommandTarget
- {
- public const int OLECMDERR_E_NOTSUPPORTED = (int)Constants.OLECMDERR_E_NOTSUPPORTED;
-
- protected IOleCommandTarget OldChain { get; private set; }
-
- public OleCommandFilter(IVsTextView vsTextView)
- {
- Debug.Assert(vsTextView != null);
-
- IOleCommandTarget _oldChain;
- ErrorHandler.ThrowOnFailure(vsTextView.AddCommandFilter(this, out _oldChain));
- Debug.Assert(_oldChain != null);
-
- this.OldChain = _oldChain;
- }
-
- protected virtual int InternalQueryStatus(ref Guid pguidCmdGroup, uint cCmds, OLECMD[] prgCmds, IntPtr pCmdText)
- {
- return OLECMDERR_E_NOTSUPPORTED;
- }
-
- protected virtual int InternalExec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
- {
- return OLECMDERR_E_NOTSUPPORTED;
- }
-
- #region IOleCommandTarget
-
- public int QueryStatus(ref Guid pguidCmdGroup, uint cCmds, OLECMD[] prgCmds, IntPtr pCmdText)
- {
- int hr = InternalQueryStatus(ref pguidCmdGroup, cCmds, prgCmds, pCmdText);
-
- if (hr == OLECMDERR_E_NOTSUPPORTED)
- {
- hr = OldChain.QueryStatus(ref pguidCmdGroup, cCmds, prgCmds, pCmdText);
- }
-
- return hr;
- }
-
- public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
- {
- int hr = InternalExec(ref pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
-
- if (hr == OLECMDERR_E_NOTSUPPORTED)
- {
- hr = OldChain.Exec(ref pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
- }
-
- return hr;
- }
-
- #endregion
- }
-}
View
238 knowingnupack/NuPack.Console/NuPackConsole/Console/OrderedSpans.cs
@@ -1,238 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.VisualStudio.Text;
-
-namespace NuPackConsole.Implementation.Console
-{
- interface IGetSpan<T>
- {
- Span GetSpan(T t);
- }
-
- class OrderedSpans<T>
- {
- List<T> _items = new List<T>();
- IGetSpan<T> _getSpan;
-
- public OrderedSpans(IGetSpan<T> getSpan)
- {
- UtilityMethods.ThrowIfArgumentNull(getSpan);
- _getSpan = getSpan;
- }
-
- Span GetSpan(T t)
- {
- return _getSpan.GetSpan(t);
- }
-
- public int Count
- {
- get
- {
- return _items.Count;
- }
- }
-
- public T this[int i]
- {
- get
- {
- return _items[i];
- }
- }
-
- public void Clear()
- {
- _items.Clear();
- }
-
- public void Add(T t)
- {
- if (_items.Count > 0 && GetSpan(t).Start < GetSpan(_items[_items.Count - 1]).End)
- {
- throw new InvalidOperationException();
- }
- _items.Add(t);
- }
-
- public void PopLast()
- {
- _items.RemoveAt(_items.Count - 1);
- }
-
- public int FindFirstOverlap(T t)
- {
- if (_items.Count > 0)
- {
- Span span = GetSpan(t);
-
- // Check most recently added item first
- int index = _items.Count - 1;
- Span lastSpan = GetSpan(_items[index]);
- if (lastSpan.Start <= span.Start)
- {
- return lastSpan.OverlapsWith(span) ? index : -1;
- }
-
- // Otherwise start general search
- index = _items.BinarySearch(t, new SpanStartComparer(_getSpan));
- if (index < 0)
- {
- int prior = ~index - 1; // the prior Span whose Start < span.Start
- index = Math.Max(0, prior);
- }
-
- while (index < _items.Count)
- {
- Span curSpan = GetSpan(_items[index]);
- if (curSpan.OverlapsWith(span))
- {
- return index;
- }
-
- if (curSpan.Start >= span.End)
- {
- return -1;
- }
-
- index++;
- }
- }
-
- return -1;
- }
-
- public IEnumerable<T> Overlap(T t)
- {
- int index = FindFirstOverlap(t);
- if (index >= 0)
- {
- Span span = GetSpan(t);
- while (index < _items.Count && GetSpan(_items[index]).OverlapsWith(span))
- {
- yield return _items[index];
- index++;
- }
- }
- }
-
- class SpanStartComparer : Comparer<T>
- {
- IGetSpan<T> _getSpan;
-
- public SpanStartComparer(IGetSpan<T> getSpan)
- {
- _getSpan = getSpan;
- }
-
- public override int Compare(T x, T y)
- {
- return _getSpan.GetSpan(x).Start.CompareTo(
- _getSpan.GetSpan(y).Start);
- }
- }
- }
-
- class OrderedSpans : OrderedSpans<Span>
- {
- public OrderedSpans()
- : base(new SpanGetSapn())
- {
- }
-
- class SpanGetSapn : IGetSpan<Span>
- {
- public Span GetSpan(Span t)
- {
- return t;
- }
- }
- }
-
- class OrderedTupleSpans<T> : OrderedSpans<Tuple<Span, T>>
- {
- public OrderedTupleSpans()
- : base(new TupleGetSpan())
- {
- }
-
- public IEnumerable<Tuple<Span, T>> Overlap(Span span)
- {
- return base.Overlap(Tuple.Create(span, default(T)));
- }
-
- class TupleGetSpan : IGetSpan<Tuple<Span, T>>
- {
- public Span GetSpan(Tuple<Span, T> t)
- {
- return t.Item1;
- }
- }
- }
-
- class ComplexCommandSpans : OrderedTupleSpans<bool>
- {
- public void Add(Span lineSpan, bool endCommand)
- {
- base.Add(Tuple.Create(lineSpan, endCommand));
- }
-
- public int FindCommandStart(int i)
- {
- while (i - 1 >= 0 && !this[i - 1].Item2)
- {
- i--;
- }
- return i;
- }
-
- public new IEnumerable<IList<Span>> Overlap(Span span)
- {
- int i = base.FindFirstOverlap(Tuple.Create(span, true));
- if (i >= 0)
- {
- // Find first line of this complex command
- i = FindCommandStart(i);
-
- while (true)
- {
- // Collect and return one complex command
- List<Span> spans = new List<Span>();
- while (i < this.Count)
- {
- spans.Add(this[i].Item1);
- if (this[i++].Item2)
- {
- break;
- }
- }
- yield return spans;
-
- if (i >= Count || !this[i].Item1.OverlapsWith(span))
- {
- break; // Done
- }
- }
- }
- }
-
- public Span? CurrentCommandStart
- {
- get
- {
- // If the last command line is incomplete
- if (Count > 0 && !this[Count - 1].Item2)
- {
- int i = FindCommandStart(Count - 1);
- if (i >= 0)
- {
- return this[i].Item1;
- }
- }
- return null;
- }
- }
- }
-}
View
109 knowingnupack/NuPack.Console/NuPackConsole/Console/TextFormatClassifier.cs
@@ -1,109 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.Composition;
-using System.Text;
-using System.Windows.Media;
-using Microsoft.VisualStudio.Language.StandardClassification;
-using Microsoft.VisualStudio.Text.Classification;
-using Microsoft.VisualStudio.Text.Editor;
-using Microsoft.VisualStudio.Text.Formatting;
-
-namespace NuPackConsole.Implementation.Console
-{
- public interface ITextFormatClassifier
- {
- IClassificationType GetClassificationType(Color? foreground, Color? background);
- }
-
- public interface ITextFormatClassifierProvider
- {
- ITextFormatClassifier GetTextFormatClassifier(ITextView textView);
- }
-
- [Export(typeof(ITextFormatClassifierProvider))]
- class TextFormatClassifierProvider : ITextFormatClassifierProvider
- {
- [Import]
- internal IStandardClassificationService StandardClassificationService { get; set; }
-
- [Import]
- internal IClassificationTypeRegistryService ClassificationTypeRegistryService { get; set; }
-
- [Import]
- internal IClassificationFormatMapService ClassificationFormatMapService { get; set; }
-
- public ITextFormatClassifier GetTextFormatClassifier(ITextView textView)
- {
- UtilityMethods.ThrowIfArgumentNull(textView);
- return textView.Properties.GetOrCreateSingletonProperty<TextFormatClassifier>(
- () => new TextFormatClassifier(this, textView));
- }
- }
-
- class TextFormatClassifier : ObjectWithFactory<TextFormatClassifierProvider>, ITextFormatClassifier
- {
- ITextView _textView;
-
- Dictionary<Tuple<Color?, Color?>, IClassificationType> _classificationMap =
- new Dictionary<Tuple<Color?, Color?>, IClassificationType>();
-
- public TextFormatClassifier(TextFormatClassifierProvider factory, ITextView textView)
- : base(factory)
- {
- UtilityMethods.ThrowIfArgumentNull(textView);
- _textView = textView;
- }
-
- static string GetClassificationName(Color? foreground, Color? background)
- {
- StringBuilder sb = new StringBuilder(32);
-
- if (foreground != null)
- {
- sb.Append(foreground.Value);
- }
- sb.Append('-'); // Need this to distinguish foreground only with background only
- if (background != null)
- {
- sb.Append(background.Value);
- }
- return sb.ToString();
- }
-
- static TextFormattingRunProperties GetFormat(Color? foreground, Color? background)
- {
- TextFormattingRunProperties fmt = TextFormattingRunProperties.CreateTextFormattingRunProperties();
-
- if (foreground != null)
- {
- fmt = fmt.SetForeground(foreground.Value);
- }
- if (background != null)
- {
- fmt = fmt.SetBackground(background.Value);
- }
- return fmt;
- }
-
- public IClassificationType GetClassificationType(Color? foreground, Color? background)
- {
- var key = Tuple.Create(foreground, background);
- IClassificationType classificationType;
- if (!_classificationMap.TryGetValue(key, out classificationType))
- {
- string classificationName = GetClassificationName(foreground, background);
- classificationType = Factory.ClassificationTypeRegistryService.GetClassificationType(classificationName);
- if (classificationType == null)
- {
- classificationType = Factory.ClassificationTypeRegistryService.CreateClassificationType(
- classificationName, new IClassificationType[] { Factory.StandardClassificationService.NaturalLanguage });
- }
- _classificationMap.Add(key, classificationType);
-
- IClassificationFormatMap formatMap = Factory.ClassificationFormatMapService.GetClassificationFormatMap(_textView);
- formatMap.SetTextProperties(classificationType, GetFormat(foreground, background));
- }
- return classificationType;
- }
- }
-}
View
604 knowingnupack/NuPack.Console/NuPackConsole/Console/WpfConsole.cs
@@ -1,604 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Windows.Media;
-using Microsoft.VisualStudio.Shell;
-using Microsoft.VisualStudio.Text;
-using Microsoft.VisualStudio.Text.Editor;
-using Microsoft.VisualStudio.TextManager.Interop;
-using Microsoft.VisualStudio.Utilities;
-using EditorDefGuidList = Microsoft.VisualStudio.Editor.DefGuidList;
-using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider;
-using IServiceProvider = System.IServiceProvider;
-
-namespace NuPackConsole.Implementation.Console
-{
- interface IPrivateWpfConsole : IWpfConsole
- {
- SnapshotPoint? InputLineStart { get; }
- void BeginInputLine();
- SnapshotSpan? EndInputLine(bool isEcho);
- InputHistory InputHistory { get; }
- }
-
- class WpfConsole : ObjectWithFactory<WpfConsoleService>
- {
- IServiceProvider ServiceProvider { get; set; }
- public string ContentTypeName { get; private set; }
- public string HostName { get; private set; }
-
- public event EventHandler<EventArgs<Tuple<SnapshotSpan, Color?, Color?>>> NewColorSpan;
- public event EventHandler ConsoleCleared;
-
- public WpfConsole(WpfConsoleService factory, IServiceProvider sp, string contentTypeName, string hostName)
- : base(factory)
- {
- UtilityMethods.ThrowIfArgumentNull(sp);
-
- this.ServiceProvider = sp;
- this.ContentTypeName = contentTypeName;
- this.HostName = hostName;
- }
-
- IPrivateConsoleDispatcher _dispatcher;
- public IPrivateConsoleDispatcher Dispatcher
- {
- get
- {
- if (_dispatcher == null)
- {
- _dispatcher = new ConsoleDispatcher(Marshaler);
- }
- return _dispatcher;
- }
- }
-
- IOleServiceProvider OleServiceProvider
- {
- get
- {
- return ServiceProvider.GetService<IOleServiceProvider>(typeof(IOleServiceProvider));
- }
- }
-
- IContentType _contentType;
- IContentType ContentType
- {
- get
- {
- if (_contentType == null)
- {
- _contentType = Factory.ContentTypeRegistryService.GetContentType(this.ContentTypeName);
- if (_contentType == null)
- {
- _contentType = Factory.ContentTypeRegistryService.AddContentType(
- this.ContentTypeName, new string[] { "text" });
- }
- }
-
- return _contentType;
- }
- }
-
- IVsTextBuffer _bufferAdapter;
- IVsTextBuffer VsTextBuffer
- {
- get
- {
- if (_bufferAdapter == null)
- {
- _bufferAdapter = Factory.VsEditorAdaptersFactoryService.CreateVsTextBufferAdapter(OleServiceProvider, ContentType);
- _bufferAdapter.InitializeContent(string.Empty, 0);
- }
-
- return _bufferAdapter;
- }
- }
-
- IWpfTextView _wpfTextView;
- public IWpfTextView WpfTextView
- {
- get
- {
- if (_wpfTextView == null)
- {
- _wpfTextView = Factory.VsEditorAdaptersFactoryService.GetWpfTextView(VsTextView);
- }
-
- return _wpfTextView;
- }
- }
-
- IWpfTextViewHost WpfTextViewHost
- {
- get
- {
- IVsUserData userData = VsTextView as IVsUserData;
- object data;
- Guid guidIWpfTextViewHost = Microsoft.VisualStudio.Editor.DefGuidList.guidIWpfTextViewHost;
- userData.GetData(ref guidIWpfTextViewHost, out data);
- IWpfTextViewHost wpfTextViewHost = data as IWpfTextViewHost;
-
- return wpfTextViewHost;
- }
- }
-
-
- enum ReadOnlyRegionType
- {
- /// <summary>
- /// No ReadOnly region. The whole text buffer allows edit.
- /// </summary>
- None,
-
- /// <summary>
- /// Begin and body are ReadOnly. Only allows edit at the end.
- /// </summary>
- BeginAndBody,
-
- /// <summary>
- /// The whole text buffer is ReadOnly. Does not allow any edit.
- /// </summary>
- All
- };
-
- IReadOnlyRegion _readOnlyRegionBegin;
- IReadOnlyRegion _readOnlyRegionBody;
-
- ReadOnlyRegionType _readOnlyRegion;
- ReadOnlyRegionType ReadOnlyRegion
- {
- get
- {
- return _readOnlyRegion;
- }
- set
- {
- ITextBuffer buffer = WpfTextView.TextBuffer;
- ITextSnapshot snapshot = buffer.CurrentSnapshot;
-
- using (IReadOnlyRegionEdit edit = buffer.CreateReadOnlyRegionEdit())
- {
- edit.ClearReadOnlyRegion(ref _readOnlyRegionBegin);
- edit.ClearReadOnlyRegion(ref _readOnlyRegionBody);
-
- switch (value)
- {
- case ReadOnlyRegionType.BeginAndBody:
- if (snapshot.Length > 0)
- {
- _readOnlyRegionBegin = edit.CreateReadOnlyRegion(new Span(0, 0), SpanTrackingMode.EdgeExclusive, EdgeInsertionMode.Deny);
- _readOnlyRegionBody = edit.CreateReadOnlyRegion(new Span(0, snapshot.Length));
- }
- break;
-
- case ReadOnlyRegionType.All:
- _readOnlyRegionBody = edit.CreateReadOnlyRegion(new Span(0, snapshot.Length), SpanTrackingMode.EdgeExclusive, EdgeInsertionMode.Deny);
- break;
- }
-
- edit.Apply();
- }
-
- _readOnlyRegion = value;
- }
- }
-
- SnapshotPoint? _inputLineStart;
-
- /// <summary>
- /// Get current input line start point (updated to current WpfTextView's text snapshot).
- /// </summary>
- public SnapshotPoint? InputLineStart
- {
- get
- {
- if (_inputLineStart != null)
- {
- ITextSnapshot snapshot = WpfTextView.TextSnapshot;
- if (_inputLineStart.Value.Snapshot != snapshot)
- {
- _inputLineStart = _inputLineStart.Value.TranslateTo(snapshot, PointTrackingMode.Negative);
- }
- }
- return _inputLineStart;
- }
- }
-
- public int InputLineStartColumn
- {
- get
- {
- Debug.Assert(_inputLineStart != null);
- SnapshotPoint startPoint = _inputLineStart.Value;
- return startPoint - startPoint.GetContainingLine().Start;
- }
- }
-
- public SnapshotSpan GetInputLineExtent(int start = 0, int length = -1)
- {
- Debug.Assert(_inputLineStart != null);
-
- SnapshotPoint beginPoint = InputLineStart.Value + start;
- return length >= 0 ?
- new SnapshotSpan(beginPoint, length) :
- new SnapshotSpan(beginPoint, beginPoint.GetContainingLine().End);
- }
-
- public SnapshotSpan InputLineExtent
- {
- get
- {
- return GetInputLineExtent();
- }
- }
-
- /// <summary>
- /// Get the snapshot extent from InputLineStart to END. Normally this console expects
- /// one line only on InputLine. However in some cases multiple lines could appear, e.g.
- /// when a DTE event handler writes to the console. This scenario is not fully supported,
- /// but it is better to clean up nicely with ESC/ArrowUp/Return.
- /// </summary>
- public SnapshotSpan AllInputExtent
- {
- get
- {
- SnapshotPoint start = InputLineStart.Value;
- return new SnapshotSpan(start, start.Snapshot.GetEnd());
- }
- }
-
- public string InputLineText
- {
- get
- {
- return InputLineExtent.GetText();
- }
- }
-
- public void BeginInputLine()
- {
- if (_inputLineStart == null)
- {
- ReadOnlyRegion = ReadOnlyRegionType.BeginAndBody;
- _inputLineStart = WpfTextView.TextSnapshot.GetEnd();
- }
- }
-
- public SnapshotSpan? EndInputLine(bool isEcho = false)
- {
- // Reset history navigation upon end of a command line
- ResetNavigateHistory();
-
- if (_inputLineStart != null)
- {
- SnapshotSpan inputSpan = InputLineExtent;
-
- _inputLineStart = null;
- ReadOnlyRegion = ReadOnlyRegionType.All;
- if (!isEcho)
- {
- Dispatcher.PostInputLine(new InputLine(inputSpan));
- }
-
- return inputSpan;
- }
-
- return null;
- }
-
- #region Marshaler
-
- _Marshaler _marshaler;
- _Marshaler Marshaler
- {
- get
- {
- if (_marshaler == null)
- {
- _marshaler = new _Marshaler(this);
- }
- return _marshaler;
- }
- }
-
- public IWpfConsole MarshalledConsole
- {
- get { return this.Marshaler; }
- }
-
- class _Marshaler : Marshaler<WpfConsole>, IWpfConsole, IPrivateWpfConsole
- {
- public _Marshaler(WpfConsole impl)
- : base(impl)
- {
- }
-
- #region IConsole
- public IHost Host
- {
- get { return Invoke(() => _impl.Host); }
- set { Invoke(() => { _impl.Host = value; }); }
- }
-
- public IConsoleDispatcher Dispatcher
- {
- get { return Invoke(() => _impl.Dispatcher); }
- }
-
- public int ConsoleWidth
- {
- get { return Invoke(() => _impl.ConsoleWidth); }
- }
-
- public void Write(string text)
- {
- Invoke(() => _impl.Write(text));
- }
-
- public void WriteLine(string text)
- {
- Invoke(() => _impl.WriteLine(text));
- }
-
- public void Write(string text, Color? foreground, Color? background)
- {
- Invoke(() => _impl.Write(text, foreground, background));
- }
-
- public void Clear()
- {
- Invoke(() => _impl.Clear());
- }
- #endregion
-
- #region IWpfConsole
- public object Content
- {
- get { return Invoke(() => _impl.Content); }
- }
-
- public object VsTextView
- {
- get { return Invoke(() => _impl.VsTextView); }
- }
- #endregion
-
- #region IPrivateWpfConsole
- public SnapshotPoint? InputLineStart
- {
- get { return Invoke(() => _impl.InputLineStart); }
- }
-
- public void BeginInputLine()
- {
- Invoke(() => _impl.BeginInputLine());
- }
-
- public SnapshotSpan? EndInputLine(bool isEcho)
- {
- return Invoke(() => _impl.EndInputLine(isEcho));
- }
-
- public InputHistory InputHistory
- {
- get { return Invoke(() => _impl.InputHistory); }
- }
- #endregion
- }
-
- #endregion
-
- #region IConsole
- IHost _host;
- public IHost Host
- {
- get
- {
- return _host;
- }
- set
- {
- if (_host != null)
- {
- throw new InvalidOperationException();
- }
- _host = value;
- }
- }
-
- int _consoleWidth = -1;
- public int ConsoleWidth
- {
- get
- {
- if (_consoleWidth < 0)
- {
- ITextViewMargin leftMargin = WpfTextViewHost.GetTextViewMargin(PredefinedMarginNames.Left);
- ITextViewMargin rightMargin = WpfTextViewHost.GetTextViewMargin(PredefinedMarginNames.Right);
-
- double marginSize = 0.0;
- if (leftMargin != null && leftMargin.Enabled)
- {
- marginSize += leftMargin.MarginSize;
- }
- if (rightMargin != null && rightMargin.Enabled)
- {
- marginSize += rightMargin.MarginSize;
- }
-
- int n = (int)((WpfTextView.ViewportWidth - marginSize) / WpfTextView.FormattedLineSource.ColumnWidth);
- _consoleWidth = Math.Max(80, n); // Larger of 80 or n
- }
- return _consoleWidth;
- }
- }
-
- void ResetConsoleWidth()
- {
- _consoleWidth = -1;
- }
-
- public void Write(string text)
- {
- if (_inputLineStart == null) // If not in input mode, need unlock to enable output
- {
- this.ReadOnlyRegion = ReadOnlyRegionType.None;
- }
-
- // Append text to editor buffer
- ITextBuffer textBuffer = WpfTextView.TextBuffer;
- textBuffer.Insert(textBuffer.CurrentSnapshot.Length, text);
-
- // Ensure caret visible (scroll)
- WpfTextView.Caret.EnsureVisible();
-
- if (_inputLineStart == null) // If not in input mode, need lock again
- {
- this.ReadOnlyRegion = ReadOnlyRegionType.All;
- }
- }
-
- public void WriteLine(string text)
- {
- // If append \n only, text becomes 1 line when copied to notepad.
- Write(text + Environment.NewLine);
- }
-
- public void Write(string text, Color? foreground, Color? background)
- {
- int begin = WpfTextView.TextSnapshot.Length;
- Write(text);
- int end = WpfTextView.TextSnapshot.Length;
-
- if (foreground != null || background != null)
- {
- SnapshotSpan span = new SnapshotSpan(WpfTextView.TextSnapshot, begin, end - begin);
- NewColorSpan.Raise(this, Tuple.Create(span, foreground, background));
- }
- }
-
- InputHistory _inputHistory;
- InputHistory InputHistory
- {
- get
- {
- if (_inputHistory == null)
- {
- _inputHistory = new InputHistory();
- }
- return _inputHistory;
- }
- }
-
- IList<string> _historyInputs;
- int _currentHistoryInputIndex;
-
- void ResetNavigateHistory()
- {
- _historyInputs = null;
- _currentHistoryInputIndex = -1;
- }
-
- public void NavigateHistory(int offset)
- {
- if (_historyInputs == null)
- {
- _historyInputs = InputHistory.History;
- if (_historyInputs == null)
- {
- _historyInputs = new string[] { };
- }
-
- _currentHistoryInputIndex = _historyInputs.Count;
- }
-
- int index = _currentHistoryInputIndex + offset;
- if (index >= -1 && index <= _historyInputs.Count)
- {
- _currentHistoryInputIndex = index;
- string input = (index >= 0 && index < _historyInputs.Count) ? _historyInputs[_currentHistoryInputIndex] : string.Empty;
-
- // Replace all text after InputLineStart with new text
- WpfTextView.TextBuffer.Replace(AllInputExtent, input);
- WpfTextView.Caret.EnsureVisible();
- }
- }
-
- public void Clear()
- {
- this.ReadOnlyRegion = ReadOnlyRegionType.None;
-
- ITextBuffer textBuffer = WpfTextView.TextBuffer;
- textBuffer.Delete(new Span(0, textBuffer.CurrentSnapshot.Length));
-
- // Dispose existing incompleted input line
- _inputLineStart = null;
-
- // Raise event
- ConsoleCleared.Raise(this);
- }
-
- #endregion
-
- #region IWpfConsole
-
- IVsTextView _view;
- public IVsTextView VsTextView
- {
- get
- {
- if (_view == null)
- {
- _view = Factory.VsEditorAdaptersFactoryService.CreateVsTextViewAdapter(OleServiceProvider);
- _view.Initialize(
- VsTextBuffer as IVsTextLines,
- IntPtr.Zero,
- (uint)(TextViewInitFlags.VIF_HSCROLL | TextViewInitFlags.VIF_VSCROLL) | (uint)TextViewInitFlags3.VIF_NO_HWND_SUPPORT,
- null);
-
- // Set font and color
- IVsTextEditorPropertyCategoryContainer propCategoryContainer = _view as IVsTextEditorPropertyCategoryContainer;
- if (propCategoryContainer != null)
- {
- IVsTextEditorPropertyContainer propContainer;
- Guid guidPropCategory = EditorDefGuidList.guidEditPropCategoryViewMasterSettings;
- propCategoryContainer.GetPropertyCategory(ref guidPropCategory, out propContainer);
- propContainer.SetProperty(VSEDITPROPID.VSEDITPROPID_ViewGeneral_FontCategory, EditorDefGuidList.guidCommandWindowFontCategory);
- propContainer.SetProperty(VSEDITPROPID.VSEDITPROPID_ViewGeneral_ColorCategory, EditorDefGuidList.guidCommandWindowFontCategory);
- }
-
- // add myself as IConsole
- WpfTextView.TextBuffer.Properties.AddProperty(typeof(IConsole), this);
-
- // Initial mark readonly region. Must call Start() to start accepting inputs.
- this.ReadOnlyRegion = ReadOnlyRegionType.All;
-
- // Set some EditorOptions: -DragDropEditing, +WordWrap
- IEditorOptions editorOptions = Factory.EditorOptionsFactoryService.GetOptions(WpfTextView);
- editorOptions.SetOptionValue(DefaultTextViewOptions.DragDropEditingId, false);
- editorOptions.SetOptionValue(DefaultTextViewOptions.WordWrapStyleId, WordWrapStyles.WordWrap);
-
- // Reset console width when needed
- WpfTextView.ViewportWidthChanged += (sender, e) => ResetConsoleWidth();
- WpfTextView.ZoomLevelChanged += (sender, e) => ResetConsoleWidth();
-
- // Create my Command Filter
- new WpfConsoleKeyProcessor(this);
- }
-
- return _view;
- }
- }
-
- public object Content
- {
- get
- {
- return WpfTextViewHost.HostControl;
- }
- }
-
- #endregion
- }
-}
View
295 knowingnupack/NuPack.Console/NuPackConsole/Console/WpfConsoleClassifier.cs
@@ -1,295 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Windows.Media;
-using Microsoft.VisualStudio.Text;
-using Microsoft.VisualStudio.Text.Classification;
-
-namespace NuPackConsole.Implementation.Console
-{
- class WpfConsoleClassifier : ObjectWithFactory<WpfConsoleService>, IClassifier
- {
- ITextBuffer TextBuffer { get; set; }
- ComplexCommandSpans _commandLineSpans = new ComplexCommandSpans();
- OrderedTupleSpans<IClassificationType> _colorSpans = new OrderedTupleSpans<IClassificationType>();
-
- public WpfConsoleClassifier(WpfConsoleService factory, ITextBuffer textBuffer)
- : base(factory)
- {
- this.TextBuffer = textBuffer;
- TextBuffer.Changed += TextBuffer_Changed;
- }
-
- void TextBuffer_Changed(object sender, TextContentChangedEventArgs e)
- {
- // When input line changes, raise ClassificationChanged event
- if (HasConsole && Console.InputLineStart != null)
- {
- SnapshotSpan commandExtent = Console.InputLineExtent;
- if (e.Changes.Any((c) => c.OldPosition >= commandExtent.Span.Start))
- {
- if (_commandLineSpans.Count > 0)
- {
- int i = _commandLineSpans.FindCommandStart(_commandLineSpans.Count - 1);
- commandExtent = new SnapshotSpan(
- new SnapshotPoint(commandExtent.Snapshot, _commandLineSpans[i].Item1.Start),
- commandExtent.End);
- }
- this.ClassificationChanged.Raise(this, new ClassificationChangedEventArgs(commandExtent));
- }
- }
- }
-
- /// <summary>
- /// The CommandTokenizer for this console if available.
- /// </summary>
- ICommandTokenizer CommandTokenizer { get; set; }
-
- WpfConsole _console;
- WpfConsole Console
- {
- get
- {
- if (_console == null)
- {
- TextBuffer.Properties.TryGetProperty<WpfConsole>(typeof(IConsole), out _console);
- if (_console != null)
- {
- // Only processing command lines when we have a CommandTokenizer
- CommandTokenizer = Factory.GetCommandTokenizer(_console);
- if (CommandTokenizer != null)
- {
- _console.Dispatcher.ExecuteInputLine += Console_ExecuteInputLine;
- }
-
- _console.NewColorSpan += Console_NewColorSpan;
- _console.ConsoleCleared += Console_ConsoleCleared;
- }
- }
-
- return _console;
- }
- }
-
- void Console_ExecuteInputLine(object sender, EventArgs<Tuple<SnapshotSpan, bool>> e)
- {
- // Don't add empty spans (e.g. executed "cls")
- SnapshotSpan snapshotSpan = e.Arg.Item1.TranslateTo(Console.WpfTextView.TextSnapshot, SpanTrackingMode.EdgePositive);
- if (!snapshotSpan.IsEmpty)
- {
- _commandLineSpans.Add(snapshotSpan, e.Arg.Item2);
- }
- }
-
- void Console_NewColorSpan(object sender, EventArgs<Tuple<SnapshotSpan, Color?, Color?>> e)
- {
- // At least one of foreground or background must be specified, otherwise we don't care.
- if (e.Arg.Item2 != null || e.Arg.Item3 != null)
- {
- _colorSpans.Add(Tuple.Create(
- e.Arg.Item1.Span,
- TextFormatClassifier.GetClassificationType(e.Arg.Item2, e.Arg.Item3)));
-
- ClassificationChanged.Raise(this, new ClassificationChangedEventArgs(e.Arg.Item1));
- }
- }
-
- void Console_ConsoleCleared(object sender, EventArgs e)
- {
- ClearCachedCommandLineClassifications();
- _commandLineSpans.Clear();
- _colorSpans.Clear();
- }
-
- ITextFormatClassifier _textFormatClassifier;
- ITextFormatClassifier TextFormatClassifier
- {
- get
- {
- if (_textFormatClassifier == null)
- {
- _textFormatClassifier = Factory.TextFormatClassifierProvider.GetTextFormatClassifier(
- Console.WpfTextView);
- }
- return _textFormatClassifier;
- }
- }
-
- bool HasConsole
- {
- get { return Console != null; }
- }
-
- #region IClassifier
-
- public event EventHandler<ClassificationChangedEventArgs> ClassificationChanged;
-
- public IList<ClassificationSpan> GetClassificationSpans(SnapshotSpan span)
- {
- List<ClassificationSpan> classificationSpans = new List<ClassificationSpan>();
- if (HasConsole)
- {
- ITextSnapshot snapshot = span.Snapshot;
-
- // Check command line spans
- if (CommandTokenizer != null)
- {
- bool hasInputLine = Console.InputLineStart != null;
- if (hasInputLine)
- {
- // Add current input line temporarily
- _commandLineSpans.Add(Console.InputLineExtent, false);
- }
- try
- {
- foreach (var cmdSpans in _commandLineSpans.Overlap(span))
- {
- if (cmdSpans.Count > 0)
- {
- classificationSpans.AddRange(GetCommandLineClassifications(snapshot, cmdSpans));
- }
- }
- }
- finally
- {
- if (hasInputLine)
- {
- // Remove added current input line
- _commandLineSpans.PopLast();
- }
- }
- }
-
- // Check color spans
- foreach (var t in _colorSpans.Overlap(span))
- {
- classificationSpans.Add(new ClassificationSpan(
- new SnapshotSpan(snapshot, t.Item1), t.Item2));
- }
- }
- return classificationSpans;
- }
-
- /// <summary>
- /// Get classifications for one complex command.
- /// </summary>
- /// <param name="snapshot">The snapshot for the command spans.</param>
- /// <param name="cmdSpans">The command spans.</param>
- /// <returns>List of classifications for the given command spans.</returns>
- /// <remarks>
- /// The editor queries for classifications line by line. For a n-line complex command, this will be
- /// called n times for the same command. This implementation caches one parsed results for the last
- /// command.
- /// </remarks>
- IList<ClassificationSpan> GetCommandLineClassif