示例#1
0
 private static void SetDirect(IDynamicPropertySupport support)
 {
     lock (typeof(ConfigurationManager))
     {
         m_Config = support;
         DynamicProperty.RegisterWithDynamicPropertySupport(support);
         m_InitializedWithDefaultConfig = false;
     }
 }
示例#2
0
        protected PropertyWrapper(string propName, V defaultValue)
        {
            m_Property     = DynamicProperty.GetInstance(propName);
            m_DefaultValue = defaultValue;
            var type = GetType();

            // This checks whether this constructor is called by a class that
            // extends the immediate sub classes (IntProperty, etc.) of PropertyWrapper.
            // If yes, it is very likely that OnPropertyChanged() is overriden
            // in the sub class and we need to register the callback.
            // Otherwise, we know that OnPropertyChanged() does nothing in
            // immediate subclasses and we can avoid registering the callback, which
            // has the cost of modifying the event.
            if (!m_SubClassesWithNoCallback.ContainsKey(type))
            {
                PropertyChanged += (o, args) => OnPropertyChanged();
            }
        }
示例#3
0
 public DelegateCachedValue(DynamicProperty property, Func <string, T> parseFunc) : base(property)
 {
     m_ParseFunc = parseFunc;
 }
示例#4
0
 public CachedValue(DynamicProperty property)
 {
     m_Property = property;
     Flush();
 }