コード例 #1
0
        //------------------------------------------------------------------------------------
        /// <summary>
        /// Sets a value that will be cached locally (not saved to the backing store).
        /// </summary>
        //------------------------------------------------------------------------------------
        private void EnsureLocalValue(string publicPropName, PropType type)
        {
            lock (SyncLockLocalProperties)
            {
                if (LocalProperties == null)
                {
                    LocalProperties = new System.Collections.Generic.Dictionary <string, object>();
                }

                if (!LocalProperties.ContainsKey(publicPropName))
                {
                    LocalProperties.Add(publicPropName, ItemProperty.GetValue(null, type));
                }
            }
        }
コード例 #2
0
 //------------------------------------------------------------------------------------
 /// <summary>
 /// Sets a value that will be cached locally (not saved to the backing store).
 /// </summary>
 //------------------------------------------------------------------------------------
 private void SetLocalValue(object value, string publicPropName, PropType type)
 {
     EnsureLocalValue(publicPropName, type);
     LocalProperties[publicPropName] = ItemProperty.GetValue(value, type);
 }