Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / UIAutomation / Win32Providers / MS / Internal / AutomationProxies / WindowsListViewGroupSubsetLink.cs / 1 / WindowsListViewGroupSubsetLink.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: Win32 ListViewGroupSubsetLink proxy // // //--------------------------------------------------------------------------- using System; using System.ComponentModel; using System.Windows.Automation; using System.Windows.Automation.Provider; using System.Runtime.InteropServices; using System.Windows; using MS.Win32; namespace MS.Internal.AutomationProxies { //----------------------------------------------------- // // ListViewGroupSubsetLink // //----------------------------------------------------- // Proxy for List view Group Subset Link class ListViewGroupSubsetLink: ProxySimple, IInvokeProvider { //------------------------------------------------------ // // Constructors // //----------------------------------------------------- #region Constructor internal ListViewGroupSubsetLink (IntPtr hwnd, ProxyFragment parent, int item, int groupId) : base(hwnd, parent, item) { _cControlType = ControlType.Button; _sAutomationId = "ListviewGroupSubsetLink" + groupId; // This string is a non-localizable string _groupId = groupId; _fIsKeyboardFocusable = true; } #endregion Constructor //------------------------------------------------------ // // Pattern Implementation // //------------------------------------------------------ #region ProxySimple Interface // Returns a pattern interface if supported. internal override object GetPatternProvider (AutomationPattern iid) { if (iid == InvokePattern.Pattern) { return this; } return null; } // Gets the bounding rectangle for this element internal unsafe override Rect BoundingRectangle { get { NativeMethods.Win32Rect rect = new NativeMethods.Win32Rect(); rect.top = NativeMethods.LVGGR_SUBSETLINK; XSendMessage.XSend(_hwnd, NativeMethods.LVM_GETGROUPRECT, new IntPtr(0), new IntPtr(&rect), Marshal.SizeOf(rect.GetType())); Misc.MapWindowPoints(_hwnd, IntPtr.Zero, ref rect, 2); return rect.ToRect(false); } } // Is focus set to the specified item protected override bool IsFocused () { NativeMethods.LVGROUP_V6 groupInfo = new NativeMethods.LVGROUP_V6(); groupInfo.Init(Marshal.SizeOf(typeof(NativeMethods.LVGROUP_V6))); groupInfo.iGroupID = _groupId; groupInfo.mask = NativeMethods.LVGF_STATE; groupInfo.stateMask = NativeMethods.LVGS_SUBSETLINKFOCUSED; // Note: return code of GetGroupInfo() is not reliable. XSendMessage.GetGroupInfo(_hwnd, ref groupInfo); // ignore return code. return (groupInfo.state & NativeMethods.LVGS_SUBSETLINKFOCUSED) != 0; } //Gets the localized name internal override string LocalizedName { get { NativeMethods.LVGROUP_V6 group = new NativeMethods.LVGROUP_V6(); group.Init(Marshal.SizeOf(typeof(NativeMethods.LVGROUP_V6))); group.iGroupID = _groupId; group.cchSubsetTitle= Misc.MaxLengthNameProperty; return XSendMessage.GetItemText(_hwnd, group, NativeMethods.LVGF_SUBSET); } } #endregion ProxySimple Interface #region Invoke Pattern void IInvokeProvider.Invoke () { NativeMethods.Win32Point pt; if (GetClickablePoint(out pt, false)) { Misc.MouseClick(pt.x, pt.y); } } #endregion Invoke Pattern //----------------------------------------------------- // // Private Fields // //------------------------------------------------------ #region Private Fields // The group id this link belongs to private int _groupId; #endregion Private Fields } } // 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. // // // // Description: Win32 ListViewGroupSubsetLink proxy // // //--------------------------------------------------------------------------- using System; using System.ComponentModel; using System.Windows.Automation; using System.Windows.Automation.Provider; using System.Runtime.InteropServices; using System.Windows; using MS.Win32; namespace MS.Internal.AutomationProxies { //----------------------------------------------------- // // ListViewGroupSubsetLink // //----------------------------------------------------- // Proxy for List view Group Subset Link class ListViewGroupSubsetLink: ProxySimple, IInvokeProvider { //------------------------------------------------------ // // Constructors // //----------------------------------------------------- #region Constructor internal ListViewGroupSubsetLink (IntPtr hwnd, ProxyFragment parent, int item, int groupId) : base(hwnd, parent, item) { _cControlType = ControlType.Button; _sAutomationId = "ListviewGroupSubsetLink" + groupId; // This string is a non-localizable string _groupId = groupId; _fIsKeyboardFocusable = true; } #endregion Constructor //------------------------------------------------------ // // Pattern Implementation // //------------------------------------------------------ #region ProxySimple Interface // Returns a pattern interface if supported. internal override object GetPatternProvider (AutomationPattern iid) { if (iid == InvokePattern.Pattern) { return this; } return null; } // Gets the bounding rectangle for this element internal unsafe override Rect BoundingRectangle { get { NativeMethods.Win32Rect rect = new NativeMethods.Win32Rect(); rect.top = NativeMethods.LVGGR_SUBSETLINK; XSendMessage.XSend(_hwnd, NativeMethods.LVM_GETGROUPRECT, new IntPtr(0), new IntPtr(&rect), Marshal.SizeOf(rect.GetType())); Misc.MapWindowPoints(_hwnd, IntPtr.Zero, ref rect, 2); return rect.ToRect(false); } } // Is focus set to the specified item protected override bool IsFocused () { NativeMethods.LVGROUP_V6 groupInfo = new NativeMethods.LVGROUP_V6(); groupInfo.Init(Marshal.SizeOf(typeof(NativeMethods.LVGROUP_V6))); groupInfo.iGroupID = _groupId; groupInfo.mask = NativeMethods.LVGF_STATE; groupInfo.stateMask = NativeMethods.LVGS_SUBSETLINKFOCUSED; // Note: return code of GetGroupInfo() is not reliable. XSendMessage.GetGroupInfo(_hwnd, ref groupInfo); // ignore return code. return (groupInfo.state & NativeMethods.LVGS_SUBSETLINKFOCUSED) != 0; } //Gets the localized name internal override string LocalizedName { get { NativeMethods.LVGROUP_V6 group = new NativeMethods.LVGROUP_V6(); group.Init(Marshal.SizeOf(typeof(NativeMethods.LVGROUP_V6))); group.iGroupID = _groupId; group.cchSubsetTitle= Misc.MaxLengthNameProperty; return XSendMessage.GetItemText(_hwnd, group, NativeMethods.LVGF_SUBSET); } } #endregion ProxySimple Interface #region Invoke Pattern void IInvokeProvider.Invoke () { NativeMethods.Win32Point pt; if (GetClickablePoint(out pt, false)) { Misc.MouseClick(pt.x, pt.y); } } #endregion Invoke Pattern //----------------------------------------------------- // // Private Fields // //------------------------------------------------------ #region Private Fields // The group id this link belongs to private int _groupId; #endregion Private Fields } } // 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
- ScriptRegistrationManager.cs
- RelOps.cs
- ServerValidateEventArgs.cs
- ResourceManagerWrapper.cs
- BindingMemberInfo.cs
- DbReferenceCollection.cs
- TraceHandlerErrorFormatter.cs
- UpWmlPageAdapter.cs
- MarginsConverter.cs
- DoubleCollection.cs
- ValueProviderWrapper.cs
- Deflater.cs
- OutputScope.cs
- Camera.cs
- TabControlEvent.cs
- EventManager.cs
- Function.cs
- XmlWriter.cs
- WeakReferenceEnumerator.cs
- RuntimeWrappedException.cs
- EventMemberCodeDomSerializer.cs
- ValueChangedEventManager.cs
- EraserBehavior.cs
- Translator.cs
- EncryptedType.cs
- GridViewUpdateEventArgs.cs
- DefaultBindingPropertyAttribute.cs
- MenuRenderer.cs
- listitem.cs
- Image.cs
- InputScopeConverter.cs
- SecondaryIndex.cs
- ClosableStream.cs
- CodeStatementCollection.cs
- GeometryDrawing.cs
- SortKey.cs
- DesignerCategoryAttribute.cs
- WebPartConnectionsCancelEventArgs.cs
- ActivityAction.cs
- LabelEditEvent.cs
- SqlCaseSimplifier.cs
- XPathAxisIterator.cs
- RoutedCommand.cs
- CompiledRegexRunnerFactory.cs
- Style.cs
- ActiveDocumentEvent.cs
- _NTAuthentication.cs
- Clock.cs
- StickyNoteAnnotations.cs
- IsolatedStorageFile.cs
- TransformConverter.cs
- OpenFileDialog.cs
- XmlDictionaryReader.cs
- InfiniteIntConverter.cs
- XmlSchemaValidationException.cs
- SchemaElementDecl.cs
- ReferencedAssembly.cs
- HandlerBase.cs
- SoapSchemaExporter.cs
- ControlUtil.cs
- HtmlButton.cs
- DrawingCollection.cs
- SqlNotificationEventArgs.cs
- SwitchAttribute.cs
- ComplexBindingPropertiesAttribute.cs
- GenericWebPart.cs
- LogRestartAreaEnumerator.cs
- XmlElementList.cs
- PageRequestManager.cs
- DataGridCommandEventArgs.cs
- IsolatedStorageFile.cs
- PropertyGeneratedEventArgs.cs
- ActivityCollectionMarkupSerializer.cs
- DbConnectionFactory.cs
- PassportAuthenticationEventArgs.cs
- ValueUnavailableException.cs
- StackSpiller.Generated.cs
- URLAttribute.cs
- TableLayoutSettings.cs
- SmiEventStream.cs
- SecurityAlgorithmSuite.cs
- MenuCommands.cs
- VirtualizingPanel.cs
- RootBuilder.cs
- EndpointDiscoveryElement.cs
- ListBoxChrome.cs
- PingOptions.cs
- WebPartAddingEventArgs.cs
- DataGridViewCellLinkedList.cs
- WebBrowser.cs
- DeclarativeCatalogPartDesigner.cs
- Socket.cs
- AsyncStreamReader.cs
- XMLUtil.cs
- XPathExpr.cs
- XmlSerializerAssemblyAttribute.cs
- MailAddress.cs
- ImmutableObjectAttribute.cs
- ArrangedElementCollection.cs
- SystemColors.cs