public void Load(ConfigNode node) { foreach (ConfigNode.Value val in node.values) { try { this[val.name] = (TValue)System.Convert.ChangeType(val.value, typeof(TValue)); } catch (Exception e) { StnSciScenario.LogException(e); this[val.name] = default(TValue); } } }
public void Load(ConfigNode node) { foreach (ConfigNode.Value val in node.values) { if (!this.ContainsKey(val.name)) { this[val.name] = new HashSet <TValue>(); } try { this[val.name].UnionWith(parse(val.value)); } catch (Exception e) { StnSciScenario.LogException(e); } } }