Skip to content

Commit

Permalink
Added ATF to GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
Ron2 committed Mar 10, 2014
1 parent 2379c22 commit f9559b7
Show file tree
Hide file tree
Showing 2,322 changed files with 461,563 additions and 19 deletions.
94 changes: 94 additions & 0 deletions DevTools/CustomToolDomGen/CustomToolDomGen.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using Microsoft.CustomTool;
using Microsoft.Win32;

namespace DomGen
{
[Guid("9F877959-E457-4824-B58F-110FF320F0D1")]
[ComVisible(true)]
public class CustomToolDomGen : BaseCodeGeneratorWithSite
{
// Called every time the attached XML file is saved within visual studio.
protected override byte[] GenerateCode(string inputFileName, string inputFileContent)
{
// class name should always the same as output file name
string className = Path.GetFileNameWithoutExtension(inputFileName);

SchemaLoader typeLoader = new SchemaLoader();
typeLoader.Load(inputFileName);

string[] fakeArgs = {"CustomToolDomGen", inputFileName, Path.GetFileNameWithoutExtension(inputFileName) + ".cs", className, FileNameSpace};

return System.Text.Encoding.ASCII.GetBytes(SchemaGen.Generate(typeLoader, "", FileNameSpace, className, fakeArgs));
}

#region Registration

private const string CustomToolName = "DomSchemaGen";
private const string CustomToolDescription = "DOM Schema Class Generator";
private static Guid CustomToolGuid = new Guid("{9F877959-E457-4824-B58F-110FF320F0D1}"); // generated, but must match the class attribute

// Registry Categories to tell Visual Studio where to find the tool
private static Guid CSharpCategory = new Guid("{FAE04EC1-301F-11D3-BF4B-00C04F79EFBC}");
private static Guid VBCategory = new Guid("{164B10B9-B200-11D0-8C61-00A0C91E29D5}");

private const string KeyFormat = @"SOFTWARE\Microsoft\VisualStudio\{0}\Generators\{1}\{2}";

protected static void Register(Version vsVersion, Guid categoryGuid)
{
using (RegistryKey key = Registry.LocalMachine.CreateSubKey(
String.Format(KeyFormat, vsVersion, categoryGuid.ToString("B"), CustomToolName)))
{
key.SetValue("", CustomToolDescription);
key.SetValue("CLSID", CustomToolGuid.ToString("B"));
key.SetValue("GeneratesDesignTimeSource", 1);
}
}

protected static void Unregister(Version vsVersion, Guid categoryGuid)
{
Registry.LocalMachine.DeleteSubKey(
String.Format(KeyFormat, vsVersion, categoryGuid.ToString("B"), CustomToolName), false);
}

[ComRegisterFunction]
public static void RegisterClass(Type t)
{
// Register for VS.NET 2002, 2003, 2005, 2008, 2010 (C#)
Register(new Version(7, 0), CSharpCategory);
Register(new Version(7, 1), CSharpCategory);
Register(new Version(8, 0), CSharpCategory);
Register(new Version(9, 0), CSharpCategory);
Register(new Version(10, 0), CSharpCategory);

// Register for VS.NET 2002, 2003, 2005, 2008, 2010 (VB)
Register(new Version(7, 0), VBCategory);
Register(new Version(7, 1), VBCategory);
Register(new Version(8, 0), VBCategory);
Register(new Version(9, 0), VBCategory);
Register(new Version(10, 0), VBCategory);
}

[ComUnregisterFunction]
public static void UnregisterClass(Type t)
{
// Unregister for VS.NET 2002, 2003, 2005, 2008, 2010 (C#)
Unregister(new Version(7, 0), CSharpCategory);
Unregister(new Version(7, 1), CSharpCategory);
Unregister(new Version(8, 0), CSharpCategory);
Unregister(new Version(9, 0), CSharpCategory);
Unregister(new Version(10, 0), CSharpCategory);

// Unregister for VS.NET 2002, 2003, 2005, 2008, 2010 (VB)
Unregister(new Version(7, 0), VBCategory);
Unregister(new Version(7, 1), VBCategory);
Unregister(new Version(8, 0), VBCategory);
Unregister(new Version(9, 0), VBCategory);
Unregister(new Version(10, 0), VBCategory);
}

#endregion
}
}
102 changes: 102 additions & 0 deletions DevTools/CustomToolDomGen/CustomToolDomGen.vs2005.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{A3F98805-75BF-42A0-8799-76A749098D4A}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CustomToolDomGen</RootNamespace>
<AssemblyName>CustomToolDomGen</AssemblyName>
<SignAssembly>false</SignAssembly>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug.vs2005\</OutputPath>
<IntermediateOutputPath>obj\Debug.vs2005\</IntermediateOutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release.vs2005\</OutputPath>
<IntermediateOutputPath>obj\Release.vs2005\</IntermediateOutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.BaseCodeGeneratorWithSite, Version=1.1.0.0, Culture=neutral, PublicKeyToken=fd07cb18fc57563b">
<SpecificVersion>False</SpecificVersion>
<HintPath>.\Microsoft.VisualStudio.BaseCodeGeneratorWithSite.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="CustomToolDomGen.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Framework\Atf.Core\Atf.Core.vs2005.csproj">
<Project>{9D1835B6-D1C2-44BA-BAE1-05C6EC442D2F}</Project>
<Name>Atf.Core.vs2005</Name>
</ProjectReference>
<ProjectReference Include="..\DomGen\DomGen.vs2005.csproj">
<Project>{FE3CA2EA-2F56-49A5-AD02-E5DEC8694457}</Project>
<Name>DomGen.vs2005</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
<Visible>False</Visible>
<ProductName>.NET Framework 2.0</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
32 changes: 32 additions & 0 deletions DevTools/CustomToolDomGen/CustomToolDomGen.vs2005.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomToolDomGen.vs2005", "CustomToolDomGen.vs2005.csproj", "{A3F98805-75BF-42A0-8799-76A749098D4A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DomGen.vs2005", "..\DomGen\DomGen.vs2005.csproj", "{FE3CA2EA-2F56-49A5-AD02-E5DEC8694457}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Atf.Core.vs2005", "..\..\Framework\Atf.Core\Atf.Core.vs2005.csproj", "{9D1835B6-D1C2-44BA-BAE1-05C6EC442D2F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A3F98805-75BF-42A0-8799-76A749098D4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A3F98805-75BF-42A0-8799-76A749098D4A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A3F98805-75BF-42A0-8799-76A749098D4A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A3F98805-75BF-42A0-8799-76A749098D4A}.Release|Any CPU.Build.0 = Release|Any CPU
{FE3CA2EA-2F56-49A5-AD02-E5DEC8694457}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FE3CA2EA-2F56-49A5-AD02-E5DEC8694457}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FE3CA2EA-2F56-49A5-AD02-E5DEC8694457}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FE3CA2EA-2F56-49A5-AD02-E5DEC8694457}.Release|Any CPU.Build.0 = Release|Any CPU
{9D1835B6-D1C2-44BA-BAE1-05C6EC442D2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9D1835B6-D1C2-44BA-BAE1-05C6EC442D2F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9D1835B6-D1C2-44BA-BAE1-05C6EC442D2F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9D1835B6-D1C2-44BA-BAE1-05C6EC442D2F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
114 changes: 114 additions & 0 deletions DevTools/CustomToolDomGen/CustomToolDomGen.vs2010.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{A3F98805-75BF-42A0-8799-76A749098D4A}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CustomToolDomGen</RootNamespace>
<AssemblyName>CustomToolDomGen</AssemblyName>
<SignAssembly>false</SignAssembly>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>2.0</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\lib\anycpu_dotnet_clr4_debug\</OutputPath>
<IntermediateOutputPath>obj\Debug.vs2010\</IntermediateOutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\lib\anycpu_dotnet_clr4_release\</OutputPath>
<IntermediateOutputPath>obj\Release.vs2010\</IntermediateOutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.BaseCodeGeneratorWithSite, Version=1.1.0.0, Culture=neutral, PublicKeyToken=fd07cb18fc57563b">
<SpecificVersion>False</SpecificVersion>
<HintPath>.\Microsoft.VisualStudio.BaseCodeGeneratorWithSite.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="CustomToolDomGen.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Framework\Atf.Core\Atf.Core.vs2010.csproj">
<Project>{9D1835B6-D1C2-44BA-BAE1-05C6EC442D2F}</Project>
<Name>Atf.Core</Name>
</ProjectReference>
<ProjectReference Include="..\DomGen\DomGen.vs2010.csproj">
<Project>{FE3CA2EA-2F56-49A5-AD02-E5DEC8694457}</Project>
<Name>DomGen</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
<Visible>False</Visible>
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
<Visible>False</Visible>
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Binary file not shown.
32 changes: 32 additions & 0 deletions DevTools/CustomToolDomGen/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CustomToolDomGen")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("SCEA")]
[assembly: AssemblyProduct("CustomToolDomGen")]
[assembly: AssemblyCopyright("Copyright © 2014 Sony Computer Entertainment America LLC")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("63328306-66be-4736-a0a2-2aff306598a5")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
5 changes: 5 additions & 0 deletions DevTools/CustomToolDomGen/RegisterCOM.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
To register, use:
regasm /codebase CustomToolDomGen.dll

To unregister use:
regasm /codebase CustomToolDomGen.dll /u
Loading

0 comments on commit f9559b7

Please sign in to comment.