Пример #1
0
        public void RaisePropertyChangedEvent(AutomationPeer peer,
                                              AutomationProperty property,
                                              object oldValue,
                                              object newValue)
        {
            if (!AccessibilityEnabled || peer == null)
            {
                return;
            }

            if (object.Equals(newValue, oldValue))
            {
                return;
            }

            // We are going to raise changes only when the value ACTUALLY CHANGES
            IAutomationCacheProperty cachedProperty = peer.GetCachedProperty(property);

            if (cachedProperty != null)
            {
                if (object.Equals(newValue, cachedProperty.OldValue))
                {
                    return;
                }
                cachedProperty.OldValue = newValue;
            }

            if (AutomationPropertyChanged != null)
            {
                AutomationPropertyChanged(this,
                                          new AutomationPropertyChangedEventArgs(peer,
                                                                                 property,
                                                                                 oldValue,
                                                                                 newValue));
            }
        }
Пример #2
0
		public void RaisePropertyChangedEvent (AutomationPeer peer, 
		                                       AutomationProperty property, 
		                                       object oldValue, 
						       object newValue)
		{
			if (!AccessibilityEnabled || peer == null)
				return;

			if (object.Equals (newValue, oldValue))
				return;

			// We are going to raise changes only when the value ACTUALLY CHANGES
			IAutomationCacheProperty cachedProperty = peer.GetCachedProperty (property);
			if (cachedProperty != null) {
				if (object.Equals (newValue, cachedProperty.OldValue))
					return;
				cachedProperty.OldValue = newValue;
			}

			if (AutomationPropertyChanged != null)
				AutomationPropertyChanged (this, 
				                           new AutomationPropertyChangedEventArgs (peer, 
							                                           property, 
												   oldValue, 
												   newValue));
		}