Browse Source

Create EnvDTE and Visual Studio API classes without any implementation to support MvcScaffolding.

pull/28/head
Matt Ward 14 years ago
parent
commit
f12e3df59e
  1. 35
      src/AddIns/Misc/PackageManagement/Project/PackageManagement.csproj
  2. 16
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeAttribute.cs
  3. 22
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeAttribute2.cs
  4. 22
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeAttributeArgument.cs
  5. 19
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeClass.cs
  6. 14
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeClass2.cs
  7. 12
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeDelegate.cs
  8. 27
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeElement.cs
  9. 15
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeElements.cs
  10. 12
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeFunction.cs
  11. 19
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeInterface.cs
  12. 23
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeModel.cs
  13. 22
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeNamespace.cs
  14. 36
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeProperty.cs
  15. 26
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeProperty2.cs
  16. 12
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeStruct.cs
  17. 28
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeType.cs
  18. 26
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeTypeRef.cs
  19. 18
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeTypeRef2.cs
  20. 12
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeVariable.cs
  21. 18
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/Configuration.cs
  22. 18
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/ConfigurationManager.cs
  23. 4
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/DTE.cs
  24. 4
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/DirectoryProjectItems.cs
  25. 19
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/EditPoint.cs
  26. 40
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/Project.cs
  27. 28
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/ProjectItem.cs
  28. 49
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/ProjectItems.cs
  29. 26
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/Projects.cs
  30. 13
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/Properties.cs
  31. 10
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/Property.cs
  32. 8
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/Solution.cs
  33. 29
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/SourceControl.cs
  34. 21
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/TextPoint.cs
  35. 12
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/vsCMAccess.cs
  36. 12
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/vsCMFunction.cs
  37. 12
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/vsCMInfoLocation.cs
  38. 13
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/vsCMPropertyKind.cs
  39. 15
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/vsEPReplaceTextOptions.cs
  40. 20
      src/AddIns/Misc/PackageManagement/Project/Src/VisualStudio/FlavoredProject.cs
  41. 12
      src/AddIns/Misc/PackageManagement/Project/Src/VisualStudio/IVsAggregatableProject.cs
  42. 12
      src/AddIns/Misc/PackageManagement/Project/Src/VisualStudio/IVsHierarchy.cs
  43. 12
      src/AddIns/Misc/PackageManagement/Project/Src/VisualStudio/IVsSolution.cs
  44. 4
      src/AddIns/Misc/PackageManagement/Project/Src/VisualStudio/Package.cs
  45. 25
      src/AddIns/Misc/PackageManagement/Project/Src/VisualStudio/ThreadHelper.cs
  46. 1
      src/AddIns/Misc/PackageManagement/Test/PackageManagement.Tests.csproj
  47. 25
      src/AddIns/Misc/PackageManagement/Test/Src/EnvDTE/ProjectItemPropertyTests.cs
  48. 3
      src/AddIns/Misc/PackageManagement/Test/Src/EnvDTE/ProjectItemTests.cs
  49. 11
      src/AddIns/Misc/PackageManagement/Test/Src/EnvDTE/ProjectItemsTests.cs
  50. 2
      src/AddIns/Misc/PackageManagement/Test/Src/EnvDTE/ProjectPropertyTests.cs
  51. 3
      src/AddIns/Misc/PackageManagement/Test/Src/EnvDTE/ReferencesTests.cs
  52. 4
      src/AddIns/Misc/PackageManagement/Test/Src/EnvDTE/TextEditorFontsAndColorsPropertyFactoryTests.cs
  53. 27
      src/AddIns/Misc/PackageManagement/Test/Src/Helpers/PropertiesHelper.cs

35
src/AddIns/Misc/PackageManagement/Project/PackageManagement.csproj

