Rename resource meta interface.

This commit is contained in:
2023-11-29 13:44:25 +08:00
parent e210837329
commit 190c3ef680
6 changed files with 8 additions and 9 deletions

View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
namespace Cryville.Crtr.Browsing {
public class MetaProperty {
public string Name { get; set; }
public IReadOnlyDictionary<string, object> Values { get; set; }
public object MainValue { get { return Values[""]; } }
public MetaProperty(string name, IReadOnlyDictionary<string, object> values) {
if (values.Count == 0) throw new ArgumentException("Value is empty.");
if (!values.ContainsKey("")) throw new ArgumentException("Main value is missing.");
Name = name;
Values = values;
}
public MetaProperty(string name, object value) {
Name = name;
Values = new Dictionary<string, object> { { "", value } };
}
}
}