Skip to content

Commit c1f9da1

Browse files
committed
Submitting the code for initial release
1 parent 88a8c4d commit c1f9da1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+8090
-0
lines changed

AssemblyHost.sln

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 11.00
3+
# Visual Studio 2010
4+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0693B51D-3614-4934-A054-9F43CA03BC2B}"
5+
ProjectSection(SolutionItems) = preProject
6+
AssemblyHost.testsettings = AssemblyHost.testsettings
7+
AssemblyHost.vsmdi = AssemblyHost.vsmdi
8+
CustomDictionary.xml = CustomDictionary.xml
9+
EndProjectSection
10+
EndProject
11+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssemblyHost", "AssemblyHost\AssemblyHost.csproj", "{A644580E-CB70-44E1-A5A5-8FF6FCDFB07F}"
12+
EndProject
13+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssemblyHostTest", "AssemblyHostTest\AssemblyHostTest.csproj", "{BEB6030C-82E8-4675-819B-748ECE77DEFF}"
14+
EndProject
15+
Global
16+
GlobalSection(TestCaseManagementSettings) = postSolution
17+
CategoryFile = AssemblyHost.vsmdi
18+
EndGlobalSection
19+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
20+
Analysis|Any CPU = Analysis|Any CPU
21+
Analysis|Mixed Platforms = Analysis|Mixed Platforms
22+
Analysis|x86 = Analysis|x86
23+
Debug|Any CPU = Debug|Any CPU
24+
Debug|Mixed Platforms = Debug|Mixed Platforms
25+
Debug|x86 = Debug|x86
26+
Release|Any CPU = Release|Any CPU
27+
Release|Mixed Platforms = Release|Mixed Platforms
28+
Release|x86 = Release|x86
29+
Test|Any CPU = Test|Any CPU
30+
Test|Mixed Platforms = Test|Mixed Platforms
31+
Test|x86 = Test|x86
32+
EndGlobalSection
33+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
34+
{A644580E-CB70-44E1-A5A5-8FF6FCDFB07F}.Analysis|Any CPU.ActiveCfg = Analysis|Any CPU
35+
{A644580E-CB70-44E1-A5A5-8FF6FCDFB07F}.Analysis|Any CPU.Build.0 = Analysis|Any CPU
36+
{A644580E-CB70-44E1-A5A5-8FF6FCDFB07F}.Analysis|Mixed Platforms.ActiveCfg = Analysis|Any CPU
37+
{A644580E-CB70-44E1-A5A5-8FF6FCDFB07F}.Analysis|Mixed Platforms.Build.0 = Analysis|Any CPU
38+
{A644580E-CB70-44E1-A5A5-8FF6FCDFB07F}.Analysis|x86.ActiveCfg = Analysis|Any CPU
39+
{A644580E-CB70-44E1-A5A5-8FF6FCDFB07F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
40+
{A644580E-CB70-44E1-A5A5-8FF6FCDFB07F}.Debug|Any CPU.Build.0 = Debug|Any CPU
41+
{A644580E-CB70-44E1-A5A5-8FF6FCDFB07F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
42+
{A644580E-CB70-44E1-A5A5-8FF6FCDFB07F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
43+
{A644580E-CB70-44E1-A5A5-8FF6FCDFB07F}.Debug|x86.ActiveCfg = Debug|Any CPU
44+
{A644580E-CB70-44E1-A5A5-8FF6FCDFB07F}.Release|Any CPU.ActiveCfg = Release|Any CPU
45+
{A644580E-CB70-44E1-A5A5-8FF6FCDFB07F}.Release|Any CPU.Build.0 = Release|Any CPU
46+
{A644580E-CB70-44E1-A5A5-8FF6FCDFB07F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
47+
{A644580E-CB70-44E1-A5A5-8FF6FCDFB07F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
48+
{A644580E-CB70-44E1-A5A5-8FF6FCDFB07F}.Release|x86.ActiveCfg = Release|Any CPU
49+
{A644580E-CB70-44E1-A5A5-8FF6FCDFB07F}.Test|Any CPU.ActiveCfg = Test|Any CPU
50+
{A644580E-CB70-44E1-A5A5-8FF6FCDFB07F}.Test|Any CPU.Build.0 = Test|Any CPU
51+
{A644580E-CB70-44E1-A5A5-8FF6FCDFB07F}.Test|Mixed Platforms.ActiveCfg = Test|Any CPU
52+
{A644580E-CB70-44E1-A5A5-8FF6FCDFB07F}.Test|Mixed Platforms.Build.0 = Test|Any CPU
53+
{A644580E-CB70-44E1-A5A5-8FF6FCDFB07F}.Test|x86.ActiveCfg = Test|Any CPU
54+
{BEB6030C-82E8-4675-819B-748ECE77DEFF}.Analysis|Any CPU.ActiveCfg = Release|Any CPU
55+
{BEB6030C-82E8-4675-819B-748ECE77DEFF}.Analysis|Mixed Platforms.ActiveCfg = Release|Any CPU
56+
{BEB6030C-82E8-4675-819B-748ECE77DEFF}.Analysis|x86.ActiveCfg = Release|Any CPU
57+
{BEB6030C-82E8-4675-819B-748ECE77DEFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
58+
{BEB6030C-82E8-4675-819B-748ECE77DEFF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
59+
{BEB6030C-82E8-4675-819B-748ECE77DEFF}.Debug|x86.ActiveCfg = Debug|Any CPU
60+
{BEB6030C-82E8-4675-819B-748ECE77DEFF}.Release|Any CPU.ActiveCfg = Release|Any CPU
61+
{BEB6030C-82E8-4675-819B-748ECE77DEFF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
62+
{BEB6030C-82E8-4675-819B-748ECE77DEFF}.Release|x86.ActiveCfg = Release|Any CPU
63+
{BEB6030C-82E8-4675-819B-748ECE77DEFF}.Test|Any CPU.ActiveCfg = Release|Any CPU
64+
{BEB6030C-82E8-4675-819B-748ECE77DEFF}.Test|Any CPU.Build.0 = Release|Any CPU
65+
{BEB6030C-82E8-4675-819B-748ECE77DEFF}.Test|Mixed Platforms.ActiveCfg = Release|Any CPU
66+
{BEB6030C-82E8-4675-819B-748ECE77DEFF}.Test|Mixed Platforms.Build.0 = Release|Any CPU
67+
{BEB6030C-82E8-4675-819B-748ECE77DEFF}.Test|x86.ActiveCfg = Release|Any CPU
68+
EndGlobalSection
69+
GlobalSection(SolutionProperties) = preSolution
70+
HideSolutionNode = FALSE
71+
EndGlobalSection
72+
EndGlobal

AssemblyHost.testsettings

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<TestSettings name="AssemblyHost" id="ac1420bf-88cb-43b1-a837-8fe6a0dfb18b" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
3+
<Description>Code coverage for AssemblyHost.</Description>
4+
<Execution>
5+
<TestTypeSpecific>
6+
<UnitTestRunConfig testTypeId="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b">
7+
<AssemblyResolution>
8+
<TestDirectory useLoadContext="true" />
9+
</AssemblyResolution>
10+
</UnitTestRunConfig>
11+
<WebTestRunConfiguration testTypeId="4e7599fa-5ecb-43e9-a887-cd63cf72d207">
12+
<Browser name="Internet Explorer 7.0">
13+
<Headers>
14+
<Header name="User-Agent" value="Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)" />
15+
<Header name="Accept" value="*/*" />
16+
<Header name="Accept-Language" value="{{$IEAcceptLanguage}}" />
17+
<Header name="Accept-Encoding" value="GZIP" />
18+
</Headers>
19+
</Browser>
20+
</WebTestRunConfiguration>
21+
</TestTypeSpecific>
22+
<AgentRule name="LocalMachineDefaultRole">
23+
<DataCollectors>
24+
<DataCollector uri="datacollector://microsoft/CodeCoverage/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TestTools.CodeCoverage.CoveragePlugIn, Microsoft.VisualStudio.QualityTools.Plugins.CodeCoverage, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="Code Coverage">
25+
<Configuration>
26+
<CodeCoverage xmlns="">
27+
<Regular>
28+
<CodeCoverageItem binaryFile="AssemblyHost\bin\Test\AssemblyHost.exe" pdbFile="AssemblyHost\bin\Test\AssemblyHost.pdb" instrumentInPlace="true" />
29+
</Regular>
30+
</CodeCoverage>
31+
</Configuration>
32+
</DataCollector>
33+
</DataCollectors>
34+
</AgentRule>
35+
</Execution>
36+
</TestSettings>

AssemblyHost.vsmdi

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<TestLists xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
3+
<TestList name="Lists of Tests" id="8c43106b-9dc1-4907-a29f-aa66a61bf5b6">
4+
<RunConfiguration id="ac1420bf-88cb-43b1-a837-8fe6a0dfb18b" name="AssemblyHost" storage="assemblyhost.testsettings" type="Microsoft.VisualStudio.TestTools.Common.TestRunConfiguration, Microsoft.VisualStudio.QualityTools.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
5+
</TestList>
6+
</TestLists>

AssemblyHost/AssemblyArgument.cs

+127
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
// This file is part of AssemblyHost.
2+
// Copyright © 2014 Paul Spangler
3+
//
4+
// AssemblyHost is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU Lesser General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// AssemblyHost is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU Lesser General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU Lesser General Public License
15+
// along with AssemblyHost. If not, see <http://www.gnu.org/licenses/>.
16+
17+
using System;
18+
using System.IO;
19+
using System.Collections.Generic;
20+
21+
namespace SpanglerCo.AssemblyHost
22+
{
23+
/// <summary>
24+
/// Represents an argument for passing an assembly between processes.
25+
/// </summary>
26+
27+
public sealed class AssemblyArgument
28+
{
29+
/// <summary>
30+
/// Gets the name of the assembly.
31+
/// </summary>
32+
33+
public string Name { get; private set; }
34+
35+
/// <summary>
36+
/// Gets the location of the assembly.
37+
/// </summary>
38+
39+
public string Location { get; private set; }
40+
41+
/// <summary>
42+
/// Creates a new assembly argument.
43+
/// </summary>
44+
/// <param name="assemblyLocation">The path to the assembly.</param>
45+
/// <param name="assemblyName">The name of the assembly.</param>
46+
/// <exception cref="ArgumentNullException">if assemblyLocation or assemblyName is null.</exception>
47+
/// <exception cref="ArgumentException">if assemblyLocation or assemblyName is empty.</exception>
48+
49+
public AssemblyArgument(string assemblyLocation, string assemblyName)
50+
{
51+
if (assemblyLocation == null)
52+
{
53+
throw new ArgumentNullException("assemblyLocation");
54+
}
55+
56+
if (assemblyLocation.Length == 0)
57+
{
58+
throw new ArgumentException("assemblyLocation cannot be empty.", "assemblyLocation");
59+
}
60+
61+
if (assemblyName == null)
62+
{
63+
throw new ArgumentNullException("assemblyName");
64+
}
65+
66+
if (assemblyName.Length == 0)
67+
{
68+
throw new ArgumentException("assemblyName cannot be empty.", "assemblyName");
69+
}
70+
71+
Name = assemblyName;
72+
Location = assemblyLocation;
73+
}
74+
75+
/// <summary>
76+
/// Creates a new assembly argument for a type.
77+
/// </summary>
78+
/// <param name="type">The type whose assembly will be used.</param>
79+
/// <exception cref="ArgumentNullException">if type is null.</exception>
80+
81+
internal AssemblyArgument(Type type)
82+
{
83+
if (type == null)
84+
{
85+
throw new ArgumentNullException("type");
86+
}
87+
88+
Name = type.Assembly.FullName;
89+
Location = Path.GetDirectoryName(type.Assembly.Location);
90+
}
91+
92+
/// <summary>
93+
/// Restores an assembly argument.
94+
/// </summary>
95+
/// <param name="args">The current arguments.</param>
96+
97+
internal AssemblyArgument(Queue<string> args)
98+
{
99+
if (args == null)
100+
{
101+
throw new ArgumentNullException("args");
102+
}
103+
104+
if (args.Count == 0)
105+
{
106+
throw new ArgumentException("Not enough arguments.", "args");
107+
}
108+
109+
Name = args.Dequeue();
110+
}
111+
112+
/// <summary>
113+
/// Adds the type to a list of arguments.
114+
/// </summary>
115+
/// <param name="args">The current arguments.</param>
116+
117+
internal void AddArgs(IList<string> args)
118+
{
119+
if (args == null)
120+
{
121+
throw new ArgumentNullException("args");
122+
}
123+
124+
args.Add(Name);
125+
}
126+
}
127+
}

0 commit comments

Comments
 (0)