@ -74,6 +74,36 @@ @@ -74,6 +74,36 @@
<Compile Include="Src\Design\DesignTimeSelectProjectsViewModel.cs" />
<Compile Include="Src\Design\FakePackageOperation.cs" />
<Compile Include="Src\Design\FakeSelectedProject.cs" />
<Compile Include="Src\EnvDTE\CodeAttribute.cs" />
<Compile Include="Src\EnvDTE\CodeAttribute2.cs" />
<Compile Include="Src\EnvDTE\CodeAttributeArgument.cs" />
<Compile Include="Src\EnvDTE\CodeClass.cs" />
<Compile Include="Src\EnvDTE\CodeClass2.cs" />
<Compile Include="Src\EnvDTE\CodeDelegate.cs" />
<Compile Include="Src\EnvDTE\CodeElement.cs" />
<Compile Include="Src\EnvDTE\CodeElements.cs" />
<Compile Include="Src\EnvDTE\CodeFunction.cs" />
<Compile Include="Src\EnvDTE\CodeInterface.cs" />
<Compile Include="Src\EnvDTE\CodeModel.cs" />
<Compile Include="Src\EnvDTE\CodeNamespace.cs" />
<Compile Include="Src\EnvDTE\CodeProperty.cs" />
<Compile Include="Src\EnvDTE\CodeProperty2.cs" />
<Compile Include="Src\EnvDTE\CodeStruct.cs" />
<Compile Include="Src\EnvDTE\CodeType.cs" />
<Compile Include="Src\EnvDTE\CodeTypeRef.cs" />
<Compile Include="Src\EnvDTE\CodeTypeRef2.cs" />
<Compile Include="Src\EnvDTE\CodeVariable.cs" />
<Compile Include="Src\EnvDTE\ConfigurationManager.cs" />
<Compile Include="Src\EnvDTE\Configuration.cs" />
<Compile Include="Src\EnvDTE\EditPoint.cs" />
<Compile Include="Src\EnvDTE\Projects.cs" />
<Compile Include="Src\EnvDTE\SourceControl.cs" />
<Compile Include="Src\EnvDTE\TextPoint.cs" />
<Compile Include="Src\EnvDTE\vsCMAccess.cs" />
<Compile Include="Src\EnvDTE\vsCMFunction.cs" />
<Compile Include="Src\EnvDTE\vsCMInfoLocation.cs" />
<Compile Include="Src\EnvDTE\vsCMPropertyKind.cs" />
<Compile Include="Src\EnvDTE\vsEPReplaceTextOptions.cs" />
<Compile Include="Src\InstalledPackageViewModel.cs" />
<Compile Include="Src\InstalledPackageViewModelFactory.cs" />
<Compile Include="Src\IPackageManagementSelectedProject.cs" />
@ -365,9 +395,14 @@ @@ -365,9 +395,14 @@
<Compile Include="Src\UpdatePackageInAllProjects.cs" />
<Compile Include="Src\ViewModelBase.cs" />
<Compile Include="Src\PackageManagementViewModels.cs" />
<Compile Include="Src\VisualStudio\FlavoredProject.cs" />
<Compile Include="Src\VisualStudio\IVsAggregatableProject.cs" />
<Compile Include="Src\VisualStudio\IVsHierarchy.cs" />
<Compile Include="Src\VisualStudio\IVsSolution.cs" />
<Compile Include="Src\VisualStudio\NotInstalledException.cs" />
<Compile Include="Src\VisualStudio\Package.cs" />
<Compile Include="Src\VisualStudio\SVsExtensionManager.cs" />
<Compile Include="Src\VisualStudio\ThreadHelper.cs" />
</ItemGroup>
<ItemGroup>
<Page Include="Src\ManagePackagesView.xaml" />

16
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeAttribute.cs

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public class CodeAttribute : CodeElement
{
public CodeAttribute()
{
}
public virtual string Value { get; set; }
}
}

22
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeAttribute2.cs

@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public class CodeAttribute2 : CodeAttribute
{
public CodeAttribute2()
{
}
public virtual string FullName {
get { throw new NotImplementedException(); }
}
public virtual CodeElements Arguments {
get { throw new NotImplementedException(); }
}
}
}

22
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeAttributeArgument.cs

@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public class CodeAttributeArgument : MarshalByRefObject
{
public CodeAttributeArgument()
{
}
public virtual string Name {
get { throw new NotImplementedException(); }
}
public virtual string Value {
get { throw new NotImplementedException(); }
}
}
}

19
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeClass.cs

@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public class CodeClass : CodeType
{
public virtual CodeElements ImplementedInterfaces {
get { throw new NotImplementedException(); }
}
public virtual CodeVariable AddVariable(string name, object type, object Position = null, vsCMAccess Access = vsCMAccess.vsCMAccessPublic, object Location = null)
{
throw new NotImplementedException();
}
}
}

14
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeClass2.cs

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public class CodeClass2 : CodeClass
{
public CodeElements PartialClasses {
get { throw new NotImplementedException(); }
}
}
}

12
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeDelegate.cs

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public class CodeDelegate : CodeElement
{
public vsCMAccess Access { get; set; }
}
}

27
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeElement.cs

