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
- ControlBuilder.cs
- BamlRecordHelper.cs
- PropertyManager.cs
- SQLBytesStorage.cs
- BehaviorEditorPart.cs
- TreeNode.cs
- DynamicEntity.cs
- XmlNamespaceMapping.cs
- BindStream.cs
- AccessorTable.cs
- BitStream.cs
- MessageQueueKey.cs
- FreezableDefaultValueFactory.cs
- ObjectTag.cs
- ToolStripLocationCancelEventArgs.cs
- AsmxEndpointPickerExtension.cs
- RowToFieldTransformer.cs
- ListBox.cs
- WorkflowApplicationTerminatedException.cs
- OuterGlowBitmapEffect.cs
- ImageAnimator.cs
- BuildResultCache.cs
- CodeSubDirectoriesCollection.cs
- DeclaredTypeValidatorAttribute.cs
- HttpRawResponse.cs
- DataGridViewRowPrePaintEventArgs.cs
- DataSourceControlBuilder.cs
- TabOrder.cs
- DeclarativeCatalogPart.cs
- ColumnClickEvent.cs
- SchemaImporter.cs
- ScriptModule.cs
- AssemblyHash.cs
- ComponentEditorForm.cs
- SafeProcessHandle.cs
- ProvidersHelper.cs
- Registry.cs
- GeometryGroup.cs
- ProcessStartInfo.cs
- FilterEventArgs.cs
- ParentQuery.cs
- IriParsingElement.cs
- SplineKeyFrames.cs
- SpeechSeg.cs
- PointCollectionConverter.cs
- ChannelReliableSession.cs
- WorkflowDesignerMessageFilter.cs
- PeerApplicationLaunchInfo.cs
- HtmlControl.cs
- HttpModuleAction.cs
- ClientCultureInfo.cs
- CounterNameConverter.cs
- StyleHelper.cs
- KeyPressEvent.cs
- SymLanguageVendor.cs
- DataGridBoundColumn.cs
- WebPartsPersonalization.cs
- Soap11ServerProtocol.cs
- BackgroundWorker.cs
- Viewport3DAutomationPeer.cs
- EntityDataSourceDataSelection.cs
- Point3DKeyFrameCollection.cs
- DropShadowBitmapEffect.cs
- CodeTypeMember.cs
- ReachPrintTicketSerializerAsync.cs
- RenderingBiasValidation.cs
- TabItemAutomationPeer.cs
- GridView.cs
- EdmFunction.cs
- _TLSstream.cs
- DbCommandTree.cs
- PointValueSerializer.cs
- ValueTypeFixupInfo.cs
- DesignerTextWriter.cs
- Rect3D.cs
- FormViewPagerRow.cs
- Border.cs
- DriveNotFoundException.cs
- HtmlHead.cs
- TagPrefixAttribute.cs
- HttpCapabilitiesSectionHandler.cs
- DupHandleConnectionReader.cs
- WebPartCloseVerb.cs
- DataServiceRequest.cs
- SwitchCase.cs
- ExcCanonicalXml.cs
- AuthenticatedStream.cs
- EmptyStringExpandableObjectConverter.cs
- PaperSource.cs
- DelegatingMessage.cs
- DataGridViewControlCollection.cs
- SchemaMapping.cs
- EntityChangedParams.cs
- HasCopySemanticsAttribute.cs
- BridgeDataRecord.cs
- ColumnMap.cs
- DPAPIProtectedConfigurationProvider.cs
- ListChangedEventArgs.cs
- SecurityTokenRequirement.cs
- XamlStream.cs