Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- HtmlImage.cs
- SystemFonts.cs
- XmlReflectionImporter.cs
- ResponseStream.cs
- TraceUtility.cs
- XmlSchemaExporter.cs
- ContractSearchPattern.cs
- Operator.cs
- SqlException.cs
- QueryConverter.cs
- InputMethodStateTypeInfo.cs
- DrawListViewSubItemEventArgs.cs
- SqlDataSource.cs
- TextViewBase.cs
- AlgoModule.cs
- XmlConvert.cs
- _AutoWebProxyScriptEngine.cs
- XComponentModel.cs
- HTTPNotFoundHandler.cs
- XPathSingletonIterator.cs
- WebPartCatalogAddVerb.cs
- UserControl.cs
- BufferedStream.cs
- Soap12ProtocolImporter.cs
- HttpCookieCollection.cs
- TemplateXamlParser.cs
- XmlNotation.cs
- Oid.cs
- DataServiceQueryProvider.cs
- TreeNodeConverter.cs
- ToolStripComboBox.cs
- WebPartConnectionsDisconnectVerb.cs
- BindUriHelper.cs
- MetadataPropertyCollection.cs
- NavigationProgressEventArgs.cs
- ArraySegment.cs
- GregorianCalendar.cs
- TdsParserStaticMethods.cs
- ReturnType.cs
- MatrixStack.cs
- EmptyCollection.cs
- SqlStatistics.cs
- WebControl.cs
- BaseValidatorDesigner.cs
- XmlSchemaDatatype.cs
- DataGridRowAutomationPeer.cs
- SpeechRecognizer.cs
- Schema.cs
- BroadcastEventHelper.cs
- RuleSetBrowserDialog.cs
- ArrayEditor.cs
- SrgsOneOf.cs
- XPathAxisIterator.cs
- IisNotInstalledException.cs
- SplayTreeNode.cs
- CharacterBufferReference.cs
- SqlCacheDependencyDatabaseCollection.cs
- ProviderIncompatibleException.cs
- VerticalAlignConverter.cs
- altserialization.cs
- XDRSchema.cs
- VariantWrapper.cs
- DictionaryChange.cs
- DataGridLinkButton.cs
- UndoManager.cs
- MissingFieldException.cs
- EventWaitHandle.cs
- RawTextInputReport.cs
- _SecureChannel.cs
- BitmapEffectvisualstate.cs
- ScriptRef.cs
- CheckBox.cs
- DataGridCell.cs
- TraceContextEventArgs.cs
- MarkupCompiler.cs
- CacheModeValueSerializer.cs
- PeerObject.cs
- DataServiceRequestOfT.cs
- FileCodeGroup.cs
- DesignTable.cs
- ConnectionProviderAttribute.cs
- Normalizer.cs
- ModuleBuilderData.cs
- RoleGroupCollection.cs
- MsmqMessageSerializationFormat.cs
- Missing.cs
- CollectionViewProxy.cs
- ValidatorCollection.cs
- ResizeBehavior.cs
- FactoryRecord.cs
- CodePrimitiveExpression.cs
- mediaeventargs.cs
- TrustVersion.cs
- RectValueSerializer.cs
- StandardCommands.cs
- _LocalDataStore.cs
- RTTrackingProfile.cs
- SspiSafeHandles.cs
- glyphs.cs
- StringToken.cs