Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- ToolBarButton.cs
- ToolStripSettings.cs
- SQLByte.cs
- DataObjectPastingEventArgs.cs
- ExtensionDataObject.cs
- StylusPointProperty.cs
- ChannelTraceRecord.cs
- UdpConstants.cs
- Rijndael.cs
- InheritanceRules.cs
- FilterQuery.cs
- versioninfo.cs
- Mouse.cs
- VBIdentifierNameEditor.cs
- recordstatefactory.cs
- InstalledFontCollection.cs
- RegexGroup.cs
- QueryResultOp.cs
- IgnoreDataMemberAttribute.cs
- HMACSHA512.cs
- DataSetMappper.cs
- BCLDebug.cs
- ColorMap.cs
- Timeline.cs
- EnumerableValidator.cs
- ListViewDeleteEventArgs.cs
- EditCommandColumn.cs
- PickDesigner.xaml.cs
- QualifierSet.cs
- TimestampInformation.cs
- TextTreeDeleteContentUndoUnit.cs
- TextDecorationCollectionConverter.cs
- XPathSelfQuery.cs
- XmlChoiceIdentifierAttribute.cs
- XMLSyntaxException.cs
- SchemaNamespaceManager.cs
- sqlnorm.cs
- DataGridViewBand.cs
- ResourceContainer.cs
- BindStream.cs
- TemplateBamlRecordReader.cs
- RemoteWebConfigurationHostServer.cs
- NavigatorOutput.cs
- BindingWorker.cs
- StreamResourceInfo.cs
- ImageDrawing.cs
- DataObjectFieldAttribute.cs
- XPathMessageFilterElementCollection.cs
- NavigationProgressEventArgs.cs
- FloaterBaseParagraph.cs
- GridLengthConverter.cs
- SchemaDeclBase.cs
- TemplatePropertyEntry.cs
- ClientSettingsProvider.cs
- DescendantQuery.cs
- Thumb.cs
- BaseParagraph.cs
- TextElementAutomationPeer.cs
- AnalyzedTree.cs
- Matrix.cs
- HitTestParameters.cs
- Ref.cs
- DeadCharTextComposition.cs
- ComponentManagerBroker.cs
- HttpContext.cs
- LookupBindingPropertiesAttribute.cs
- AssemblySettingAttributes.cs
- DetailsView.cs
- UIElementParagraph.cs
- RelatedView.cs
- FileDialogCustomPlace.cs
- ScriptResourceAttribute.cs
- RequestCachingSection.cs
- WebPartMinimizeVerb.cs
- AsynchronousChannel.cs
- ClockController.cs
- ISFClipboardData.cs
- SmiRequestExecutor.cs
- NameTable.cs
- BaseTemplateBuildProvider.cs
- ThrowHelper.cs
- SearchForVirtualItemEventArgs.cs
- CroppedBitmap.cs
- XNodeValidator.cs
- Pen.cs
- Char.cs
- IItemContainerGenerator.cs
- DocobjHost.cs
- DataColumnCollection.cs
- TextParagraphCache.cs
- CodeVariableReferenceExpression.cs
- TypedTableHandler.cs
- SvcMapFile.cs
- OleAutBinder.cs
- X509AudioLogo.cs
- ProxyWebPart.cs
- TreeNodeCollection.cs
- MenuAdapter.cs
- DesignerGeometryHelper.cs
- PrimitiveSchema.cs