Skip to content

Commit

Permalink
#1
Browse files Browse the repository at this point in the history
  • Loading branch information
miyabis committed Jan 3, 2016
1 parent cc8002a commit 7a0c84e
Show file tree
Hide file tree
Showing 167 changed files with 13,709 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .nuget/NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
</configuration>
Binary file added .nuget/NuGet.exe
Binary file not shown.
153 changes: 153 additions & 0 deletions .nuget/NuGet.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>

<!-- Enable the restore command to run before builds -->
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>

<!-- Property that enables building a package from a project -->
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>

<!-- Determines if package restore consent is required to restore packages -->
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>

<!-- Download NuGet.exe if it does not already exist -->
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>
</PropertyGroup>

<ItemGroup Condition=" '$(PackageSources)' == '' ">
<!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used -->
<!-- The official NuGet package source (https://nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
<!--
<PackageSource Include="https://nuget.org/api/v2/" />
<PackageSource Include="https://my-nuget-source/nuget/" />
-->
</ItemGroup>

<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
<!-- Windows specific commands -->
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
<PackagesConfig>$([System.IO.Path]::Combine($(ProjectDir), "packages.config"))</PackagesConfig>
<PackagesDir>$([System.IO.Path]::Combine($(SolutionDir), "packages"))</PackagesDir>
</PropertyGroup>

<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
<PackagesConfig>packages.config</PackagesConfig>
<PackagesDir>$(SolutionDir)packages</PackagesDir>
</PropertyGroup>

<PropertyGroup>
<!-- NuGet command -->
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\nuget.exe</NuGetExePath>
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>

<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand>

<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>

<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
<!-- Commands -->
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(RequireConsentSwitch) -o "$(PackagesDir)"</RestoreCommand>
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols</BuildCommand>

<!-- We need to ensure packages are restored prior to assembly resolve -->
<ResolveReferencesDependsOn Condition="$(RestorePackages) == 'true'">
RestorePackages;
$(ResolveReferencesDependsOn);
</ResolveReferencesDependsOn>

<!-- Make the build depend on restore packages -->
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
$(BuildDependsOn);
BuildPackage;
</BuildDependsOn>
</PropertyGroup>

<Target Name="CheckPrerequisites">
<!-- Raise an error if we're unable to locate nuget.exe -->
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
<SetEnvironmentVariable EnvKey="VisualStudioVersion" EnvValue="$(VisualStudioVersion)" Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' " />
<!--
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
This effectively acts as a lock that makes sure that the download operation will only happen once and all
parallel builds will have to wait for it to complete.
-->
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT" />
</Target>

<Target Name="_DownloadNuGet">
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
</Target>

<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
<Exec Command="$(RestoreCommand)"
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />

<Exec Command="$(RestoreCommand)"
LogStandardErrorAsError="true"
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
</Target>

<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
<Exec Command="$(BuildCommand)"
Condition=" '$(OS)' != 'Windows_NT' " />

<Exec Command="$(BuildCommand)"
LogStandardErrorAsError="true"
Condition=" '$(OS)' == 'Windows_NT' " />
</Target>

<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<OutputFilename ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Reference Include="System.Core" />
<Using Namespace="System" />
<Using Namespace="System.IO" />
<Using Namespace="System.Net" />
<Using Namespace="Microsoft.Build.Framework" />
<Using Namespace="Microsoft.Build.Utilities" />
<Code Type="Fragment" Language="cs">
<![CDATA[
try {
OutputFilename = Path.GetFullPath(OutputFilename);
Log.LogMessage("Downloading latest version of NuGet.exe...");
WebClient webClient = new WebClient();
webClient.DownloadFile("https://nuget.org/nuget.exe", OutputFilename);
return true;
}
catch (Exception ex) {
Log.LogErrorFromException(ex);
return false;
}
]]>
</Code>
</Task>
</UsingTask>

<UsingTask TaskName="SetEnvironmentVariable" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<EnvKey ParameterType="System.String" Required="true" />
<EnvValue ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Using Namespace="System" />
<Code Type="Fragment" Language="cs">
<![CDATA[
try {
Environment.SetEnvironmentVariable(EnvKey, EnvValue, System.EnvironmentVariableTarget.Process);
}
catch {
}
]]>
</Code>
</Task>
</UsingTask>
</Project>
6 changes: 6 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
License
=======

Microsoft Public License (MS-PL)

http://opensource.org/licenses/MS-PL
82 changes: 82 additions & 0 deletions MocaWebForm.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{63A7DB55-8EFB-411B-9A5F-DE18D2AED3F7}"
ProjectSection(SolutionItems) = preProject
.nuget\NuGet.Config = .nuget\NuGet.Config
.nuget\NuGet.exe = .nuget\NuGet.exe
.nuget\NuGet.targets = .nuget\NuGet.targets
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{34AD0CF4-E492-46F7-9638-9D990C81A313}"
ProjectSection(SolutionItems) = preProject
LICENSE.md = LICENSE.md
README.md = README.md
EndProjectSection
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "MocaWebForm40", "MocaWebForm40\MocaWebForm40.vbproj", "{0A2E2E1A-0873-427C-A36B-718F45DE9C29}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NuGet.Packager", "NuGet.Packager\NuGet.Packager.csproj", "{0451BAEF-DF2E-4B98-8644-94EE9415E389}"
ProjectSection(ProjectDependencies) = postProject
{0A2E2E1A-0873-427C-A36B-718F45DE9C29} = {0A2E2E1A-0873-427C-A36B-718F45DE9C29}
{2EE4EF28-F721-4DDA-B5DC-D45682716550} = {2EE4EF28-F721-4DDA-B5DC-D45682716550}
{FE6CDCE3-9402-455A-93C0-1B02049A3670} = {FE6CDCE3-9402-455A-93C0-1B02049A3670}
{930A5BE6-4897-4E16-9422-D3DAED1D2AF5} = {930A5BE6-4897-4E16-9422-D3DAED1D2AF5}
{715B86ED-2700-49B4-B2CC-C92620180D82} = {715B86ED-2700-49B4-B2CC-C92620180D82}
EndProjectSection
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "MocaWebForm20", "MocaWebForm20\MocaWebForm20.vbproj", "{2EE4EF28-F721-4DDA-B5DC-D45682716550}"
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "MocaWebForm35", "MocaWebForm35\MocaWebForm35.vbproj", "{715B86ED-2700-49B4-B2CC-C92620180D82}"
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WebApp35", "WebApp35\WebApp35.vbproj", "{F7409AD6-38DF-4364-8197-CB0A5BBA0283}"
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WebApp40", "WebApp40\WebApp40.vbproj", "{F2590255-0ECF-4C57-BCD9-7F3D16AAD6BD}"
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "MocaWebForm45", "MocaWebForm45\MocaWebForm45.vbproj", "{930A5BE6-4897-4E16-9422-D3DAED1D2AF5}"
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "MocaWebForm46", "MocaWebForm46\MocaWebForm46.vbproj", "{FE6CDCE3-9402-455A-93C0-1B02049A3670}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0A2E2E1A-0873-427C-A36B-718F45DE9C29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0A2E2E1A-0873-427C-A36B-718F45DE9C29}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0A2E2E1A-0873-427C-A36B-718F45DE9C29}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0A2E2E1A-0873-427C-A36B-718F45DE9C29}.Release|Any CPU.Build.0 = Release|Any CPU
{0451BAEF-DF2E-4B98-8644-94EE9415E389}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0451BAEF-DF2E-4B98-8644-94EE9415E389}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0451BAEF-DF2E-4B98-8644-94EE9415E389}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0451BAEF-DF2E-4B98-8644-94EE9415E389}.Release|Any CPU.Build.0 = Release|Any CPU
{2EE4EF28-F721-4DDA-B5DC-D45682716550}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2EE4EF28-F721-4DDA-B5DC-D45682716550}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2EE4EF28-F721-4DDA-B5DC-D45682716550}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2EE4EF28-F721-4DDA-B5DC-D45682716550}.Release|Any CPU.Build.0 = Release|Any CPU
{715B86ED-2700-49B4-B2CC-C92620180D82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{715B86ED-2700-49B4-B2CC-C92620180D82}.Debug|Any CPU.Build.0 = Debug|Any CPU
{715B86ED-2700-49B4-B2CC-C92620180D82}.Release|Any CPU.ActiveCfg = Release|Any CPU
{715B86ED-2700-49B4-B2CC-C92620180D82}.Release|Any CPU.Build.0 = Release|Any CPU
{F7409AD6-38DF-4364-8197-CB0A5BBA0283}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F7409AD6-38DF-4364-8197-CB0A5BBA0283}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F7409AD6-38DF-4364-8197-CB0A5BBA0283}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F2590255-0ECF-4C57-BCD9-7F3D16AAD6BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F2590255-0ECF-4C57-BCD9-7F3D16AAD6BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F2590255-0ECF-4C57-BCD9-7F3D16AAD6BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{930A5BE6-4897-4E16-9422-D3DAED1D2AF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{930A5BE6-4897-4E16-9422-D3DAED1D2AF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{930A5BE6-4897-4E16-9422-D3DAED1D2AF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{930A5BE6-4897-4E16-9422-D3DAED1D2AF5}.Release|Any CPU.Build.0 = Release|Any CPU
{FE6CDCE3-9402-455A-93C0-1B02049A3670}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FE6CDCE3-9402-455A-93C0-1B02049A3670}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FE6CDCE3-9402-455A-93C0-1B02049A3670}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FE6CDCE3-9402-455A-93C0-1B02049A3670}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
80 changes: 80 additions & 0 deletions MocaWebForm20/Di/MocaPageInjector.vb
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@

