Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Core / CSharp / System / Windows / Input / FocusChangedEventArgs.cs / 1 / FocusChangedEventArgs.cs
using System; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows.Input { ////// The KeyboardFocusChangedEventArgs class contains information about key states. /// public class KeyboardFocusChangedEventArgs : KeyboardEventArgs { ////// Constructs an instance of the KeyboardFocusChangedEventArgs class. /// /// /// The logical keyboard device associated with this event. /// /// /// The time when the input occured. /// /// /// The element that previously had focus. /// /// /// The element that now has focus. /// public KeyboardFocusChangedEventArgs(KeyboardDevice keyboard, int timestamp, IInputElement oldFocus, IInputElement newFocus) : base(keyboard, timestamp) { if (oldFocus != null && !InputElement.IsValid(oldFocus)) throw new InvalidOperationException(SR.Get(SRID.Invalid_IInputElement, oldFocus.GetType())); if (newFocus != null && !InputElement.IsValid(newFocus)) throw new InvalidOperationException(SR.Get(SRID.Invalid_IInputElement, newFocus.GetType())); _oldFocus = oldFocus; _newFocus = newFocus; } ////// The element that previously had focus. /// public IInputElement OldFocus { get {return _oldFocus;} } ////// The element that now has focus. /// public IInputElement NewFocus { get {return _newFocus;} } ////// The mechanism used to call the type-specific handler on the /// target. /// /// /// The generic handler to call in a type-specific way. /// /// /// The target to call the handler on. /// protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget) { KeyboardFocusChangedEventHandler handler = (KeyboardFocusChangedEventHandler) genericHandler; handler(genericTarget, this); } private IInputElement _oldFocus; private IInputElement _newFocus; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows.Input { ////// The KeyboardFocusChangedEventArgs class contains information about key states. /// public class KeyboardFocusChangedEventArgs : KeyboardEventArgs { ////// Constructs an instance of the KeyboardFocusChangedEventArgs class. /// /// /// The logical keyboard device associated with this event. /// /// /// The time when the input occured. /// /// /// The element that previously had focus. /// /// /// The element that now has focus. /// public KeyboardFocusChangedEventArgs(KeyboardDevice keyboard, int timestamp, IInputElement oldFocus, IInputElement newFocus) : base(keyboard, timestamp) { if (oldFocus != null && !InputElement.IsValid(oldFocus)) throw new InvalidOperationException(SR.Get(SRID.Invalid_IInputElement, oldFocus.GetType())); if (newFocus != null && !InputElement.IsValid(newFocus)) throw new InvalidOperationException(SR.Get(SRID.Invalid_IInputElement, newFocus.GetType())); _oldFocus = oldFocus; _newFocus = newFocus; } ////// The element that previously had focus. /// public IInputElement OldFocus { get {return _oldFocus;} } ////// The element that now has focus. /// public IInputElement NewFocus { get {return _newFocus;} } ////// The mechanism used to call the type-specific handler on the /// target. /// /// /// The generic handler to call in a type-specific way. /// /// /// The target to call the handler on. /// protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget) { KeyboardFocusChangedEventHandler handler = (KeyboardFocusChangedEventHandler) genericHandler; handler(genericTarget, this); } private IInputElement _oldFocus; private IInputElement _newFocus; } } // 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
- AccessDataSourceView.cs
- ContextMenuStrip.cs
- InputScope.cs
- InteropAutomationProvider.cs
- SafeEventLogWriteHandle.cs
- StrongNamePublicKeyBlob.cs
- CompilationRelaxations.cs
- TreeNodeBindingCollection.cs
- Trace.cs
- MessageQueue.cs
- NotificationContext.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- PasswordBoxAutomationPeer.cs
- JsonQueryStringConverter.cs
- ListQueryResults.cs
- PathGeometry.cs
- XmlMapping.cs
- OutKeywords.cs
- FaultBookmark.cs
- HtmlToClrEventProxy.cs
- PeerNearMe.cs
- DataTableMapping.cs
- WebPartDescription.cs
- XmlTypeAttribute.cs
- XPathArrayIterator.cs
- ValidationErrorCollection.cs
- CompilationSection.cs
- StatusInfoItem.cs
- ZoneIdentityPermission.cs
- Currency.cs
- StreamInfo.cs
- FillRuleValidation.cs
- InertiaRotationBehavior.cs
- BypassElementCollection.cs
- TimeStampChecker.cs
- CallbackValidator.cs
- TextViewElement.cs
- DiagnosticsConfigurationHandler.cs
- AdCreatedEventArgs.cs
- ActiveXContainer.cs
- UTF32Encoding.cs
- CommonDialog.cs
- WindowsEditBoxRange.cs
- CodeSnippetExpression.cs
- Visual.cs
- XmlnsCache.cs
- RequestNavigateEventArgs.cs
- FixedPageAutomationPeer.cs
- TransformedBitmap.cs
- ListViewCancelEventArgs.cs
- GridViewCancelEditEventArgs.cs
- XmlUnspecifiedAttribute.cs
- Assign.cs
- HitTestDrawingContextWalker.cs
- CollectionViewGroup.cs
- FileSecurity.cs
- DbConnectionInternal.cs
- EntitySetRetriever.cs
- KeySpline.cs
- KeyboardDevice.cs
- AssemblyBuilder.cs
- DependentList.cs
- Token.cs
- XmlHierarchicalDataSourceView.cs
- BaseCollection.cs
- SecurityPolicySection.cs
- FontNamesConverter.cs
- propertytag.cs
- DataGridRowHeader.cs
- IndexedDataBuffer.cs
- TickBar.cs
- ListViewTableRow.cs
- HttpServerVarsCollection.cs
- ResolveResponseInfo.cs
- StorageScalarPropertyMapping.cs
- ColumnMapVisitor.cs
- FlowchartStart.xaml.cs
- XmlSchemaValidator.cs
- figurelengthconverter.cs
- HMACMD5.cs
- Security.cs
- AllMembershipCondition.cs
- FastEncoder.cs
- LineBreakRecord.cs
- PrePrepareMethodAttribute.cs
- QueryOptionExpression.cs
- DecodeHelper.cs
- TemplatePropertyEntry.cs
- GridViewColumn.cs
- SqlPersonalizationProvider.cs
- DiscoveryDocumentLinksPattern.cs
- NativeMethods.cs
- ResourceDefaultValueAttribute.cs
- TextDecoration.cs
- ThreadPool.cs
- KeyboardEventArgs.cs
- XmlAnyElementAttributes.cs
- ConfigXmlDocument.cs
- HttpPostedFile.cs
- ImageListStreamer.cs