@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public class CodeElement : MarshalByRefObject
{
public virtual string Name { get; set; }
public virtual string Language { get; private set; }
// default is vsCMPart.vsCMPartWholeWithAttributes
public virtual TextPoint GetStartPoint()
{
throw new NotImplementedException();
}
public virtual TextPoint GetEndPoint()
{
throw new NotImplementedException();
}
public virtual vsCMInfoLocation InfoLocation { get; private set; }
public virtual DTE DTE { get; private set; }
}
}

15
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeElements.cs

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public interface CodeElements : IEnumerable
{
new IEnumerator GetEnumerator();
int Count { get; }
}
}

12
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeFunction.cs

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public class CodeFunction : CodeElement
{
public vsCMAccess Access { get; set; }
}
}

19
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeInterface.cs

@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public class CodeInterface : CodeType
{
public CodeInterface()
{
}
public CodeFunction AddFunction(string name, vsCMFunction kind, object type, object Position = null, vsCMAccess Access = vsCMAccess.vsCMAccessPublic)
{
throw new NotImplementedException();
}
}
}

23
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeModel.cs

@ -0,0 +1,23 @@ @@ -0,0 +1,23 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public class CodeModel : MarshalByRefObject
{
public CodeModel()
{
}
public CodeElements CodeElements {
get { throw new NotImplementedException(); }
}
public CodeType CodeTypeFromFullName(string name)
{
throw new NotImplementedException();
}
}
}

22
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeNamespace.cs

@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public class CodeNamespace : CodeElement
{
public CodeNamespace()
{
}
public string FullName {
get { throw new NotImplementedException(); }
}
public CodeElements Members {
get { throw new NotImplementedException(); }
}
}
}

36
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeProperty.cs

@ -0,0 +1,36 @@ @@ -0,0 +1,36 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public class CodeProperty : CodeElement
{
public CodeProperty()
{
}
public virtual vsCMAccess Access { get; set; }
public virtual CodeClass Parent {
get { throw new NotImplementedException(); }
}
public virtual CodeElements Attributes {
get { throw new NotImplementedException(); }
}
public virtual CodeTypeRef Type {
get { throw new NotImplementedException(); }
}
public virtual CodeFunction Getter {
get { throw new NotImplementedException(); }
}
public virtual CodeFunction Setter {
get { throw new NotImplementedException(); }
}
}
}

26
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeProperty2.cs

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public class CodeProperty2 : CodeProperty
{
public CodeProperty2()
{
}
public CodeElements Members {
get { throw new NotImplementedException(); }
}
public vsCMPropertyKind ReadWrite {
get { throw new NotImplementedException(); }
}
public CodeElements Parameters {
get { throw new NotImplementedException(); }
}
}
}

12
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeStruct.cs

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public class CodeStruct : CodeElement
{
public vsCMAccess Access { get; set; }
}
}

28
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeType.cs

@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public class CodeType : CodeElement
{
public virtual vsCMAccess Access { get; set; }
public virtual string FullName {
get { throw new NotImplementedException(); }
}
public virtual CodeElements Members {
get { throw new NotImplementedException(); }
}
public virtual CodeElements Bases {
get { throw new NotImplementedException(); }
}
public virtual CodeElements Attributes {
get { throw new NotImplementedException(); }
}
}
}

26
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeTypeRef.cs

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public class CodeTypeRef : MarshalByRefObject
{
public CodeTypeRef()
{
}
public virtual string AsFullName {
get { throw new NotImplementedException(); }
}
public virtual object Parent {
get { throw new NotImplementedException(); }
}
public virtual CodeType CodeType {
get { throw new NotImplementedException(); }
}
}
}

18
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeTypeRef2.cs

@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public class CodeTypeRef2 : CodeTypeRef
{
public CodeTypeRef2()
{
}
public bool IsGeneric {
get { throw new NotImplementedException(); }
}
}
}

12
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/CodeVariable.cs

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public class CodeVariable : CodeElement
{
public vsCMAccess Access { get; set; }
}
}

18
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/Configuration.cs

@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public class Configuration : MarshalByRefObject
{
public Configuration()
{
}
public Properties Properties {
get { throw new NotImplementedException(); }
}
}
}

18
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/ConfigurationManager.cs

@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public class ConfigurationManager : MarshalByRefObject
{
public ConfigurationManager()
{
}
public Configuration ActiveConfiguration {
get { throw new NotImplementedException(); }
}
}
}

4
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/DTE.cs

