Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- IndexerNameAttribute.cs
- UnsafeNativeMethodsCLR.cs
- PreloadedPackages.cs
- HtmlGenericControl.cs
- RepeaterItemEventArgs.cs
- ToolStripItemEventArgs.cs
- Vector3DCollectionConverter.cs
- Knowncolors.cs
- SafeHandles.cs
- SelectionChangedEventArgs.cs
- ExpressionBuilder.cs
- QuaternionIndependentAnimationStorage.cs
- ProtocolsConfiguration.cs
- ValueQuery.cs
- ListItemCollection.cs
- JavascriptXmlWriterWrapper.cs
- PageContentAsyncResult.cs
- PresentationSource.cs
- ProjectionNode.cs
- TextControl.cs
- SourceElementsCollection.cs
- BufferedWebEventProvider.cs
- loginstatus.cs
- ConfigurationSectionGroupCollection.cs
- PersonalizableAttribute.cs
- DataPagerFieldCollection.cs
- CapabilitiesRule.cs
- ByteConverter.cs
- RtfNavigator.cs
- VerificationException.cs
- DeviceContext2.cs
- Pointer.cs
- BinaryObjectWriter.cs
- TypeBuilderInstantiation.cs
- PeerTransportCredentialType.cs
- DataControlLinkButton.cs
- DataTransferEventArgs.cs
- ChannelTracker.cs
- PrintingPermissionAttribute.cs
- SupportingTokenParameters.cs
- TrackingProfileDeserializationException.cs
- TextEndOfParagraph.cs
- SchemaElementLookUpTableEnumerator.cs
- ReaderWriterLockWrapper.cs
- MergeFilterQuery.cs
- cryptoapiTransform.cs
- LexicalChunk.cs
- ClientSettingsStore.cs
- CompilationRelaxations.cs
- ProgramPublisher.cs
- WebPartHeaderCloseVerb.cs
- LiteralControl.cs
- SmiMetaDataProperty.cs
- WebBrowsableAttribute.cs
- MLangCodePageEncoding.cs
- ForwardPositionQuery.cs
- Convert.cs
- WorkflowInstanceQuery.cs
- CombinedGeometry.cs
- TableRowGroupCollection.cs
- SafeHandles.cs
- MatrixAnimationBase.cs
- WebPermission.cs
- WeakRefEnumerator.cs
- QuaternionAnimationBase.cs
- OleDbRowUpdatingEvent.cs
- DataPagerCommandEventArgs.cs
- ListBase.cs
- DBCommand.cs
- DynamicVirtualDiscoSearcher.cs
- ServiceEndpointAssociationProvider.cs
- MatrixCamera.cs
- LabelDesigner.cs
- ExtendedPropertyDescriptor.cs
- NotFiniteNumberException.cs
- SetMemberBinder.cs
- TrackingValidationObjectDictionary.cs
- HistoryEventArgs.cs
- ReferentialConstraint.cs
- EntityProxyTypeInfo.cs
- ScaleTransform.cs
- ListViewSortEventArgs.cs
- StringUtil.cs
- DataTableClearEvent.cs
- MsmqInputMessage.cs
- _BasicClient.cs
- StylusPlugin.cs
- __Filters.cs
- DataGridItemEventArgs.cs
- GestureRecognitionResult.cs
- ColumnWidthChangedEvent.cs
- QilFactory.cs
- ImageMap.cs
- ObjectToken.cs
- ContentFilePart.cs
- GroupDescription.cs
- WindowsFont.cs
- ModifierKeysValueSerializer.cs
- COM2ColorConverter.cs
- RightsManagementInformation.cs