Rename HtmlMapping to just Mapping

This commit is contained in:
Frank A. Krueger 2017-06-12 13:46:42 -07:00
parent 9aee6bc5ac
commit 68248ad2a2
2 changed files with 9 additions and 9 deletions

View File

@ -3,12 +3,12 @@ using System.Collections.Generic;
namespace Ooui namespace Ooui
{ {
public class HtmlMapping public class Mapping
{ {
readonly Type type; readonly Type type;
public string TagName { get; private set; } public string TagName { get; private set; }
public HtmlMapping (Type type) public Mapping (Type type)
{ {
this.type = type; this.type = type;
TagName = type.Name.ToLowerInvariant (); TagName = type.Name.ToLowerInvariant ();
@ -19,15 +19,15 @@ namespace Ooui
return propertyName; return propertyName;
} }
static readonly Dictionary<string, HtmlMapping> mappings = static readonly Dictionary<string, Mapping> mappings =
new Dictionary<string, HtmlMapping> (); new Dictionary<string, Mapping> ();
public static HtmlMapping Get (Type type) public static Mapping Get (Type type)
{ {
var key = type.FullName; var key = type.FullName;
HtmlMapping m; Mapping m;
if (!mappings.TryGetValue (key, out m)) { if (!mappings.TryGetValue (key, out m)) {
m = new HtmlMapping (type); m = new Mapping (type);
mappings[key] = m; mappings[key] = m;
} }
return m; return m;

View File

@ -8,7 +8,7 @@ namespace Ooui
{ {
public string Id { get; private set; } = GenerateId (); public string Id { get; private set; } = GenerateId ();
public HtmlMapping Mapping { get; private set; } public Mapping Mapping { get; private set; }
readonly List<Node> children = new List<Node> (); readonly List<Node> children = new List<Node> ();
readonly List<Message> messages = new List<Message> (); readonly List<Message> messages = new List<Message> ();
@ -16,7 +16,7 @@ namespace Ooui
public Node () public Node ()
{ {
Mapping = HtmlMapping.Get (GetType ()); Mapping = Mapping.Get (GetType ());
LogCreate (); LogCreate ();
} }