@ -69,5 +69,9 @@ namespace ICSharpCode.PackageManagement.EnvDTE @@ -69,5 +69,9 @@ namespace ICSharpCode.PackageManagement.EnvDTE
{
return projectService.GetOpenProjects();
}
public SourceControl SourceControl {
get { throw new NotImplementedException(); }
}
}
}

4
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/DirectoryProjectItems.cs

@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.Collections;
namespace ICSharpCode.PackageManagement.EnvDTE
{
@ -16,7 +16,7 @@ namespace ICSharpCode.PackageManagement.EnvDTE @@ -16,7 +16,7 @@ namespace ICSharpCode.PackageManagement.EnvDTE
this.projectItem = projectItem;
}
public override IEnumerator<ProjectItem> GetEnumerator()
public override IEnumerator GetEnumerator()
{
var items = new ChildProjectItems(projectItem);
return items.GetEnumerator();

19
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/EditPoint.cs

@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public class EditPoint : TextPoint
{
public EditPoint()
{
}
public void ReplaceText(object pointOrCount, string text, int Flags)
{
throw new NotImplementedException();
}
}
}

40
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/Project.cs

@ -39,29 +39,41 @@ namespace ICSharpCode.PackageManagement.EnvDTE @@ -39,29 +39,41 @@ namespace ICSharpCode.PackageManagement.EnvDTE
ProjectItems = new ProjectItems(this, fileService);
}
public Project()
{
}
void CreateProperties()
{
var propertyFactory = new ProjectPropertyFactory(this);
Properties = new Properties(propertyFactory);
}
public string Name {
public virtual string Kind {
get { throw new NotImplementedException(); }
}
public virtual string Name {
get { return MSBuildProject.Name; }
}
public virtual string UniqueName {
get { throw new NotImplementedException(); }
}
public string FileName {
public virtual string FileName {
get { return MSBuildProject.FileName; }
}
public string FullName {
public virtual string FullName {
get { return FileName; }
}
public ProjectObject Object { get; private set; }
public Properties Properties { get; private set; }
public ProjectItems ProjectItems { get; private set; }
public virtual object Object { get; private set; }
public virtual Properties Properties { get; private set; }
public virtual ProjectItems ProjectItems { get; private set; }
public DTE DTE {
public virtual DTE DTE {
get {
if (dte == null) {
dte = new DTE(projectService, fileService);
@ -70,7 +82,7 @@ namespace ICSharpCode.PackageManagement.EnvDTE @@ -70,7 +82,7 @@ namespace ICSharpCode.PackageManagement.EnvDTE
}
}
public string Type {
public virtual string Type {
get { return GetProjectType(); }
}
@ -82,12 +94,12 @@ namespace ICSharpCode.PackageManagement.EnvDTE @@ -82,12 +94,12 @@ namespace ICSharpCode.PackageManagement.EnvDTE
internal MSBuildBasedProject MSBuildProject { get; private set; }
public void Save()
public virtual void Save()
{
projectService.Save(MSBuildProject);
}
internal void AddReference(string path)
internal virtual void AddReference(string path)
{
if (!HasReference(path)) {
var referenceItem = new ReferenceProjectItem(MSBuildProject, path);
@ -154,5 +166,13 @@ namespace ICSharpCode.PackageManagement.EnvDTE @@ -154,5 +166,13 @@ namespace ICSharpCode.PackageManagement.EnvDTE
}
return names;
}
public virtual CodeModel CodeModel {
get { throw new NotImplementedException(); }
}
public virtual ConfigurationManager ConfigurationManager {
get { throw new NotImplementedException(); }
}
}
}

28
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/ProjectItem.cs

@ -26,21 +26,33 @@ namespace ICSharpCode.PackageManagement.EnvDTE @@ -26,21 +26,33 @@ namespace ICSharpCode.PackageManagement.EnvDTE
CreateProperties();
}
public ProjectItem()
{
}
void CreateProperties()
{
var propertyFactory = new ProjectItemPropertyFactory(this);
Properties = new Properties(propertyFactory);
}
public string Name {
public virtual string Name {
get { return Path.GetFileName(projectItem.Include); }
}
public Properties Properties { get; private set; }
public Project ContainingProject { get; private set; }
public ProjectItems ProjectItems { get; private set; }
public virtual string Kind {
get { throw new NotImplementedException(); }
}
public Project SubProject {
get { throw new NotImplementedException(); }
}
public virtual Properties Properties { get; private set; }
public virtual Project ContainingProject { get; private set; }
public virtual ProjectItems ProjectItems { get; private set; }
internal object GetProperty(string name)
internal virtual object GetProperty(string name)
{
if (name == CopyToOutputDirectoryPropertyName) {
return GetCopyToOutputDirectory();
@ -57,7 +69,7 @@ namespace ICSharpCode.PackageManagement.EnvDTE @@ -57,7 +69,7 @@ namespace ICSharpCode.PackageManagement.EnvDTE
return (UInt32)projectItem.CopyToOutputDirectory;
}
internal void SetProperty(string name, object value)
internal virtual void SetProperty(string name, object value)
{
if (name == CopyToOutputDirectoryPropertyName) {
SetCopyToOutputDirectory(value);
@ -78,7 +90,7 @@ namespace ICSharpCode.PackageManagement.EnvDTE @@ -78,7 +90,7 @@ namespace ICSharpCode.PackageManagement.EnvDTE
return (CopyToOutputDirectory)Enum.Parse(typeof(CopyToOutputDirectory), valueAsString);
}
internal bool IsMatchByName(string name)
internal virtual bool IsMatchByName(string name)
{
return String.Equals(this.Name, name, StringComparison.InvariantCultureIgnoreCase);
}
@ -89,7 +101,7 @@ namespace ICSharpCode.PackageManagement.EnvDTE @@ -89,7 +101,7 @@ namespace ICSharpCode.PackageManagement.EnvDTE
return IsMatchByName(directory);
}
internal ProjectItemRelationship GetRelationship(SD.ProjectItem msbuildProjectItem)
internal virtual ProjectItemRelationship GetRelationship(SD.ProjectItem msbuildProjectItem)
{
return new ProjectItemRelationship(this, msbuildProjectItem);
}

49
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/ProjectItems.cs

@ -8,7 +8,7 @@ using System.IO; @@ -8,7 +8,7 @@ using System.IO;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public class ProjectItems : MarshalByRefObject, IEnumerable<ProjectItem>
public class ProjectItems : MarshalByRefObject, IEnumerable
{
Project project;
IPackageManagementFileService fileService;
@ -19,7 +19,15 @@ namespace ICSharpCode.PackageManagement.EnvDTE @@ -19,7 +19,15 @@ namespace ICSharpCode.PackageManagement.EnvDTE
this.fileService = fileService;
}
public void AddFromFileCopy(string filePath)
public ProjectItems()
{
}
public virtual object Parent {
get { throw new NotImplementedException(); }
}
public virtual void AddFromFileCopy(string filePath)
{
string include = Path.GetFileName(filePath);
CopyFileIntoProject(filePath, include);
@ -46,18 +54,13 @@ namespace ICSharpCode.PackageManagement.EnvDTE @@ -46,18 +54,13 @@ namespace ICSharpCode.PackageManagement.EnvDTE
return Path.Combine(project.MSBuildProject.Directory, fileName);
}
public virtual IEnumerator<ProjectItem> GetEnumerator()
public virtual IEnumerator GetEnumerator()
{
var items = new ProjectItemsInsideProject(project);
return items.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
public ProjectItem Item(string name)
internal virtual ProjectItem Item(string name)
{
foreach (ProjectItem item in this) {
if (item.IsMatchByName(name)) {
@ -66,5 +69,33 @@ namespace ICSharpCode.PackageManagement.EnvDTE @@ -66,5 +69,33 @@ namespace ICSharpCode.PackageManagement.EnvDTE
}
return null;
}
internal virtual ProjectItem Item(int index)
{
throw new NotImplementedException();
}
public virtual ProjectItem Item(object index)
{
// if (index is int) {
// return Item((int)index);
// }
// return null;
return Item(index as string);
}
public virtual ProjectItem AddFromDirectory(string directory)
{
throw new NotImplementedException();
}
public virtual ProjectItem AddFromFile(string fileName)
{
throw new NotImplementedException();
}
public virtual int Count {
get { throw new NotImplementedException(); }
}
}
}

26
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/Projects.cs

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections;
using System.Collections.Generic;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public class Projects : MarshalByRefObject, IEnumerable<Project>
{
public Projects()
{
}
public IEnumerator<Project> GetEnumerator()
{
throw new NotImplementedException();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
}

13
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/Properties.cs

@ -8,7 +8,7 @@ using ICSharpCode.SharpDevelop.Project; @@ -8,7 +8,7 @@ using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public class Properties : MarshalByRefObject, IEnumerable<Property>
public class Properties : MarshalByRefObject, IEnumerable
{
IPropertyFactory propertyFactory;
@ -17,19 +17,18 @@ namespace ICSharpCode.PackageManagement.EnvDTE @@ -17,19 +17,18 @@ namespace ICSharpCode.PackageManagement.EnvDTE
this.propertyFactory = propertyFactory;
}
public Property Item(string propertyName)
public Properties()
{
return propertyFactory.CreateProperty(propertyName);
}
public IEnumerator<Property> GetEnumerator()
public virtual Property Item(string propertyName)
{
return propertyFactory.GetEnumerator();
return propertyFactory.CreateProperty(propertyName);
}
IEnumerator IEnumerable.GetEnumerator()
public virtual IEnumerator GetEnumerator()
{
return GetEnumerator();
return propertyFactory.GetEnumerator();
}
}
}

10
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/Property.cs

@ -13,9 +13,13 @@ namespace ICSharpCode.PackageManagement.EnvDTE @@ -13,9 +13,13 @@ namespace ICSharpCode.PackageManagement.EnvDTE
this.Name = name;
}
public string Name { get; private set; }
public Property()
{
}
public virtual string Name { get; private set; }
public object Value {
public virtual object Value {
get { return GetValue(); }
set { SetValue(value); }
}
@ -29,7 +33,7 @@ namespace ICSharpCode.PackageManagement.EnvDTE @@ -29,7 +33,7 @@ namespace ICSharpCode.PackageManagement.EnvDTE
{
}
public object Object {
public virtual object Object {
get { return GetObject(); }
set { }
}

8
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/Solution.cs

@ -22,5 +22,13 @@ namespace ICSharpCode.PackageManagement.EnvDTE @@ -22,5 +22,13 @@ namespace ICSharpCode.PackageManagement.EnvDTE
public string FileName {
get { return solution.FileName; }
}
public bool IsOpen {
get { throw new NotImplementedException(); }
}
public Projects Projects {
get { throw new NotImplementedException(); }
}
}
}

29
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/SourceControl.cs

@ -0,0 +1,29 @@ @@ -0,0 +1,29 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public class SourceControl : MarshalByRefObject
{
public SourceControl()
{
}
public bool IsItemCheckedOut(string itemName)
{
throw new NotImplementedException();
}
public bool IsItemUnderSCC(string itemName)
{
throw new NotImplementedException();
}
public bool CheckOutItem(string itemName)
{
throw new NotImplementedException();
}
}
}

21
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/TextPoint.cs

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public class TextPoint : MarshalByRefObject
{
public TextPoint()
{
}
public int LineCharOffset { get; private set; }
public EditPoint CreateEditPoint()
{
throw new NotImplementedException();
}
}
}

12
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/vsCMAccess.cs

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public enum vsCMAccess
{
vsCMAccessPublic = 1
}
}