Imports Moca.Attr
Imports Moca.Di
Imports Moca.Util
Imports Moca.Web.Attr

Namespace Di

''' <summary>
''' ページに対しての依存性注入
''' </summary>
''' <remarks></remarks>
Public Class MocaPageInjector
Inherits MocaWebInjector

#Region " コンストラクタ "

''' <summary>
''' デフォルトコンストラクタ
''' </summary>
''' <remarks></remarks>
Public Sub New()
MyBase.New()

Me.Analyzer.Add(AttributeAnalyzerTargets.Field, New CookieAttributeAnalyzer)
Me.Analyzer.Add(AttributeAnalyzerTargets.Field, New SessionAttributeAnalyzer)
Me.Analyzer.Add(AttributeAnalyzerTargets.Field, New ServerVariablesAttributeAnalyzer)
Me.Analyzer.Add(AttributeAnalyzerTargets.Field, New QueryStringAttributeAnalyzer)
Me.Analyzer.Add(AttributeAnalyzerTargets.Field, New ViewStateAttributeAnalyzer)

Me.Analyzer.FieldInject = AddressOf Me.fieldInject
End Sub

#End Region

''' <summary>
''' フィールドへインスタンスの注入
''' </summary>
''' <param name="target">対象となるオブジェクト</param>
''' <param name="field">対象となるフィールド</param>
''' <param name="component">対象となるコンポーネント</param>
''' <returns>生成したインスタンス</returns>
''' <remarks>
''' MocaComponent4Http として扱いたいためオーバーライド
''' </remarks>
Protected Shadows Function fieldInject(ByVal target As Object, ByVal field As System.Reflection.FieldInfo, ByVal component As MocaComponent) As Object
Dim instance As Object
Dim componentHttp As MocaComponent4Http

componentHttp = TryCast(component, MocaComponent4Http)
If componentHttp Is Nothing Then
instance = component.Create()
ClassUtil.Inject(target, field, New Object() {instance})
Return instance
End If

Dim typ As Type

If TypeOf target Is System.Web.UI.Page Then
typ = GetType(Web.HttpContentsPage)
ElseIf TypeOf target Is System.Web.UI.MasterPage Then
typ = GetType(Web.HttpContentsMasterPage)
ElseIf TypeOf target Is System.Web.Services.WebService Then
typ = GetType(Web.HttpContentsWebService)
ElseIf TypeOf target Is System.Web.UI.UserControl Then
typ = GetType(Web.HttpContentsUserControl)
ElseIf TypeOf target Is System.Web.HttpApplication Then
typ = GetType(Web.HttpContentsApplication)
Else
typ = GetType(Web.HttpContents)
End If

instance = componentHttp.Create(target, typ)
ClassUtil.Inject(target, field, New Object() {instance})
Return instance
End Function

End Class

End Namespace
Binary file added MocaWebForm20/Key.snk
Binary file not shown.
Loading

0 comments on commit 7a0c84e

Please sign in to comment.