Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Framework / System / Windows / Automation / Peers / HyperlinkAutomationPeer.cs / 1 / 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; } return null; } //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; } return null; } //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
- StreamGeometry.cs
- XPathMessageFilterElement.cs
- ProcessModuleCollection.cs
- ContentFileHelper.cs
- SelectorAutomationPeer.cs
- Repeater.cs
- HandleCollector.cs
- ClientApiGenerator.cs
- OpCellTreeNode.cs
- TypeContext.cs
- SrgsToken.cs
- TypeDefinition.cs
- SafeHandle.cs
- BitmapData.cs
- SocketInformation.cs
- XmlBinaryReader.cs
- CodeMemberProperty.cs
- AsmxEndpointPickerExtension.cs
- CellParagraph.cs
- HttpProtocolReflector.cs
- XmlAttributes.cs
- ISCIIEncoding.cs
- RepeaterItem.cs
- Collection.cs
- StrongNamePublicKeyBlob.cs
- ReferentialConstraintRoleElement.cs
- UITypeEditor.cs
- AccessDataSource.cs
- XmlSchemaSimpleContent.cs
- FrameAutomationPeer.cs
- WindowsListViewItemStartMenu.cs
- ExceptionUtil.cs
- SubstitutionList.cs
- ButtonColumn.cs
- ButtonChrome.cs
- RelOps.cs
- RelatedPropertyManager.cs
- VersionedStreamOwner.cs
- MediaElementAutomationPeer.cs
- XmlSchemaAny.cs
- TryExpression.cs
- ArgumentValidation.cs
- StylusButtonCollection.cs
- PermissionSetEnumerator.cs
- ConnectionPoint.cs
- LiteralTextParser.cs
- StringBuilder.cs
- CatalogZoneAutoFormat.cs
- Rotation3DAnimationBase.cs
- EmptyEnumerator.cs
- ColorAnimationBase.cs
- RectAnimationBase.cs
- SqlReferenceCollection.cs
- ToolStripDropDown.cs
- StreamReader.cs
- SettingsProviderCollection.cs
- ACE.cs
- SqlWorkflowInstanceStore.cs
- ArrangedElementCollection.cs
- Helper.cs
- ClickablePoint.cs
- COM2ColorConverter.cs
- Int32Converter.cs
- FilterRepeater.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- DoubleCollection.cs
- PolyQuadraticBezierSegment.cs
- BlurBitmapEffect.cs
- ThemeInfoAttribute.cs
- LastQueryOperator.cs
- Interlocked.cs
- SelectionWordBreaker.cs
- ListViewGroupItemCollection.cs
- DataRecord.cs
- FatalException.cs
- TrackingMemoryStream.cs
- SecurityTokenValidationException.cs
- IDispatchConstantAttribute.cs
- Label.cs
- WebEventCodes.cs
- HttpFileCollection.cs
- UIPropertyMetadata.cs
- ResourcePool.cs
- metadatamappinghashervisitor.cs
- Base64Stream.cs
- ProxyAttribute.cs
- ToolStripSplitButton.cs
- SystemShuttingDownException.cs
- ParserContext.cs
- TypeSystemHelpers.cs
- XmlTypeAttribute.cs
- DeclaredTypeElementCollection.cs
- ConfigurationException.cs
- StringArrayConverter.cs
- ThreadStateException.cs
- AuthenticationModulesSection.cs
- SeekStoryboard.cs
- AdPostCacheSubstitution.cs
- RequestCachePolicy.cs
- XPathQilFactory.cs