Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Automation / Peers / HyperlinkAutomationPeer.cs / 1305600 / HyperlinkAutomationPeer.cs
//---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // // File: HyperlinkAutomationPeer.cs // // Description: Automation peer for hyperlink // //--------------------------------------------------------------------------- using System.Windows.Automation.Provider; // IRawElementProviderSimple using System.Windows.Documents; namespace System.Windows.Automation.Peers { /// public class HyperlinkAutomationPeer : TextElementAutomationPeer, IInvokeProvider { /// public HyperlinkAutomationPeer(Hyperlink owner) : base(owner) { } ////// /// /// ///public override object GetPattern(PatternInterface patternInterface) { if (patternInterface == PatternInterface.Invoke) { return this; } else { return base.GetPattern(patternInterface); } } //Default Automation properties /// protected override AutomationControlType GetAutomationControlTypeCore() { return AutomationControlType.Hyperlink; } /// /// /// protected override string GetNameCore() { string name = base.GetNameCore(); if (name == string.Empty) { Hyperlink owner = (Hyperlink)Owner; name = owner.Text; if (name == null) name = string.Empty; } return name; } /// override protected string GetClassNameCore() { return "Hyperlink"; } ////// override protected bool IsControlElementCore() { return true; } //Invoke Pattern implementation void IInvokeProvider.Invoke() { if (!IsEnabled()) throw new ElementNotEnabledException(); Hyperlink owner = (Hyperlink)Owner; owner.DoClick(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // Copyright (C) Microsoft Corporation. All rights reserved. // // File: HyperlinkAutomationPeer.cs // // Description: Automation peer for hyperlink // //--------------------------------------------------------------------------- using System.Windows.Automation.Provider; // IRawElementProviderSimple using System.Windows.Documents; namespace System.Windows.Automation.Peers { /// public class HyperlinkAutomationPeer : TextElementAutomationPeer, IInvokeProvider { /// public HyperlinkAutomationPeer(Hyperlink owner) : base(owner) { } ////// /// /// /// ///public override object GetPattern(PatternInterface patternInterface) { if (patternInterface == PatternInterface.Invoke) { return this; } else { return base.GetPattern(patternInterface); } } //Default Automation properties /// protected override AutomationControlType GetAutomationControlTypeCore() { return AutomationControlType.Hyperlink; } /// /// /// protected override string GetNameCore() { string name = base.GetNameCore(); if (name == string.Empty) { Hyperlink owner = (Hyperlink)Owner; name = owner.Text; if (name == null) name = string.Empty; } return name; } /// override protected string GetClassNameCore() { return "Hyperlink"; } ////// override protected bool IsControlElementCore() { return true; } //Invoke Pattern implementation void IInvokeProvider.Invoke() { if (!IsEnabled()) throw new ElementNotEnabledException(); Hyperlink owner = (Hyperlink)Owner; owner.DoClick(); } } } // 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
- Vector3DKeyFrameCollection.cs
- XmlTextReaderImpl.cs
- SqlCacheDependency.cs
- CreatingCookieEventArgs.cs
- WSFederationHttpSecurity.cs
- BitmapEncoder.cs
- CachedFontFamily.cs
- OleDbConnectionInternal.cs
- XamlInt32CollectionSerializer.cs
- RemotingConfigParser.cs
- DataObject.cs
- ObjectContextServiceProvider.cs
- WebHeaderCollection.cs
- PersianCalendar.cs
- FixedSOMElement.cs
- ConsoleKeyInfo.cs
- XmlSerializerFactory.cs
- PieceDirectory.cs
- UrlMapping.cs
- sqlcontext.cs
- XdrBuilder.cs
- TaiwanLunisolarCalendar.cs
- RequestQueue.cs
- DateTimeOffset.cs
- NTAccount.cs
- FormsAuthenticationUser.cs
- SqlTrackingQuery.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- ItemsControl.cs
- RequestTimeoutManager.cs
- ToolStrip.cs
- IncrementalCompileAnalyzer.cs
- CannotUnloadAppDomainException.cs
- DataServiceQueryException.cs
- Policy.cs
- DataServiceRequest.cs
- DataGridCellEditEndingEventArgs.cs
- MessagePropertyFilter.cs
- BinaryFormatter.cs
- QilStrConcatenator.cs
- LiteralControl.cs
- NotifyIcon.cs
- SerializationHelper.cs
- _StreamFramer.cs
- TextTreePropertyUndoUnit.cs
- VScrollBar.cs
- SByteConverter.cs
- DataGridViewToolTip.cs
- ServicePointManager.cs
- WindowsListViewItem.cs
- TypeNameHelper.cs
- ObjectPersistData.cs
- cookie.cs
- thaishape.cs
- GeometryValueSerializer.cs
- DataGridViewHitTestInfo.cs
- IteratorFilter.cs
- TracingConnectionInitiator.cs
- BezierSegment.cs
- BodyGlyph.cs
- EncoderFallback.cs
- SmtpMail.cs
- InputDevice.cs
- StateDesigner.LayoutSelectionGlyph.cs
- FactoryGenerator.cs
- AdRotatorDesigner.cs
- KeyboardDevice.cs
- MarkedHighlightComponent.cs
- EdgeModeValidation.cs
- SchemaComplexType.cs
- PenThreadPool.cs
- webeventbuffer.cs
- CodeDefaultValueExpression.cs
- HttpWriter.cs
- PeerEndPoint.cs
- MonitorWrapper.cs
- ServiceOperationWrapper.cs
- XsdDuration.cs
- MouseButtonEventArgs.cs
- DataGridTableCollection.cs
- AddToCollection.cs
- PropertyGridView.cs
- OdbcDataReader.cs
- PerfService.cs
- _AutoWebProxyScriptEngine.cs
- PolygonHotSpot.cs
- CommandTreeTypeHelper.cs
- OrderByQueryOptionExpression.cs
- DesignerActionList.cs
- BatchWriter.cs
- StyleXamlTreeBuilder.cs
- RectAnimationClockResource.cs
- OdbcEnvironmentHandle.cs
- RightsManagementPermission.cs
- SamlAuthenticationStatement.cs
- TextTreeText.cs
- _Connection.cs
- XmlSchemaSimpleContentRestriction.cs
- CorruptingExceptionCommon.cs
- DataViewSettingCollection.cs