Esempio n. 1
0
 /// <summary>
 /// Registers super properties without overwriting ones that have already been set.
 /// </summary>
 /// <param name="key">name of the property to register</param>
 /// <param name="value">value of the property to register</param>
 public static void RegisterOnce(string key, object value)
 {
     if (!OnceProperties.ContainsKey(key))
     {
         OnceProperties.Add(key, value);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Returns a super property by name if exists. If not will return empty Value object
 /// </summary>
 /// <param name="name">Name of property to get value</param>
 /// <returns>Super property registered with specified key</returns>
 public static Value GetSuperProperty(string name)
 {
     if (SuperProperties.TryGetValue(name, out var value))
     {
         return(value);
     }
     if (OnceProperties.TryGetValue(name, out value))
     {
         return(value);
     }
     return(new Value());
 }