Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
ShaderKeyFileGenerator.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System;
4 using System.Diagnostics;
5 using System.Linq;
6 using System.Reflection;
7 using System.Runtime.InteropServices;
8 using System.Text;
9 using Microsoft.VisualStudio.Shell;
10 using SiliconStudio.Paradox.VisualStudio.CodeGenerator;
12 
13 namespace SiliconStudio.Paradox.VisualStudio.Shaders
14 {
15  [ComVisible(true)]
16  [ClassInterface(ClassInterfaceType.None)]
17  [Guid(GuidList.guidParadox_VisualStudio_ShaderKeyFileGenerator)]
18  [ProvideObject(typeof(ShaderKeyFileGenerator), RegisterUsing = RegistrationMethod.CodeBase)]
20  {
21  public const string DisplayName = "Paradox Shader C# Key Generator";
22  public const string InternalName = "ParadoxShaderKeyGenerator";
23 
24  protected override string GetDefaultExtension()
25  {
26  return ".cs";
27  }
28 
29  protected override byte[] GenerateCode(string inputFileName, string inputFileContent)
30  {
32  {
33  try
34  {
35  var remoteCommands = ParadoxCommandsProxy.CreateProxy(domain);
36  return remoteCommands.GenerateShaderKeys(inputFileName, inputFileContent);
37  }
38  catch (Exception ex)
39  {
40  GeneratorError(4, ex.ToString(), 0, 0);
41 
42  return new byte[0];
43  }
44  }
45  }
46  }
47 }
Proxies commands to real IParadoxCommands implementation.
override string GetDefaultExtension()
Gets the default extension of the output file from the CodeDomProvider
override byte[] GenerateCode(string inputFileName, string inputFileContent)
The method that does the actual work of generating code given the input file