Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Framework / System / Windows / Automation / Peers / RangeBaseAutomationPeer.cs / 1 / RangeBaseAutomationPeer.cs
using System; using System.Runtime.InteropServices; using System.Security; using System.Text; using System.Windows; using System.Windows.Automation.Provider; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Interop; using System.Windows.Media; using MS.Internal; using MS.Win32; namespace System.Windows.Automation.Peers { /// public class RangeBaseAutomationPeer : FrameworkElementAutomationPeer, IRangeValueProvider { /// public RangeBaseAutomationPeer(RangeBase owner): base(owner) { } /// override public object GetPattern(PatternInterface patternInterface) { if (patternInterface == PatternInterface.RangeValue) return this; return null; } // [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] internal void RaiseMinimumPropertyChangedEvent(double oldValue, double newValue) { RaisePropertyChangedEvent(RangeValuePatternIdentifiers.MinimumProperty, oldValue, newValue); } // [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] internal void RaiseMaximumPropertyChangedEvent(double oldValue, double newValue) { RaisePropertyChangedEvent(RangeValuePatternIdentifiers.MaximumProperty, oldValue, newValue); } // [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] internal void RaiseValuePropertyChangedEvent(double oldValue, double newValue) { RaisePropertyChangedEvent(RangeValuePatternIdentifiers.ValueProperty, oldValue, newValue); } ////// Request to set the value that this UI element is representing /// /// Value to set the UI to, as an object ///true if the UI element was successfully set to the specified value //[CodeAnalysis("AptcaMethodsShouldOnlyCallAptcaMethods")] //Tracking Bug: 29647 void IRangeValueProvider.SetValue(double val) { if (!IsEnabled()) throw new ElementNotEnabledException(); RangeBase owner = (RangeBase)Owner; if (val < owner.Minimum || val > owner.Maximum) { throw new ArgumentOutOfRangeException("val"); } owner.Value = (double)val; } ///Value of a value control, as an object double IRangeValueProvider.Value { get { return ((RangeBase)Owner).Value; } } ///Indicates that the value can only be read, not modified. ///returns True if the control is read-only bool IRangeValueProvider.IsReadOnly { get { return !IsEnabled(); } } ///maximum value double IRangeValueProvider.Maximum { get { return ((RangeBase)Owner).Maximum; } } ///minimum value double IRangeValueProvider.Minimum { get { return ((RangeBase)Owner).Minimum; } } ///Value of a Large Change double IRangeValueProvider.LargeChange { get { return ((RangeBase)Owner).LargeChange; } } ///Value of a Small Change double IRangeValueProvider.SmallChange { get { return ((RangeBase)Owner).SmallChange; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; using System.Runtime.InteropServices; using System.Security; using System.Text; using System.Windows; using System.Windows.Automation.Provider; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Interop; using System.Windows.Media; using MS.Internal; using MS.Win32; namespace System.Windows.Automation.Peers { /// public class RangeBaseAutomationPeer : FrameworkElementAutomationPeer, IRangeValueProvider { /// public RangeBaseAutomationPeer(RangeBase owner): base(owner) { } /// override public object GetPattern(PatternInterface patternInterface) { if (patternInterface == PatternInterface.RangeValue) return this; return null; } // [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] internal void RaiseMinimumPropertyChangedEvent(double oldValue, double newValue) { RaisePropertyChangedEvent(RangeValuePatternIdentifiers.MinimumProperty, oldValue, newValue); } // [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] internal void RaiseMaximumPropertyChangedEvent(double oldValue, double newValue) { RaisePropertyChangedEvent(RangeValuePatternIdentifiers.MaximumProperty, oldValue, newValue); } // [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] internal void RaiseValuePropertyChangedEvent(double oldValue, double newValue) { RaisePropertyChangedEvent(RangeValuePatternIdentifiers.ValueProperty, oldValue, newValue); } ////// Request to set the value that this UI element is representing /// /// Value to set the UI to, as an object ///true if the UI element was successfully set to the specified value //[CodeAnalysis("AptcaMethodsShouldOnlyCallAptcaMethods")] //Tracking Bug: 29647 void IRangeValueProvider.SetValue(double val) { if (!IsEnabled()) throw new ElementNotEnabledException(); RangeBase owner = (RangeBase)Owner; if (val < owner.Minimum || val > owner.Maximum) { throw new ArgumentOutOfRangeException("val"); } owner.Value = (double)val; } ///Value of a value control, as an object double IRangeValueProvider.Value { get { return ((RangeBase)Owner).Value; } } ///Indicates that the value can only be read, not modified. ///returns True if the control is read-only bool IRangeValueProvider.IsReadOnly { get { return !IsEnabled(); } } ///maximum value double IRangeValueProvider.Maximum { get { return ((RangeBase)Owner).Maximum; } } ///minimum value double IRangeValueProvider.Minimum { get { return ((RangeBase)Owner).Minimum; } } ///Value of a Large Change double IRangeValueProvider.LargeChange { get { return ((RangeBase)Owner).LargeChange; } } ///Value of a Small Change double IRangeValueProvider.SmallChange { get { return ((RangeBase)Owner).SmallChange; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Receive.cs
- TrustLevelCollection.cs
- ICspAsymmetricAlgorithm.cs
- StylusDownEventArgs.cs
- SubclassTypeValidator.cs
- MissingMemberException.cs
- SqlNodeTypeOperators.cs
- SchemaTypeEmitter.cs
- panel.cs
- XmlSchemaValidationException.cs
- Int32Converter.cs
- UInt32Storage.cs
- PathSegmentCollection.cs
- unitconverter.cs
- EditCommandColumn.cs
- BitConverter.cs
- TextTreePropertyUndoUnit.cs
- Int32AnimationBase.cs
- DescendentsWalkerBase.cs
- HttpVersion.cs
- DocumentSequenceHighlightLayer.cs
- ContainsRowNumberChecker.cs
- BamlResourceContent.cs
- BuildProviderUtils.cs
- GeneralTransform3D.cs
- XamlFigureLengthSerializer.cs
- ContentTextAutomationPeer.cs
- WeakReferenceKey.cs
- DiscoveryService.cs
- BufferedGraphicsContext.cs
- StateMachineSubscription.cs
- SqlResolver.cs
- RoleGroup.cs
- StorageSetMapping.cs
- Journal.cs
- embossbitmapeffect.cs
- Queue.cs
- NativeMethods.cs
- ClickablePoint.cs
- ClientConfigurationSystem.cs
- QueryGeneratorBase.cs
- SafeRightsManagementHandle.cs
- NumericUpDownAcceleration.cs
- NameNode.cs
- Utils.cs
- DataServiceRequestOfT.cs
- FontFamilyValueSerializer.cs
- TripleDESCryptoServiceProvider.cs
- WebReferenceCollection.cs
- ReferentialConstraint.cs
- AmbientValueAttribute.cs
- AccessDataSourceView.cs
- GradientStop.cs
- XmlUTF8TextWriter.cs
- CreateUserWizardAutoFormat.cs
- ControlPager.cs
- TransformProviderWrapper.cs
- WebSysDefaultValueAttribute.cs
- UniqueSet.cs
- JsonFormatMapping.cs
- ExtensionsSection.cs
- MenuItem.cs
- ContentControl.cs
- FileStream.cs
- TextRangeEdit.cs
- DataGridViewColumnTypePicker.cs
- DataGridViewColumnConverter.cs
- QuaternionAnimation.cs
- AttachedPropertyMethodSelector.cs
- CachedRequestParams.cs
- Permission.cs
- LambdaCompiler.Lambda.cs
- translator.cs
- FileDialog.cs
- TextOptions.cs
- FindCriteriaElement.cs
- XmlNode.cs
- FontWeightConverter.cs
- WindowsAltTab.cs
- StickyNoteAnnotations.cs
- RegexCompiler.cs
- XmlSchema.cs
- COM2Enum.cs
- HttpPostLocalhostServerProtocol.cs
- TreeNodeBinding.cs
- PresentationSource.cs
- HwndProxyElementProvider.cs
- TablePatternIdentifiers.cs
- ValueSerializerAttribute.cs
- RefExpr.cs
- DataMemberAttribute.cs
- FileInfo.cs
- HashCoreRequest.cs
- TextParagraphCache.cs
- CurrentTimeZone.cs
- MailMessage.cs
- IERequestCache.cs
- SourceLineInfo.cs
- CompletionCallbackWrapper.cs
- WindowsIdentity.cs