12
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/vsCMFunction.cs

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public enum vsCMFunction
{
vsCMFunctionFunction = 128
}
}

12
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/vsCMInfoLocation.cs

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public enum vsCMInfoLocation
{
vsCMInfoLocationProject = 1
}
}

13
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/vsCMPropertyKind.cs

@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public enum vsCMPropertyKind
{
vsCMPropertyKindReadOnly = 1,
vsCMPropertyKindWriteOnly = 2
}
}

15
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/vsEPReplaceTextOptions.cs

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.PackageManagement.EnvDTE
{
public enum vsEPReplaceTextOptions
{
vsEPReplaceTextKeepMarkers = 1,
vsEPReplaceTextNormalizeNewlines = 2,
vsEPReplaceTextTabsSpaces = 4,
vsEPReplaceTextAutoformat = 8
}
}

20
src/AddIns/Misc/PackageManagement/Project/Src/VisualStudio/FlavoredProject.cs

@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using Microsoft.VisualStudio.Shell.Interop;
namespace Microsoft.VisualStudio.Shell.Flavor
{
public class FlavoredProject : MarshalByRefObject, IVsAggregatableProject, IVsHierarchy
{
public FlavoredProject()
{
}
public int GetAggregateProjectTypeGuids(out string projTypeGuids)
{
throw new NotImplementedException();
}
}
}

