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 / GridViewColumnHeaderAutomationPeer.cs / 1 / GridViewColumnHeaderAutomationPeer.cs
using System; using System.Collections; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Security; using System.Text; using System.Windows; using System.Windows.Automation.Provider; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Interop; using System.Windows.Media; using MS.Internal; using MS.Win32; namespace System.Windows.Automation.Peers { /// public class GridViewColumnHeaderAutomationPeer : FrameworkElementAutomationPeer, IInvokeProvider, ITransformProvider { /// public GridViewColumnHeaderAutomationPeer(GridViewColumnHeader owner) : base(owner) { } /// override protected AutomationControlType GetAutomationControlTypeCore() { return AutomationControlType.HeaderItem; } /// override protected string GetClassNameCore() { return "GridViewColumnHeader"; } /// override public object GetPattern(PatternInterface patternInterface) { if (patternInterface == PatternInterface.Invoke || patternInterface == PatternInterface.Transform) return this; return null; } void IInvokeProvider.Invoke() { if (!IsEnabled()) throw new ElementNotEnabledException(); GridViewColumnHeader owner = (GridViewColumnHeader)Owner; owner.AutomationClick(); } #region ITransformProvider bool ITransformProvider.CanMove { get { return false; } } //Note: CanResize can be false if Max/MinWidth,Height has been added on GridViewColumn/ColumnHeader bool ITransformProvider.CanResize { get { return true; } } bool ITransformProvider.CanRotate { get { return false; } } //Note: Don't support Move so far, if users do need this feature to reorder columns, //we can consider to add it later. (One concern is GVCH doesn't support reorder by moving itself) void ITransformProvider.Move(double x, double y) { throw new InvalidOperationException(SR.Get(SRID.UIA_OperationCannotBePerformed)); } void ITransformProvider.Resize(double width, double height) { if (!IsEnabled()) throw new ElementNotEnabledException(); if (width < 0) { throw new ArgumentOutOfRangeException("width"); } if (height < 0) { throw new ArgumentOutOfRangeException("height"); } GridViewColumnHeader header = Owner as GridViewColumnHeader; if (header != null) { if (header.Column != null) { header.Column.Width = width; } header.Height = height; } } void ITransformProvider.Rotate(double degrees) { throw new InvalidOperationException(SR.Get(SRID.UIA_OperationCannotBePerformed)); } #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; using System.Collections; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Security; using System.Text; using System.Windows; using System.Windows.Automation.Provider; using System.Windows.Controls; using System.Windows.Controls.Primitives; using System.Windows.Interop; using System.Windows.Media; using MS.Internal; using MS.Win32; namespace System.Windows.Automation.Peers { /// public class GridViewColumnHeaderAutomationPeer : FrameworkElementAutomationPeer, IInvokeProvider, ITransformProvider { /// public GridViewColumnHeaderAutomationPeer(GridViewColumnHeader owner) : base(owner) { } /// override protected AutomationControlType GetAutomationControlTypeCore() { return AutomationControlType.HeaderItem; } /// override protected string GetClassNameCore() { return "GridViewColumnHeader"; } /// override public object GetPattern(PatternInterface patternInterface) { if (patternInterface == PatternInterface.Invoke || patternInterface == PatternInterface.Transform) return this; return null; } void IInvokeProvider.Invoke() { if (!IsEnabled()) throw new ElementNotEnabledException(); GridViewColumnHeader owner = (GridViewColumnHeader)Owner; owner.AutomationClick(); } #region ITransformProvider bool ITransformProvider.CanMove { get { return false; } } //Note: CanResize can be false if Max/MinWidth,Height has been added on GridViewColumn/ColumnHeader bool ITransformProvider.CanResize { get { return true; } } bool ITransformProvider.CanRotate { get { return false; } } //Note: Don't support Move so far, if users do need this feature to reorder columns, //we can consider to add it later. (One concern is GVCH doesn't support reorder by moving itself) void ITransformProvider.Move(double x, double y) { throw new InvalidOperationException(SR.Get(SRID.UIA_OperationCannotBePerformed)); } void ITransformProvider.Resize(double width, double height) { if (!IsEnabled()) throw new ElementNotEnabledException(); if (width < 0) { throw new ArgumentOutOfRangeException("width"); } if (height < 0) { throw new ArgumentOutOfRangeException("height"); } GridViewColumnHeader header = Owner as GridViewColumnHeader; if (header != null) { if (header.Column != null) { header.Column.Width = width; } header.Height = height; } } void ITransformProvider.Rotate(double degrees) { throw new InvalidOperationException(SR.Get(SRID.UIA_OperationCannotBePerformed)); } #endregion } } // 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
- EntityDataSourceWrapper.cs
- DetailsViewModeEventArgs.cs
- sqlpipe.cs
- Typography.cs
- SqlClientMetaDataCollectionNames.cs
- InputDevice.cs
- EndpointNameMessageFilter.cs
- XamlPoint3DCollectionSerializer.cs
- iisPickupDirectory.cs
- WebPartCancelEventArgs.cs
- ConsoleKeyInfo.cs
- ObjectStateEntryDbDataRecord.cs
- SafeEventLogReadHandle.cs
- UpdateTranslator.cs
- MsmqIntegrationOutputChannel.cs
- PropertyEmitter.cs
- MultiTrigger.cs
- CodePageUtils.cs
- HttpModule.cs
- DiagnosticSection.cs
- SQLDoubleStorage.cs
- HighlightVisual.cs
- DataGridViewMethods.cs
- DesignerCalendarAdapter.cs
- GridViewEditEventArgs.cs
- HtmlInputControl.cs
- AsymmetricAlgorithm.cs
- GradientStopCollection.cs
- ConnectorEditor.cs
- DesignerTransactionCloseEvent.cs
- DataGridRow.cs
- TraceLevelHelper.cs
- CustomDictionarySources.cs
- wmiutil.cs
- IUnknownConstantAttribute.cs
- TextServicesDisplayAttribute.cs
- TabItem.cs
- ReadOnlyDictionary.cs
- SqlException.cs
- StylusPointPropertyInfoDefaults.cs
- XmlStreamNodeWriter.cs
- Model3D.cs
- XmlSchemaSearchPattern.cs
- SqlCommand.cs
- DefaultWorkflowTransactionService.cs
- OracleConnectionStringBuilder.cs
- Effect.cs
- AsnEncodedData.cs
- DataGridViewCellCollection.cs
- DesignConnection.cs
- FontNamesConverter.cs
- QilStrConcat.cs
- SoapIgnoreAttribute.cs
- ProxySimple.cs
- IntegerValidator.cs
- DataViewManagerListItemTypeDescriptor.cs
- Primitive.cs
- TreeNodeBindingCollection.cs
- UnknownBitmapDecoder.cs
- IsolationInterop.cs
- SqlExpander.cs
- DefaultClaimSet.cs
- JoinGraph.cs
- HintTextMaxWidthConverter.cs
- WSSecurityOneDotOneReceiveSecurityHeader.cs
- ContentOperations.cs
- CookielessHelper.cs
- JoinQueryOperator.cs
- FormView.cs
- OutputCacheModule.cs
- ImpersonationContext.cs
- FontUnitConverter.cs
- RightNameExpirationInfoPair.cs
- ListViewCancelEventArgs.cs
- UIAgentMonitor.cs
- BaseServiceProvider.cs
- CorrelationManager.cs
- PhysicalFontFamily.cs
- FlagsAttribute.cs
- ContextMenuStripActionList.cs
- TemplatePropertyEntry.cs
- WindowsTokenRoleProvider.cs
- TagNameToTypeMapper.cs
- PropertyGrid.cs
- DataGridViewHeaderCell.cs
- Array.cs
- HtmlShim.cs
- CompiledQueryCacheKey.cs
- Comparer.cs
- SelectorAutomationPeer.cs
- GraphicsContainer.cs
- DebugTrace.cs
- LineUtil.cs
- OdbcErrorCollection.cs
- SiteMapNode.cs
- FlatButtonAppearance.cs
- MultipleViewPattern.cs
- Animatable.cs
- KnownIds.cs
- MergablePropertyAttribute.cs