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
- Pkcs7Signer.cs
- IgnoreDeviceFilterElementCollection.cs
- JsonDeserializer.cs
- HostnameComparisonMode.cs
- EventLogger.cs
- XsdBuilder.cs
- DecimalAnimation.cs
- Convert.cs
- TdsParserStateObject.cs
- BinaryEditor.cs
- HttpCachePolicy.cs
- TextBoxAutoCompleteSourceConverter.cs
- SQLSingleStorage.cs
- OdbcConnectionFactory.cs
- ToolStripSystemRenderer.cs
- DataPointer.cs
- ToolboxItemFilterAttribute.cs
- ConfigsHelper.cs
- __Filters.cs
- ValidationPropertyAttribute.cs
- RolePrincipal.cs
- TransactedBatchingBehavior.cs
- DefaultValueTypeConverter.cs
- CodeAttributeArgument.cs
- SafeWaitHandle.cs
- GcSettings.cs
- ListItemCollection.cs
- MasterPage.cs
- MarshalDirectiveException.cs
- Stacktrace.cs
- _ChunkParse.cs
- FormsAuthenticationUserCollection.cs
- TimeSpanValidatorAttribute.cs
- DataPager.cs
- TreeNodeStyleCollectionEditor.cs
- MailHeaderInfo.cs
- XmlSchemaAttributeGroupRef.cs
- CodeDomDesignerLoader.cs
- VectorValueSerializer.cs
- SHA256Managed.cs
- SplitterEvent.cs
- ResourceSetExpression.cs
- ScaleTransform3D.cs
- CodeSnippetCompileUnit.cs
- SqlTypesSchemaImporter.cs
- DataSourceHelper.cs
- DiscoveryClientProtocol.cs
- BindingCollection.cs
- CalendarDay.cs
- WebScriptMetadataMessageEncoderFactory.cs
- PropertiesTab.cs
- SqlClientPermission.cs
- DateTime.cs
- Pair.cs
- InfoCard.cs
- NamedPipeHostedTransportConfiguration.cs
- StickyNote.cs
- CryptoStream.cs
- RequestCache.cs
- InputLanguageManager.cs
- BuilderInfo.cs
- bidPrivateBase.cs
- RepeaterCommandEventArgs.cs
- StrokeCollectionConverter.cs
- SourceItem.cs
- PasswordTextContainer.cs
- RandomNumberGenerator.cs
- ManagementOptions.cs
- Knowncolors.cs
- ConnectionPoolRegistry.cs
- GridItemProviderWrapper.cs
- ListSourceHelper.cs
- PatternMatcher.cs
- SqlDataSourceCommandEventArgs.cs
- CounterNameConverter.cs
- ChtmlCommandAdapter.cs
- ValidationSummary.cs
- StringConverter.cs
- WebPartsSection.cs
- StylusLogic.cs
- Attributes.cs
- RoleGroup.cs
- TraceShell.cs
- ActionFrame.cs
- PropertyGrid.cs
- SourceSwitch.cs
- EndOfStreamException.cs
- CustomLineCap.cs
- EntityContainerEmitter.cs
- BindingListCollectionView.cs
- CompositeFontParser.cs
- Highlights.cs
- SiteMapNode.cs
- ListItemParagraph.cs
- WindowsAuthenticationEventArgs.cs
- MsmqUri.cs
- XPathNavigator.cs
- StreamReader.cs
- ModelItem.cs
- FtpWebRequest.cs