Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
AssetPropertyKeyNameResolver.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.Text;
5 
6 using SharpYaml.Serialization;
7 
8 using SiliconStudio.Core;
9 
10 namespace SiliconStudio.Assets
11 {
12  public static class AssetPropertyKeyNameResolver
13  {
14  public static string ComputePropertyKeyName(ITagTypeResolver tagResolver, PropertyKey propertyKey)
15  {
16  var className = tagResolver.TagFromType(propertyKey.OwnerType);
17  var sb = new StringBuilder(className.Length + 1 + propertyKey.Name.Length);
18 
19  sb.Append(className, 1, className.Length - 1); // Ignore initial '!'
20  sb.Append('.');
21  sb.Append(propertyKey.Name);
22  return sb.ToString();
23  }
24  }
25 }
string Name
Gets the name of this key.
Definition: PropertyKey.cs:60
static string ComputePropertyKeyName(ITagTypeResolver tagResolver, PropertyKey propertyKey)
A class that represents a tag propety.
Definition: PropertyKey.cs:17