Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Framework / System / Windows / Automation / Peers / ExpanderAutomationPeer.cs / 1 / ExpanderAutomationPeer.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 ExpanderAutomationPeer : FrameworkElementAutomationPeer, IExpandCollapseProvider { /// public ExpanderAutomationPeer(Expander owner): base(owner) {} /// override protected string GetClassNameCore() { return "Expander"; } /// override protected AutomationControlType GetAutomationControlTypeCore() { return AutomationControlType.Group; } /// override public object GetPattern(PatternInterface pattern) { object iface = null; if(pattern == PatternInterface.ExpandCollapse) { iface = this; } else { iface = base.GetPattern(pattern); } return iface; } #region ExpandCollapse ////// Blocking method that returns after the element has been expanded. /// ///true if the node was successfully expanded void IExpandCollapseProvider.Expand() { if (!IsEnabled()) throw new ElementNotEnabledException(); Expander owner = (Expander)((ExpanderAutomationPeer)this).Owner; owner.IsExpanded = true; } ////// Blocking method that returns after the element has been collapsed. /// ///true if the node was successfully collapsed void IExpandCollapseProvider.Collapse() { if (!IsEnabled()) throw new ElementNotEnabledException(); Expander owner = (Expander)((ExpanderAutomationPeer)this).Owner; owner.IsExpanded = false; } ///indicates an element's current Collapsed or Expanded state ExpandCollapseState IExpandCollapseProvider.ExpandCollapseState { get { Expander owner = (Expander)((ExpanderAutomationPeer)this).Owner; return owner.IsExpanded ? ExpandCollapseState.Expanded : ExpandCollapseState.Collapsed; } } // [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] internal void RaiseExpandCollapseAutomationEvent(bool oldValue, bool newValue) { RaisePropertyChangedEvent( ExpandCollapsePatternIdentifiers.ExpandCollapseStateProperty, oldValue ? ExpandCollapseState.Expanded : ExpandCollapseState.Collapsed, newValue ? ExpandCollapseState.Expanded : ExpandCollapseState.Collapsed); } #endregion ExpandCollapse } } // 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
- SoapClientProtocol.cs
- ValidationError.cs
- EnumerableRowCollection.cs
- MorphHelpers.cs
- GlobalizationSection.cs
- _SslState.cs
- GlobalizationSection.cs
- LocalizableAttribute.cs
- HttpRuntime.cs
- ImageCodecInfo.cs
- xamlnodes.cs
- GradientStopCollection.cs
- XmlWellformedWriter.cs
- ResourceSet.cs
- CatalogPart.cs
- srgsitem.cs
- ReadOnlyDataSourceView.cs
- PairComparer.cs
- ErrorFormatterPage.cs
- BufferedOutputStream.cs
- CheckBox.cs
- Win32SafeHandles.cs
- UnauthorizedAccessException.cs
- TemplateParser.cs
- DataGridColumnHeaderAutomationPeer.cs
- LineServicesRun.cs
- XmlSchemaSet.cs
- OleDbParameter.cs
- ListViewItemMouseHoverEvent.cs
- Baml2006ReaderContext.cs
- MetadataItem.cs
- ToolStripSplitButton.cs
- HostProtectionException.cs
- XmlHierarchicalDataSourceView.cs
- DivideByZeroException.cs
- Rotation3DAnimation.cs
- TransformedBitmap.cs
- BinHexEncoder.cs
- SiteMapSection.cs
- DataSourceProvider.cs
- XmlSchemaDocumentation.cs
- UIPermission.cs
- NavigationFailedEventArgs.cs
- AbandonedMutexException.cs
- RequestBringIntoViewEventArgs.cs
- ValueProviderWrapper.cs
- CompositeScriptReference.cs
- SuppressMessageAttribute.cs
- ToolZone.cs
- InheritedPropertyChangedEventArgs.cs
- MouseEvent.cs
- DiscoveryClientOutputChannel.cs
- WebPartsSection.cs
- TemplatedMailWebEventProvider.cs
- SynchronousReceiveBehavior.cs
- StickyNoteHelper.cs
- ProfessionalColorTable.cs
- SafeEventLogReadHandle.cs
- Lease.cs
- DocumentXPathNavigator.cs
- DataControlFieldCollection.cs
- ConfigurationSettings.cs
- GraphicsContainer.cs
- WhiteSpaceTrimStringConverter.cs
- XmlSchemaCollection.cs
- RadioButtonPopupAdapter.cs
- IsolatedStorageFile.cs
- XmlAggregates.cs
- SspiWrapper.cs
- SafeEventHandle.cs
- LinqToSqlWrapper.cs
- WinFormsUtils.cs
- UIElement3D.cs
- KeySplineConverter.cs
- IisTraceListener.cs
- Rule.cs
- SelectionItemPattern.cs
- UriTemplateClientFormatter.cs
- DataTable.cs
- Tablet.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- TableCellAutomationPeer.cs
- MobileControlBuilder.cs
- SqlPersonalizationProvider.cs
- CodeTypeDeclarationCollection.cs
- TextBoxDesigner.cs
- Timer.cs
- IISMapPath.cs
- MdiWindowListStrip.cs
- MatrixTransform3D.cs
- Image.cs
- ComponentFactoryHelpers.cs
- ContentPropertyAttribute.cs
- JoinSymbol.cs
- ScriptingProfileServiceSection.cs
- AddressAlreadyInUseException.cs
- NumericUpDownAccelerationCollection.cs
- TableLayoutRowStyleCollection.cs
- _AutoWebProxyScriptEngine.cs
- ClientConfigurationSystem.cs