12
src/AddIns/Misc/PackageManagement/Project/Src/VisualStudio/IVsAggregatableProject.cs

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace Microsoft.VisualStudio.Shell.Interop
{
public interface IVsAggregatableProject
{
int GetAggregateProjectTypeGuids(out string projTypeGuids);
}
}

12
src/AddIns/Misc/PackageManagement/Project/Src/VisualStudio/IVsHierarchy.cs

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace Microsoft.VisualStudio.Shell.Interop
{
public interface IVsHierarchy
{
}
}

12
src/AddIns/Misc/PackageManagement/Project/Src/VisualStudio/IVsSolution.cs

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace Microsoft.VisualStudio.Shell.Interop
{
public interface IVsSolution
{
int GetProjectOfUniqueName(string uniqueName, out IVsHierarchy hierarchy);
}
}

4
src/AddIns/Misc/PackageManagement/Project/Src/VisualStudio/Package.cs

@ -10,6 +10,10 @@ namespace Microsoft.VisualStudio.Shell @@ -10,6 +10,10 @@ namespace Microsoft.VisualStudio.Shell
{
public static object GetGlobalService(Type serviceType)
{
//typeof(DTE)
//typeof(IVsSolution)
//typeof(SComponentModel) --> not used - console initializer.
//typeof(SVsExtensionManager)
return new SVsExtensionManager();
}
}

