Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
TemplateGeneratorContext.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 
5 namespace SiliconStudio.Assets.Templates
6 {
7  /// <summary>
8  /// Context that will be used to run the tempplate generator.
9  /// </summary>
10  public sealed class TemplateGeneratorContext
11  {
12  /// <summary>
13  /// Initializes a new instance of the <see cref="TemplateGeneratorContext"/> class.
14  /// </summary>
15  /// <param name="session">The session.</param>
17  {
18  if (session == null) throw new ArgumentNullException("session");
19  Session = session;
20  }
21 
22  /// <summary>
23  /// Initializes a new instance of the <see cref="TemplateGeneratorContext"/> class.
24  /// </summary>
25  /// <param name="package">The package.</param>
27  {
28  if (package == null) throw new ArgumentNullException("package");
29  if (package.Session == null) throw new ArgumentException("Package must be added to an existing PackageSession", "package");
30  Package = package;
31  Session = package.Session;
32  }
33 
34  /// <summary>
35  /// Gets or sets the current session.
36  /// </summary>
37  /// <value>The session.</value>
38  public PackageSession Session { get; private set; }
39 
40  /// <summary>
41  /// Gets or sets the current package (may be null)
42  /// </summary>
43  /// <value>The package.</value>
44  public Package Package { get; private set; }
45  }
46 }
Context that will be used to run the tempplate generator.
A session for editing a package.
PackageSession Session
Gets the session.
Definition: Package.cs:219
TemplateGeneratorContext(Package package)
Initializes a new instance of the TemplateGeneratorContext class.
The template can be applied to an existing PackageSession.
A package managing assets.
Definition: Package.cs:28
TemplateGeneratorContext(PackageSession session)
Initializes a new instance of the TemplateGeneratorContext class.