Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
SourceCodeAsset.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 
4 using System;
5 using System.ComponentModel;
6 using System.Text;
7 
8 using SiliconStudio.Core;
9 using SiliconStudio.Core.IO;
10 using SiliconStudio.Core.Storage;
11 
12 namespace SiliconStudio.Assets
13 {
14  /// <summary>
15  /// Class SourceCodeAsset.
16  /// </summary>
17  [DataContract("SourceCodeAsset")]
18  public abstract class SourceCodeAsset : Asset
19  {
20  /// <summary>
21  /// Gets or sets the absolute source location of this asset on the disk.
22  /// </summary>
23  /// <value>The absolute source location.</value>
24  [Browsable(false)]
25  public UFile AbsoluteSourceLocation { get; set; }
26 
27  public string Text { get; set; }
28 
29  /// <summary>
30  /// Generates a unique identifier from location.
31  /// </summary>
32  /// <param name="location">The location.</param>
33  /// <returns>Guid.</returns>
34  public static Guid GenerateGuidFromLocation(string location)
35  {
36  if (location == null) throw new ArgumentNullException("location");
37  return ObjectId.FromBytes(Encoding.UTF8.GetBytes(location)).ToGuid();
38  }
39  }
40 }
Base class for Asset.
Definition: Asset.cs:14
static Guid GenerateGuidFromLocation(string location)
Generates a unique identifier from location.
Defines a normalized file path. See UPath for details. This class cannot be inherited.
Definition: UFile.cs:13