25
src/AddIns/Misc/PackageManagement/Project/Src/VisualStudio/ThreadHelper.cs

@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace Microsoft.VisualStudio.Shell
{
public class ThreadHelper : MarshalByRefObject
{
static readonly ThreadHelper threadHelper = new ThreadHelper();
ThreadHelper()
{
}
public static ThreadHelper Generic {
get { return threadHelper; }
}
public T Invoke<T>(Func<T> method)
{
return method();
}
}
}

1
src/AddIns/Misc/PackageManagement/Test/PackageManagement.Tests.csproj

@ -73,6 +73,7 @@ @@ -73,6 +73,7 @@
<Compile Include="Src\Helpers\FakeSolutionPackageRepositoryFactory.cs" />
<Compile Include="Src\Helpers\FakeUpdatePackageActions.cs" />
<Compile Include="Src\Helpers\FakeUpdatePackageActionsFactory.cs" />
<Compile Include="Src\Helpers\PropertiesHelper.cs" />
<Compile Include="Src\Helpers\SelectedProjectCollectionAssert.cs" />
<Compile Include="Src\Helpers\TestableInstalledPackageViewModel.cs" />
<Compile Include="Src\Helpers\TestablePackageFromRepository.cs" />

25
src/AddIns/Misc/PackageManagement/Test/Src/EnvDTE/ProjectItemPropertyTests.cs

@ -119,20 +119,7 @@ namespace PackageManagement.Tests.EnvDTE @@ -119,20 +119,7 @@ namespace PackageManagement.Tests.EnvDTE
{
CreateProjectItemProperties();
var projectItemProperties = new List<Property>(properties);
var property = projectItemProperties.Find(p => p.Name == "CopyToOutputDirectory");
Assert.AreEqual("CopyToOutputDirectory", property.Name);
}
[Test]
public void GetEnumerator_FindCopyToOutputDirectoryPropertyFromUntypedEnumerator_ReturnsPropertyWithCopyToOutputDirectoryName()
{
CreateProjectItemProperties();
var projectItemProperties = properties as IEnumerable;
AssertContainsProperty("CopyToOutputDirectory", projectItemProperties);
AssertContainsProperty("CopyToOutputDirectory", properties);
}
[Test]
@ -140,10 +127,7 @@ namespace PackageManagement.Tests.EnvDTE @@ -140,10 +127,7 @@ namespace PackageManagement.Tests.EnvDTE
{
CreateProjectItemProperties();
var projectItemProperties = new List<Property>(properties);
var property = projectItemProperties.Find(p => p.Name == "CustomTool");
Assert.AreEqual("CustomTool", property.Name);
AssertContainsProperty("CustomTool", properties);
}
[Test]
@ -162,10 +146,7 @@ namespace PackageManagement.Tests.EnvDTE @@ -162,10 +146,7 @@ namespace PackageManagement.Tests.EnvDTE
{
CreateProjectItemProperties();
var projectItemProperties = new List<Property>(properties);
var property = projectItemProperties.Find(p => p.Name == "FullPath");
Assert.AreEqual("FullPath", property.Name);
AssertContainsProperty("FullPath", properties);
}
}
}

3
src/AddIns/Misc/PackageManagement/Test/Src/EnvDTE/ProjectItemTests.cs

@ -35,13 +35,12 @@ namespace PackageManagement.Tests.EnvDTE @@ -35,13 +35,12 @@ namespace PackageManagement.Tests.EnvDTE
var directoryItem = projectItems.Item("src");
var directoryProjectItems = directoryItem.ProjectItems;
var files = new List<DTE.ProjectItem>(directoryProjectItems);
string[] expectedFiles = new string[] {
"program.cs"
};
ProjectItemCollectionAssert.AreEqual(expectedFiles, files);
ProjectItemCollectionAssert.AreEqual(expectedFiles, directoryProjectItems);
}
[Test]

