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
- ServiceBehaviorElement.cs
- OptimalBreakSession.cs
- BasicExpressionVisitor.cs
- SoapMessage.cs
- RC2CryptoServiceProvider.cs
- BaseCollection.cs
- WeakReferenceKey.cs
- AnnotationMap.cs
- DesignerCapabilities.cs
- ClientSideProviderDescription.cs
- SafeCertificateContext.cs
- CustomActivityDesigner.cs
- XmlTypeAttribute.cs
- CompressStream.cs
- _SSPISessionCache.cs
- OracleParameterCollection.cs
- IProducerConsumerCollection.cs
- SqlProviderUtilities.cs
- WpfWebRequestHelper.cs
- PositiveTimeSpanValidator.cs
- XamlFilter.cs
- QueryResult.cs
- ReflectEventDescriptor.cs
- LoadWorkflowByInstanceKeyCommand.cs
- WindowsFormsSynchronizationContext.cs
- XmlMemberMapping.cs
- XmlCustomFormatter.cs
- InheritanceAttribute.cs
- UrlPath.cs
- ServiceChannelManager.cs
- PropertyGridView.cs
- DesignTimeValidationFeature.cs
- SqlNotificationRequest.cs
- FixedDSBuilder.cs
- SortQuery.cs
- ToolStripContainer.cs
- ObjectItemCachedAssemblyLoader.cs
- HttpConfigurationContext.cs
- _RequestCacheProtocol.cs
- Authorization.cs
- HttpListenerResponse.cs
- COM2FontConverter.cs
- HttpResponseHeader.cs
- PermissionSetTriple.cs
- ISCIIEncoding.cs
- StubHelpers.cs
- HtmlTable.cs
- OdbcConnection.cs
- VerificationAttribute.cs
- HtmlTableCellCollection.cs
- StorageMappingItemLoader.cs
- TableItemProviderWrapper.cs
- EntityDataSourceView.cs
- ConfigXmlComment.cs
- Error.cs
- BroadcastEventHelper.cs
- RenamedEventArgs.cs
- EraserBehavior.cs
- LinqDataSourceStatusEventArgs.cs
- UnsafeNativeMethods.cs
- NumberSubstitution.cs
- GPStream.cs
- WebPartChrome.cs
- LoopExpression.cs
- Utils.cs
- ProfilePropertySettingsCollection.cs
- TaskFormBase.cs
- FactoryGenerator.cs
- BinaryReader.cs
- CollectionViewGroupRoot.cs
- TreeViewCancelEvent.cs
- AddInProcess.cs
- HttpApplicationFactory.cs
- PassportAuthentication.cs
- FlowDocumentPaginator.cs
- LoginView.cs
- ConfigurationFileMap.cs
- SqlAliasesReferenced.cs
- ResourceCategoryAttribute.cs
- NavigationPropertyEmitter.cs
- NameValueSectionHandler.cs
- CompensateDesigner.cs
- XLinq.cs
- SignatureHelper.cs
- IsolatedStorageFileStream.cs
- CharacterBufferReference.cs
- _BufferOffsetSize.cs
- ApplicationHost.cs
- BindingCollection.cs
- Gdiplus.cs
- QueryStringParameter.cs
- XPathCompileException.cs
- CompareInfo.cs
- TextContainerChangedEventArgs.cs
- AsymmetricSignatureFormatter.cs
- errorpatternmatcher.cs
- TableProviderWrapper.cs
- CodeMemberField.cs
- TrustSection.cs
- List.cs