Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / UIAutomation / Win32Providers / MS / Internal / AutomationProxies / WindowsListViewGroupSubsetLink.cs / 1305600 / 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
- SqlServices.cs
- BStrWrapper.cs
- VBCodeProvider.cs
- FormatSettings.cs
- webbrowsersite.cs
- WindowsScrollBarBits.cs
- ComponentChangingEvent.cs
- GeneralTransform3DCollection.cs
- MonitorWrapper.cs
- GeneratedCodeAttribute.cs
- RunWorkerCompletedEventArgs.cs
- ExpressionEditorAttribute.cs
- GlyphRunDrawing.cs
- IRCollection.cs
- AmbiguousMatchException.cs
- ProxyWebPartConnectionCollection.cs
- SQLDecimal.cs
- _BaseOverlappedAsyncResult.cs
- SimpleMailWebEventProvider.cs
- UnsafeMethods.cs
- KeyValueSerializer.cs
- SafeArrayRankMismatchException.cs
- WindowsStatic.cs
- BamlTreeNode.cs
- ErrorWrapper.cs
- MgmtResManager.cs
- RayMeshGeometry3DHitTestResult.cs
- DecimalStorage.cs
- ByteStorage.cs
- MediaEntryAttribute.cs
- MenuItemBinding.cs
- DBDataPermission.cs
- WorkflowEnvironment.cs
- ToolStripCollectionEditor.cs
- SecurityKeyIdentifier.cs
- CodeDefaultValueExpression.cs
- GeometryHitTestResult.cs
- PerformanceCounterTraceRecord.cs
- LayoutSettings.cs
- InputLangChangeEvent.cs
- InsufficientExecutionStackException.cs
- FixedDocumentPaginator.cs
- OrderedDictionaryStateHelper.cs
- IteratorDescriptor.cs
- RectAnimation.cs
- DXD.cs
- DocumentViewerHelper.cs
- RightsManagementPermission.cs
- OlePropertyStructs.cs
- _HTTPDateParse.cs
- SpellerStatusTable.cs
- ToolStripSystemRenderer.cs
- TreeChangeInfo.cs
- FileRecordSequenceHelper.cs
- ResourceIDHelper.cs
- BufferedReadStream.cs
- IndexedDataBuffer.cs
- RowVisual.cs
- RequestCachePolicy.cs
- Win32MouseDevice.cs
- DataGridBoolColumn.cs
- PeerNameRecord.cs
- Rotation3DAnimationBase.cs
- CollectionViewProxy.cs
- PageBuildProvider.cs
- RSACryptoServiceProvider.cs
- EntryWrittenEventArgs.cs
- ToolbarAUtomationPeer.cs
- NotifyInputEventArgs.cs
- DynamicResourceExtensionConverter.cs
- LabelEditEvent.cs
- BasicAsyncResult.cs
- Pair.cs
- FixedStringLookup.cs
- Normalization.cs
- NavigationPropertyEmitter.cs
- SatelliteContractVersionAttribute.cs
- CallSiteHelpers.cs
- WbemException.cs
- CommentAction.cs
- DataSpaceManager.cs
- TdsRecordBufferSetter.cs
- dsa.cs
- NameValueSectionHandler.cs
- StateItem.cs
- ResolveNextArgumentWorkItem.cs
- TextBreakpoint.cs
- HostedHttpTransportManager.cs
- ProcessHostMapPath.cs
- HtmlGenericControl.cs
- UTF7Encoding.cs
- WebPartCatalogCloseVerb.cs
- RequestResizeEvent.cs
- ObjectDataProvider.cs
- PathGradientBrush.cs
- HttpGetProtocolReflector.cs
- SqlMethodAttribute.cs
- TraceData.cs
- SiteMapNodeItem.cs
- IProducerConsumerCollection.cs