Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Automation / Peers / ScrollBarAutomationPeer.cs / 1305600 / ScrollBarAutomationPeer.cs
using System; using System.Runtime.InteropServices; using System.Windows; using System.Windows.Automation.Provider; using System.Windows.Controls; using System.Windows.Controls.Primitives; using MS.Internal; using MS.Win32; namespace System.Windows.Automation.Peers { /// public class ScrollBarAutomationPeer : RangeBaseAutomationPeer { /// public ScrollBarAutomationPeer(ScrollBar owner): base(owner) { } /// override protected string GetClassNameCore() { return "ScrollBar"; } /// override protected AutomationControlType GetAutomationControlTypeCore() { return AutomationControlType.ScrollBar; } /// protected override Point GetClickablePointCore() { return new Point(double.NaN, double.NaN); } /// protected override AutomationOrientation GetOrientationCore() { return ((ScrollBar)Owner).Orientation == Orientation.Horizontal ? AutomationOrientation.Horizontal : AutomationOrientation.Vertical; } /// internal override void SetValueCore(double val) { double horizontalPercent = -1; double verticalPercent = -1; ScrollBar sb = Owner as ScrollBar; ScrollViewer sv = sb.TemplatedParent as ScrollViewer; if (sv == null) { base.SetValueCore(val); } else { if (sb.Orientation == Orientation.Horizontal) { horizontalPercent = (val / (sv.ExtentWidth - sv.ViewportWidth)) * 100; } else { verticalPercent = (val / (sv.ExtentHeight - sv.ViewportHeight)) * 100; } ScrollViewerAutomationPeer svAP = UIElementAutomationPeer.FromElement(sv) as ScrollViewerAutomationPeer; IScrollProvider scrollProvider = svAP as IScrollProvider; scrollProvider.SetScrollPercent(horizontalPercent, verticalPercent); } } } } // 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
- OperationExecutionFault.cs
- ThreadInterruptedException.cs
- CompilationUnit.cs
- RoutingChannelExtension.cs
- OLEDB_Util.cs
- OutputScopeManager.cs
- filewebresponse.cs
- BitmapEffectGeneralTransform.cs
- ImageSource.cs
- InternalEnumValidatorAttribute.cs
- XPathNodeIterator.cs
- ProgressBarAutomationPeer.cs
- FontSource.cs
- columnmapfactory.cs
- TextInfo.cs
- ClassDataContract.cs
- WebPartEditorOkVerb.cs
- EntityViewContainer.cs
- HttpModuleAction.cs
- BamlRecordReader.cs
- XmlSchemaComplexContentExtension.cs
- EntityContainerRelationshipSet.cs
- ImageIndexEditor.cs
- DataGridViewBindingCompleteEventArgs.cs
- StylusButtonCollection.cs
- mda.cs
- SpellerStatusTable.cs
- MessageHeaderDescription.cs
- PlainXmlWriter.cs
- SettingsProperty.cs
- _AutoWebProxyScriptWrapper.cs
- CapiNative.cs
- CompiledIdentityConstraint.cs
- ButtonColumn.cs
- StrongTypingException.cs
- ComplexObject.cs
- HttpConfigurationSystem.cs
- ToolStripDropDownItem.cs
- Attributes.cs
- ClientTargetSection.cs
- RichTextBoxConstants.cs
- ProfilePropertyNameValidator.cs
- WebResourceUtil.cs
- DragDeltaEventArgs.cs
- parserscommon.cs
- PowerModeChangedEventArgs.cs
- FontCacheLogic.cs
- IdentityManager.cs
- MouseWheelEventArgs.cs
- FileSecurity.cs
- ListViewDeleteEventArgs.cs
- SqlStatistics.cs
- TemplateColumn.cs
- StringWriter.cs
- NavigatingCancelEventArgs.cs
- IChannel.cs
- BitmapMetadata.cs
- PropertyGridEditorPart.cs
- XmlEntityReference.cs
- ContractInferenceHelper.cs
- SHA256.cs
- SHA384.cs
- Geometry.cs
- AppSecurityManager.cs
- ExtensionWindow.cs
- WebBrowserBase.cs
- MessageBox.cs
- DataSourceGroupCollection.cs
- wgx_sdk_version.cs
- WebServiceBindingAttribute.cs
- ItemDragEvent.cs
- OleDbEnumerator.cs
- ISessionStateStore.cs
- TextPattern.cs
- SecurityHelper.cs
- DataGridSortCommandEventArgs.cs
- WaveHeader.cs
- MaskedTextBox.cs
- CrossAppDomainChannel.cs
- InternalEnumValidator.cs
- _NtlmClient.cs
- ExpressionPrinter.cs
- TextSchema.cs
- Context.cs
- StatusBarPanel.cs
- WindowsImpersonationContext.cs
- TripleDESCryptoServiceProvider.cs
- HttpGetServerProtocol.cs
- PrintEvent.cs
- TerminateSequence.cs
- TableLayoutSettingsTypeConverter.cs
- EmptyStringExpandableObjectConverter.cs
- UnmanagedBitmapWrapper.cs
- RemotingException.cs
- SerializationInfoEnumerator.cs
- HTTP_SERVICE_CONFIG_URLACL_KEY.cs
- NavigationProperty.cs
- SqlLiftWhereClauses.cs
- UrlPropertyAttribute.cs
- SymLanguageVendor.cs