Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
PackageLoadParameters.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.Collections.Generic;
4 using System.Threading;
5 using SiliconStudio.Core.IO;
6 using SiliconStudio.Core.Reflection;
7 
8 namespace SiliconStudio.Assets
9 {
10  /// <summary>
11  /// Parameters used for loading a package.
12  /// </summary>
13  public sealed class PackageLoadParameters
14  {
15  private static readonly PackageLoadParameters DefaultParameters = new PackageLoadParameters();
16 
17  /// <summary>
18  /// Gets the default parameters.
19  /// </summary>
20  /// <returns>PackageLoadParameters.</returns>
22  {
23  return DefaultParameters.Clone();
24  }
25 
27  {
28  LoadAssemblyReferences = true;
29  AutoCompileProjects = true;
30  AutoLoadTemporaryAssets = true;
31  ConvertUPathToAbsolute = true;
32  }
33 
34  /// <summary>
35  /// Gets or sets a value indicating whether [load assembly references].
36  /// </summary>
37  /// <value><c>true</c> if [load assembly references]; otherwise, <c>false</c>.</value>
38  public bool LoadAssemblyReferences { get; set; }
39 
40  /// <summary>
41  /// Gets or sets a value indicating whether to automatically compile projects that don't have their assembly generated.
42  /// </summary>
43  /// <value><c>true</c> if [automatic compile projects]; otherwise, <c>false</c>.</value>
44  public bool AutoCompileProjects { get; set; }
45 
46  /// <summary>
47  /// Gets or sets the extra compile properties, used when <see cref="AutoCompileProjects"/> is true.
48  /// </summary>
49  /// <value>
50  /// The extra compile parameters.
51  /// </value>
52  public Dictionary<string, string> ExtraCompileProperties { get; set; }
53 
54  /// <summary>
55  /// Gets or sets a value indicating whether to automatically load assets. Default is <c>true</c>
56  /// </summary>
57  /// <value><c>true</c> if [automatic load assets]; otherwise, <c>false</c>.</value>
58  public bool AutoLoadTemporaryAssets { get; set; }
59 
60  /// <summary>
61  /// Gets or sets a value indicating whether to convert all <see cref="UPath"/> to absolute paths when loading. Default
62  /// is <c>true</c>
63  /// </summary>
64  /// <value><c>true</c> if [convert u path to absolute]; otherwise, <c>false</c>.</value>
65  public bool ConvertUPathToAbsolute { get; set; }
66 
67  /// <summary>
68  /// Gets or sets the cancelation token.
69  /// </summary>
70  /// <value>The cancel token.</value>
71  public CancellationToken? CancelToken { get; set; }
72 
73  /// <summary>
74  /// Gets or sets the assembly container used to load assemblies referenced by the package. If null, will use the
75  /// <see cref="SiliconStudio.Core.Reflection.AssemblyContainer.Default"/>
76  /// </summary>
77  /// <value>The assembly container.</value>
78  public AssemblyContainer AssemblyContainer { get; set; }
79 
80  /// <summary>
81  /// Gets or sets the generate new asset ids.
82  /// </summary>
83  /// <value>The generate new asset ids.</value>
84  public bool GenerateNewAssetIds { get; set; }
85 
86  /// <summary>
87  /// Clones this instance.
88  /// </summary>
89  /// <returns>PackageLoadParameters.</returns>
91  {
92  return (PackageLoadParameters)MemberwiseClone();
93  }
94  }
95 }
Parameters used for loading a package.
PackageLoadParameters Clone()
Clones this instance.
static PackageLoadParameters Default()
Gets the default parameters.