11
src/AddIns/Misc/PackageManagement/Test/Src/EnvDTE/ProjectItemsTests.cs

@ -116,29 +116,24 @@ namespace PackageManagement.Tests.EnvDTE @@ -116,29 +116,24 @@ namespace PackageManagement.Tests.EnvDTE
CreateProjectItems();
msbuildProject.AddFile(@"Test.cs");
var itemsList = new List<DTE.ProjectItem>();
itemsList.AddRange(projectItems);
var expectedItems = new string[] {
"Test.cs"
};
ProjectItemCollectionAssert.AreEqual(expectedItems, itemsList);
ProjectItemCollectionAssert.AreEqual(expectedItems, projectItems);
}
[Test]
public void GetEnumerator_UseUntypedEnumeratorProjectHasOneFile_OneFileReturned()
public void GetEnumerator_ProjectHasOneFile_OneFileReturned()
{
CreateProjectItems();
msbuildProject.AddFile(@"Program.cs");
var enumerable = projectItems as IEnumerable;
var expectedFiles = new string[] {
"Program.cs"
};
ProjectItemCollectionAssert.AreEqual(expectedFiles, enumerable);
ProjectItemCollectionAssert.AreEqual(expectedFiles, projectItems);
}
[Test]

2
src/AddIns/Misc/PackageManagement/Test/Src/EnvDTE/ProjectPropertyTests.cs

@ -121,7 +121,7 @@ namespace PackageManagement.Tests.EnvDTE @@ -121,7 +121,7 @@ namespace PackageManagement.Tests.EnvDTE
CreateProperties();
msbuildProject.SetProperty("TargetFrameworkVersion", "4.0");
Property targetFrameworkVersionProperty = project.Properties.First(p => p.Name == "TargetFrameworkVersion");
Property targetFrameworkVersionProperty = PropertiesHelper.FindProperty(project.Properties, "TargetFrameworkVersion");
string targetFrameworkVersion = targetFrameworkVersionProperty.Value as string;
Assert.AreEqual("4.0", targetFrameworkVersion);

3
src/AddIns/Misc/PackageManagement/Test/Src/EnvDTE/ReferencesTests.cs

@ -26,7 +26,8 @@ namespace PackageManagement.Tests.EnvDTE @@ -26,7 +26,8 @@ namespace PackageManagement.Tests.EnvDTE
project = new TestableDTEProject();
msbuildProject = project.TestableProject;
fakeProjectService = project.FakeProjectService;
references = project.Object.References;
ProjectObject projectObject = (ProjectObject)project.Object;
references = projectObject.References;
}
void ReferenceCollectionAssertAreEqual(string[] expectedReferences, List<Reference> referenceList)

4
src/AddIns/Misc/PackageManagement/Test/Src/EnvDTE/TextEditorFontsAndColorsPropertyFactoryTests.cs

@ -6,6 +6,7 @@ using System.Collections.Generic; @@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Linq;
using ICSharpCode.PackageManagement.EnvDTE;
using NUnit.Framework;
using PackageManagement.Tests.Helpers;
namespace PackageManagement.Tests.EnvDTE
{
@ -23,8 +24,7 @@ namespace PackageManagement.Tests.EnvDTE @@ -23,8 +24,7 @@ namespace PackageManagement.Tests.EnvDTE
void AssertPropertiesContainProperty(string expectedPropertyName)
{
var propertiesList = new List<Property>(properties);
Property property = propertiesList.Find(p => p.Name == expectedPropertyName);
Property property = PropertiesHelper.FindProperty(properties, expectedPropertyName);
Assert.IsNotNull(property, "Unable to find property: " + expectedPropertyName);
}

27
src/AddIns/Misc/PackageManagement/Test/Src/Helpers/PropertiesHelper.cs

@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using ICSharpCode.PackageManagement;
using ICSharpCode.PackageManagement.EnvDTE;
namespace PackageManagement.Tests.Helpers
{
public static class PropertiesHelper
{
public static Property FindProperty(Properties properties, string name)
{
return ToList(properties).Find(p => p.Name == name);
}
public static List<Property> ToList(Properties properties)
{
var itemsList = new List<Property>();
foreach (Property property in properties) {
itemsList.Add(property);
}
return itemsList;
}
}
}
Loading…
Cancel
Save