Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- ExpressionBuilder.cs
- ImplicitInputBrush.cs
- recordstatefactory.cs
- DataGridViewCell.cs
- HandlerBase.cs
- SchemaSetCompiler.cs
- HttpStreamXmlDictionaryReader.cs
- ObjectHandle.cs
- FileFormatException.cs
- CodeDirectionExpression.cs
- Soap12FormatExtensions.cs
- PeerResolverElement.cs
- OutOfProcStateClientManager.cs
- Assembly.cs
- CookielessHelper.cs
- ConfigurationPermission.cs
- Ops.cs
- CodeSubDirectory.cs
- SqlConnectionStringBuilder.cs
- VideoDrawing.cs
- XpsS0ValidatingLoader.cs
- InstalledFontCollection.cs
- WindowsStatusBar.cs
- XPathExpr.cs
- BitmapSourceSafeMILHandle.cs
- InputScopeConverter.cs
- RectAnimation.cs
- PointF.cs
- TextCompositionManager.cs
- X509WindowsSecurityToken.cs
- HtmlTernaryTree.cs
- UserControl.cs
- Membership.cs
- WindowsListViewScroll.cs
- xsdvalidator.cs
- PersonalizationProviderCollection.cs
- ConfigXmlWhitespace.cs
- SqlConnectionPoolProviderInfo.cs
- ContourSegment.cs
- EndPoint.cs
- RotateTransform.cs
- Root.cs
- XmlCollation.cs
- XPathArrayIterator.cs
- _OverlappedAsyncResult.cs
- DataServiceBehavior.cs
- TemplatePagerField.cs
- UnsafeNativeMethods.cs
- DesignerCommandSet.cs
- XmlChoiceIdentifierAttribute.cs
- smtpconnection.cs
- SqlProviderManifest.cs
- BadImageFormatException.cs
- ResourceSet.cs
- XmlnsDefinitionAttribute.cs
- ExtendedTransformFactory.cs
- MDIWindowDialog.cs
- PointLight.cs
- SettingsPropertyIsReadOnlyException.cs
- ValidationErrorEventArgs.cs
- DBConcurrencyException.cs
- WebPart.cs
- RecordManager.cs
- Rijndael.cs
- DrawingAttributesDefaultValueFactory.cs
- templategroup.cs
- ToolbarAUtomationPeer.cs
- ParallelRangeManager.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- BackStopAuthenticationModule.cs
- StringUtil.cs
- MessageQueuePermission.cs
- DbDataReader.cs
- SkewTransform.cs
- GroupBox.cs
- ComEventsInfo.cs
- SymLanguageType.cs
- TcpChannelHelper.cs
- webbrowsersite.cs
- TextEditorTables.cs
- MetadataUtil.cs
- XmlStreamNodeWriter.cs
- StylusPointPropertyUnit.cs
- RubberbandSelector.cs
- ExtentJoinTreeNode.cs
- ArgumentException.cs
- ConnectionStringSettingsCollection.cs
- HtmlFormWrapper.cs
- ParserHooks.cs
- ObjectPropertyMapping.cs
- AnnotationAuthorChangedEventArgs.cs
- InstanceDataCollection.cs
- CuspData.cs
- Parameter.cs
- CachedTypeface.cs
- FunctionQuery.cs
- StringSource.cs
- XamlVector3DCollectionSerializer.cs
- Asn1IntegerConverter.cs
- CloudCollection.cs