Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Automation / Peers / RangeBaseAutomationPeer.cs / 1305600 / 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; else return base.GetPattern(patternInterface); } // [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); } ////// Helper function for IRangeValueProvider.SetValue to provide a way for drive classes to have /// custom way of implementing it. /// /// virtual internal void SetValueCore(double val) { RangeBase owner = (RangeBase)Owner; if (val < owner.Minimum || val > owner.Maximum) { throw new ArgumentOutOfRangeException("val"); } owner.Value = (double)val; } ////// 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(); SetValueCore(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; else return base.GetPattern(patternInterface); } // [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); } ////// Helper function for IRangeValueProvider.SetValue to provide a way for drive classes to have /// custom way of implementing it. /// /// virtual internal void SetValueCore(double val) { RangeBase owner = (RangeBase)Owner; if (val < owner.Minimum || val > owner.Maximum) { throw new ArgumentOutOfRangeException("val"); } owner.Value = (double)val; } ////// 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(); SetValueCore(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
- ProcessModelSection.cs
- DayRenderEvent.cs
- Semaphore.cs
- HtmlInputRadioButton.cs
- XPathPatternBuilder.cs
- GiveFeedbackEvent.cs
- WebRequestModuleElementCollection.cs
- SettingsPropertyIsReadOnlyException.cs
- FontUnitConverter.cs
- OneWayChannelFactory.cs
- PeerResolverBindingElement.cs
- XPathEmptyIterator.cs
- ValidatedControlConverter.cs
- NameNode.cs
- WebConfigurationFileMap.cs
- InstanceStoreQueryResult.cs
- ContractListAdapter.cs
- JournalNavigationScope.cs
- BufferBuilder.cs
- FormsAuthentication.cs
- ExpressionEditorAttribute.cs
- Compiler.cs
- SqlConnectionHelper.cs
- IdnMapping.cs
- SharedHttpTransportManager.cs
- ParenExpr.cs
- CompensateDesigner.cs
- ProfileSettings.cs
- Math.cs
- UpdateExpressionVisitor.cs
- AssemblyInfo.cs
- Deserializer.cs
- EventLogEntry.cs
- ButtonColumn.cs
- NavigationProperty.cs
- DataGridViewComboBoxColumn.cs
- XmlDocumentFragment.cs
- ExpandCollapsePattern.cs
- StackBuilderSink.cs
- Pair.cs
- KeyManager.cs
- DataList.cs
- XmlResolver.cs
- XmlSerializableReader.cs
- InvalidCommandTreeException.cs
- LinqDataView.cs
- MasterPageBuildProvider.cs
- EntityDataSourceChangingEventArgs.cs
- LocalizationParserHooks.cs
- DocumentNUp.cs
- CultureMapper.cs
- CrossAppDomainChannel.cs
- XmlNotation.cs
- UpdateEventArgs.cs
- TemplateControl.cs
- SqlDataSourceConfigureFilterForm.cs
- Transform3D.cs
- XmlSchemaAttributeGroup.cs
- Page.cs
- UncommonField.cs
- KeyValueConfigurationElement.cs
- ToolStripRenderer.cs
- NamedPipeActivation.cs
- IisTraceListener.cs
- StreamBodyWriter.cs
- TableColumnCollection.cs
- LabelEditEvent.cs
- LeafCellTreeNode.cs
- SessionState.cs
- DrawTreeNodeEventArgs.cs
- JournalEntryStack.cs
- TraceContext.cs
- HMACSHA1.cs
- ContentFileHelper.cs
- PageThemeBuildProvider.cs
- controlskin.cs
- DataGridViewSelectedColumnCollection.cs
- HeaderCollection.cs
- ServicePoint.cs
- JournalEntryStack.cs
- PathGradientBrush.cs
- IdentityNotMappedException.cs
- SqlDataSourceCommandEventArgs.cs
- XmlSchemaElement.cs
- SoapSchemaMember.cs
- Interlocked.cs
- TextRunTypographyProperties.cs
- ToolboxControl.cs
- _PooledStream.cs
- ToolStripItem.cs
- EraserBehavior.cs
- DataGridViewHitTestInfo.cs
- EventManager.cs
- RecordManager.cs
- FixedSOMSemanticBox.cs
- TdsEnums.cs
- SmtpReplyReaderFactory.cs
- DataGridLinkButton.cs
- DataContractSerializerOperationFormatter.cs
- ShapeTypeface.cs