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
- DirectoryNotFoundException.cs
- ToolStripDropDownItem.cs
- Highlights.cs
- EntityTemplateUserControl.cs
- Documentation.cs
- DataObjectSettingDataEventArgs.cs
- ProfileGroupSettingsCollection.cs
- MdImport.cs
- DataRowCollection.cs
- securitycriticaldataformultiplegetandset.cs
- EventArgs.cs
- Material.cs
- GcSettings.cs
- Unit.cs
- SymbolEqualComparer.cs
- PackUriHelper.cs
- XmlSchemaCollection.cs
- ButtonColumn.cs
- TraceUtility.cs
- WinFormsSecurity.cs
- DataSourceControlBuilder.cs
- XmlSerializationGeneratedCode.cs
- TableNameAttribute.cs
- TreeViewImageKeyConverter.cs
- RuntimeConfigurationRecord.cs
- ScrollProperties.cs
- CodeGroup.cs
- EventDescriptor.cs
- CodeTryCatchFinallyStatement.cs
- storepermissionattribute.cs
- InstanceDescriptor.cs
- BufferBuilder.cs
- DataFormats.cs
- Image.cs
- BitmapVisualManager.cs
- GuidelineCollection.cs
- UserControl.cs
- Border.cs
- BevelBitmapEffect.cs
- APCustomTypeDescriptor.cs
- Mouse.cs
- SubMenuStyleCollectionEditor.cs
- TemplateBaseAction.cs
- InstanceKeyCompleteException.cs
- SoapProtocolReflector.cs
- ConditionBrowserDialog.cs
- SelectionRangeConverter.cs
- ListGeneralPage.cs
- RuleSetBrowserDialog.cs
- ItemType.cs
- TextRangeBase.cs
- Int64Storage.cs
- ManagementDateTime.cs
- HtmlHistory.cs
- SizeConverter.cs
- SemanticBasicElement.cs
- HttpModuleCollection.cs
- IncrementalCompileAnalyzer.cs
- SHA256.cs
- MenuScrollingVisibilityConverter.cs
- SelectionService.cs
- TranslateTransform.cs
- SymLanguageVendor.cs
- PtsCache.cs
- ListItemConverter.cs
- CodeDomLocalizationProvider.cs
- ConfigurationFileMap.cs
- RangeContentEnumerator.cs
- UrlMappingsSection.cs
- DataServiceCollectionOfT.cs
- JournalEntryListConverter.cs
- SessionEndingEventArgs.cs
- Misc.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- HtmlToClrEventProxy.cs
- CodeCatchClause.cs
- ApplicationManager.cs
- DataServiceException.cs
- CachedPathData.cs
- EtwTrackingBehaviorElement.cs
- RectAnimation.cs
- PlanCompilerUtil.cs
- StylusLogic.cs
- XslVisitor.cs
- CachedTypeface.cs
- CollectionViewProxy.cs
- PropertyToken.cs
- ClientSideQueueItem.cs
- FixedSOMPage.cs
- Line.cs
- ColorConvertedBitmapExtension.cs
- CompilationSection.cs
- HtmlShimManager.cs
- Trace.cs
- ConstructorNeedsTagAttribute.cs
- Expression.DebuggerProxy.cs
- BaseUriHelper.cs
- TimeSpanSecondsConverter.cs
- Transform3D.cs
- login.cs