Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Input / FocusChangedEventArgs.cs / 1305600 / 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
- ListControl.cs
- EventHandlers.cs
- Button.cs
- DiscardableAttribute.cs
- Executor.cs
- WaitHandleCannotBeOpenedException.cs
- AlternateViewCollection.cs
- TypeForwardedToAttribute.cs
- TemplatedAdorner.cs
- DynamicQueryableWrapper.cs
- ConfigurationManager.cs
- DPTypeDescriptorContext.cs
- XmlDataCollection.cs
- UrlAuthorizationModule.cs
- Identifier.cs
- HttpProfileBase.cs
- ConfigurationSchemaErrors.cs
- ExceptionUtil.cs
- ToolStripDropDownClosingEventArgs.cs
- DependencyPropertyValueSerializer.cs
- ClonableStack.cs
- PackagePartCollection.cs
- DesignerObjectListAdapter.cs
- OleDbPropertySetGuid.cs
- XsltInput.cs
- ImageInfo.cs
- StateItem.cs
- Rule.cs
- _ConnectOverlappedAsyncResult.cs
- Semaphore.cs
- Bits.cs
- XmlElementAttribute.cs
- TextContainerChangedEventArgs.cs
- HostProtectionPermission.cs
- XmlSchemaValidator.cs
- TextLine.cs
- SecurityPolicySection.cs
- TCEAdapterGenerator.cs
- Simplifier.cs
- FileDetails.cs
- SelfIssuedAuthRSACryptoProvider.cs
- CompressedStack.cs
- HashUtility.cs
- XmlIgnoreAttribute.cs
- EnvironmentPermission.cs
- EmptyQuery.cs
- UnsafeNativeMethods.cs
- CompletedAsyncResult.cs
- TargetConverter.cs
- MailDefinition.cs
- HtmlHead.cs
- SqlConnectionPoolGroupProviderInfo.cs
- Native.cs
- UpDownEvent.cs
- CaseStatementSlot.cs
- datacache.cs
- ResourceAttributes.cs
- EventLog.cs
- DesignerDataSourceView.cs
- Duration.cs
- TextShapeableCharacters.cs
- RuleConditionDialog.Designer.cs
- SettingsPropertyCollection.cs
- GrammarBuilder.cs
- SmiConnection.cs
- EdmFunctionAttribute.cs
- BamlResourceDeserializer.cs
- EntityProviderServices.cs
- SafeArchiveContext.cs
- PerformanceCounterPermissionEntry.cs
- Misc.cs
- SimpleFieldTemplateFactory.cs
- StrongNameUtility.cs
- RepeaterItemEventArgs.cs
- ObjectDataSource.cs
- ZoneLinkButton.cs
- Substitution.cs
- MatrixTransform3D.cs
- ItemContainerGenerator.cs
- WebPartZoneBase.cs
- DateRangeEvent.cs
- Triangle.cs
- Int32EqualityComparer.cs
- Vars.cs
- SoapAttributes.cs
- MediaSystem.cs
- PropertySegmentSerializationProvider.cs
- Stacktrace.cs
- SHA384.cs
- XmlResolver.cs
- DataGridViewTextBoxColumn.cs
- HandleCollector.cs
- TemplateDefinition.cs
- UnsafeNativeMethodsTablet.cs
- LinkedResource.cs
- SQLByte.cs
- ObjectDataSourceView.cs
- CodeExpressionCollection.cs
- WebServiceFaultDesigner.cs
- DiscoveryReference.cs