コード例 #1
0
        public virtual void SetDefaults()
        {
            // The latching and explicit call to ElementValueChanged() is to make sure
            // elements like TextBox fire change events correctly on this method

            var changed = false;

            WithinLatch(
                delegate
            {
                object lastValue = LastChosenValues.Retrieve(Driver);
                if (lastValue != null)
                {
                    changed = true;
                    ResetControl((PROPERTYTYPE)lastValue);
                }
            });

            if (changed && IsBound)
            {
                ElementValueChanged();
            }
        }
コード例 #2
0
        private void StoreValue()
        {
            object currentValue = GetValueFromControl();

            LastChosenValues.Store(Driver, currentValue);
        }