Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Automation / Peers / ContentElementAutomationPeer.cs / 1305600 / ContentElementAutomationPeer.cs
//---------------------------------------------------------------------------- // // File: ContentElementAutomationPeer.cs // // Copyright (C) Microsoft Corporation. All rights reserved. // // Description: Automation element for ContentElements // //--------------------------------------------------------------------------- using System; // Object using System.Collections.Generic; // Listusing System.Windows.Input; // AccessKeyManager using MS.Internal.PresentationCore; // SR using System.Windows.Automation.Provider; using System.Windows.Automation; using MS.Internal.Automation; namespace System.Windows.Automation.Peers { /// public class ContentElementAutomationPeer : AutomationPeer { /// public ContentElementAutomationPeer(ContentElement owner) { if (owner == null) { throw new ArgumentNullException("owner"); } _owner = owner; } /// public ContentElement Owner { get { return _owner; } } /// /// This static helper creates an AutomationPeer for the specified element and /// caches it - that means the created peer is going to live long and shadow the /// element for its lifetime. The peer will be used by Automation to proxy the element, and /// to fire events to the Automation when something happens with the element. /// The created peer is returned from this method and also from subsequent calls to this method /// and public static AutomationPeer CreatePeerForElement(ContentElement element) { if (element == null) { throw new ArgumentNullException("element"); } return element.CreateAutomationPeer(); } /// public static AutomationPeer FromElement(ContentElement element) { if (element == null) { throw new ArgumentNullException("element"); } return element.GetAutomationPeer(); } ///. The type of the peer is determined by the /// virtual callback. If FrameworkContentElement does not /// implement the callback, there will be no peer and this method will return 'null' (in other /// words, there is no such thing as a 'default peer'). /// /// override protected List/// GetChildrenCore() { return null; } /// override public object GetPattern(PatternInterface patternInterface) { //Support synchronized input if (patternInterface == PatternInterface.SynchronizedInput) { // Adaptor object is used here to avoid loading UIA assemblies in non-UIA scenarios. if (_synchronizedInputPattern == null) _synchronizedInputPattern = new SynchronizedInputAdaptor(_owner); return _synchronizedInputPattern; } return null; } /// /// protected override AutomationControlType GetAutomationControlTypeCore() { return AutomationControlType.Custom; } ////// /// protected override string GetAutomationIdCore() { return AutomationProperties.GetAutomationId(_owner); } ////// /// protected override string GetNameCore() { return AutomationProperties.GetName(_owner); } ////// /// protected override string GetHelpTextCore() { return AutomationProperties.GetHelpText(_owner); } ////// /// override protected Rect GetBoundingRectangleCore() { return Rect.Empty; } ////// /// override protected bool IsOffscreenCore() { return true; } ////// /// override protected AutomationOrientation GetOrientationCore() { return AutomationOrientation.None; } ////// /// override protected string GetItemTypeCore() { return string.Empty; } ////// /// override protected string GetClassNameCore() { return string.Empty; } ////// /// override protected string GetItemStatusCore() { return string.Empty; } ////// /// override protected bool IsRequiredForFormCore() { return false; } ////// /// override protected bool IsKeyboardFocusableCore() { return Keyboard.IsFocusable(_owner); } ////// /// override protected bool HasKeyboardFocusCore() { return _owner.IsKeyboardFocused; } ////// /// override protected bool IsEnabledCore() { return _owner.IsEnabled; } ////// /// override protected bool IsPasswordCore() { return false; } ////// /// override protected bool IsContentElementCore() { return true; } ////// /// override protected bool IsControlElementCore() { return false; } ////// /// override protected AutomationPeer GetLabeledByCore() { return null; } ////// /// override protected string GetAcceleratorKeyCore() { return string.Empty; } ////// /// override protected string GetAccessKeyCore() { return AccessKeyManager.InternalGetAccessKeyCharacter(_owner); } ////// /// override protected Point GetClickablePointCore() { return new Point(double.NaN, double.NaN); } ////// /// override protected void SetFocusCore() { if (!_owner.Focus()) throw new InvalidOperationException(SR.Get(SRID.SetFocusFailed)); } /// internal override Rect GetVisibleBoundingRectCore() { return GetBoundingRectangle(); } private ContentElement _owner; private SynchronizedInputAdaptor _synchronizedInputPattern; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // File: ContentElementAutomationPeer.cs // // Copyright (C) Microsoft Corporation. All rights reserved. // // Description: Automation element for ContentElements // //--------------------------------------------------------------------------- using System; // Object using System.Collections.Generic; // List/// using System.Windows.Input; // AccessKeyManager using MS.Internal.PresentationCore; // SR using System.Windows.Automation.Provider; using System.Windows.Automation; using MS.Internal.Automation; namespace System.Windows.Automation.Peers { /// public class ContentElementAutomationPeer : AutomationPeer { /// public ContentElementAutomationPeer(ContentElement owner) { if (owner == null) { throw new ArgumentNullException("owner"); } _owner = owner; } /// public ContentElement Owner { get { return _owner; } } /// /// This static helper creates an AutomationPeer for the specified element and /// caches it - that means the created peer is going to live long and shadow the /// element for its lifetime. The peer will be used by Automation to proxy the element, and /// to fire events to the Automation when something happens with the element. /// The created peer is returned from this method and also from subsequent calls to this method /// and public static AutomationPeer CreatePeerForElement(ContentElement element) { if (element == null) { throw new ArgumentNullException("element"); } return element.CreateAutomationPeer(); } /// public static AutomationPeer FromElement(ContentElement element) { if (element == null) { throw new ArgumentNullException("element"); } return element.GetAutomationPeer(); } ///. The type of the peer is determined by the /// virtual callback. If FrameworkContentElement does not /// implement the callback, there will be no peer and this method will return 'null' (in other /// words, there is no such thing as a 'default peer'). /// /// override protected List/// GetChildrenCore() { return null; } /// override public object GetPattern(PatternInterface patternInterface) { //Support synchronized input if (patternInterface == PatternInterface.SynchronizedInput) { // Adaptor object is used here to avoid loading UIA assemblies in non-UIA scenarios. if (_synchronizedInputPattern == null) _synchronizedInputPattern = new SynchronizedInputAdaptor(_owner); return _synchronizedInputPattern; } return null; } /// /// protected override AutomationControlType GetAutomationControlTypeCore() { return AutomationControlType.Custom; } ////// /// protected override string GetAutomationIdCore() { return AutomationProperties.GetAutomationId(_owner); } ////// /// protected override string GetNameCore() { return AutomationProperties.GetName(_owner); } ////// /// protected override string GetHelpTextCore() { return AutomationProperties.GetHelpText(_owner); } ////// /// override protected Rect GetBoundingRectangleCore() { return Rect.Empty; } ////// /// override protected bool IsOffscreenCore() { return true; } ////// /// override protected AutomationOrientation GetOrientationCore() { return AutomationOrientation.None; } ////// /// override protected string GetItemTypeCore() { return string.Empty; } ////// /// override protected string GetClassNameCore() { return string.Empty; } ////// /// override protected string GetItemStatusCore() { return string.Empty; } ////// /// override protected bool IsRequiredForFormCore() { return false; } ////// /// override protected bool IsKeyboardFocusableCore() { return Keyboard.IsFocusable(_owner); } ////// /// override protected bool HasKeyboardFocusCore() { return _owner.IsKeyboardFocused; } ////// /// override protected bool IsEnabledCore() { return _owner.IsEnabled; } ////// /// override protected bool IsPasswordCore() { return false; } ////// /// override protected bool IsContentElementCore() { return true; } ////// /// override protected bool IsControlElementCore() { return false; } ////// /// override protected AutomationPeer GetLabeledByCore() { return null; } ////// /// override protected string GetAcceleratorKeyCore() { return string.Empty; } ////// /// override protected string GetAccessKeyCore() { return AccessKeyManager.InternalGetAccessKeyCharacter(_owner); } ////// /// override protected Point GetClickablePointCore() { return new Point(double.NaN, double.NaN); } ////// /// override protected void SetFocusCore() { if (!_owner.Focus()) throw new InvalidOperationException(SR.Get(SRID.SetFocusFailed)); } /// internal override Rect GetVisibleBoundingRectCore() { return GetBoundingRectangle(); } private ContentElement _owner; private SynchronizedInputAdaptor _synchronizedInputPattern; } } // 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
- StrokeCollection2.cs
- TraceListener.cs
- RadioButton.cs
- XPathNodeIterator.cs
- FixedSOMLineCollection.cs
- StrokeNodeData.cs
- AppModelKnownContentFactory.cs
- CellParagraph.cs
- DataServiceProcessingPipelineEventArgs.cs
- datacache.cs
- BaseValidator.cs
- MultilineStringEditor.cs
- CodeExpressionCollection.cs
- SplitterPanel.cs
- XmlChildNodes.cs
- XmlEncodedRawTextWriter.cs
- linebase.cs
- PackUriHelper.cs
- VerificationAttribute.cs
- ClientSideQueueItem.cs
- GeneralTransform3DTo2D.cs
- QueryContinueDragEventArgs.cs
- QueryOutputWriter.cs
- ToolBarTray.cs
- Property.cs
- DebugHandleTracker.cs
- Pair.cs
- RTTypeWrapper.cs
- TextLineResult.cs
- LayoutSettings.cs
- RepeaterItemEventArgs.cs
- ProcessManager.cs
- MatrixAnimationBase.cs
- ObjectListComponentEditor.cs
- PagesChangedEventArgs.cs
- SapiRecoInterop.cs
- HtmlToClrEventProxy.cs
- SimpleTextLine.cs
- DBDataPermissionAttribute.cs
- Predicate.cs
- ResourcesBuildProvider.cs
- UserControlParser.cs
- ClassData.cs
- SystemIcons.cs
- ScrollViewer.cs
- WindowsStatusBar.cs
- IMembershipProvider.cs
- NCryptSafeHandles.cs
- XmlElementAttribute.cs
- ProfileSettings.cs
- thaishape.cs
- HashHelper.cs
- DataGridViewCellValidatingEventArgs.cs
- PolicyUtility.cs
- ByteRangeDownloader.cs
- Aggregates.cs
- AxHost.cs
- WindowsAuthenticationModule.cs
- SimpleApplicationHost.cs
- KeyInstance.cs
- CompoundFileDeflateTransform.cs
- XmlSchemaComplexType.cs
- Soap12ProtocolReflector.cs
- ElementMarkupObject.cs
- MemoryStream.cs
- TcpHostedTransportConfiguration.cs
- ReadOnlyMetadataCollection.cs
- IPAddress.cs
- ConfigXmlAttribute.cs
- SafeFindHandle.cs
- OutputCacheSettings.cs
- PartialList.cs
- WindowsContainer.cs
- WindowsRegion.cs
- SmtpMail.cs
- List.cs
- PhonemeEventArgs.cs
- FloaterBaseParaClient.cs
- BitmapFrame.cs
- DataSvcMapFileSerializer.cs
- ContentType.cs
- _Semaphore.cs
- FixedSOMContainer.cs
- WaveHeader.cs
- Msec.cs
- PageThemeParser.cs
- _DomainName.cs
- TableProviderWrapper.cs
- ActivationServices.cs
- RegexReplacement.cs
- SqlDataSourceQueryEditorForm.cs
- Rect.cs
- DataGridCaption.cs
- TriggerAction.cs
- Pointer.cs
- TableRowGroupCollection.cs
- RecognizedPhrase.cs
- QuadraticBezierSegment.cs
- BindableTemplateBuilder.cs
- AdapterDictionary.cs