Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Core / CSharp / System / Windows / Input / StagingAreaInputItem.cs / 1 / StagingAreaInputItem.cs
using System;
using System.Collections;
using System.Security.Permissions;
using System.Security;
namespace System.Windows.Input
{
///
/// This class encapsulates an input event while it is being
/// processed by the input manager.
///
///
/// This class just provides the dictionary-based storage for
/// all of the listeners of the various input manager events.
///
public class StagingAreaInputItem
{
// Only we can make these.
internal StagingAreaInputItem(bool isMarker)
{
_isMarker = isMarker;
}
// For performace reasons, we try to reuse these event args.
// Allow an existing item to be promoted by keeping the existing dictionary.
internal void Reset(InputEventArgs input, StagingAreaInputItem promote)
{
_input = input;
if(promote != null && promote._dictionary != null)
{
//
_dictionary = (Hashtable) promote._dictionary.Clone();
}
else
{
if(_dictionary != null)
{
_dictionary.Clear();
}
else
{
_dictionary = new Hashtable();
}
}
}
///
/// Returns the input event.
///
///
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
///
///
/// Defense In Depth - even if this leaks out, we demand here.
///
public InputEventArgs Input
{
[UIPermissionAttribute(SecurityAction.LinkDemand,Unrestricted=true)]
get {return _input;}
}
///
/// Provides storage for arbitrary data needed during the
/// processing of this input event.
///
///
/// An arbitrary key for the data. This cannot be null.
///
///
/// The data previously set for this key, or null.
///
public object GetData(object key)
{
return _dictionary[key];
}
///
/// Provides storage for arbitrary data needed during the
/// processing of this input event.
///
///
/// An arbitrary key for the data. This cannot be null.
///
///
/// The data to set for this key. This can be null.
///
///
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
///
///
/// Defense In Depth - even if this leaks out, we demand here.
///
[UIPermissionAttribute(SecurityAction.LinkDemand,Unrestricted=true)]
public void SetData(object key, object value)
{
_dictionary[key] = value;
}
internal bool IsMarker {get {return _isMarker;}}
private bool _isMarker;
private InputEventArgs _input;
private Hashtable _dictionary;
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
using System;
using System.Collections;
using System.Security.Permissions;
using System.Security;
namespace System.Windows.Input
{
///
/// This class encapsulates an input event while it is being
/// processed by the input manager.
///
///
/// This class just provides the dictionary-based storage for
/// all of the listeners of the various input manager events.
///
public class StagingAreaInputItem
{
// Only we can make these.
internal StagingAreaInputItem(bool isMarker)
{
_isMarker = isMarker;
}
// For performace reasons, we try to reuse these event args.
// Allow an existing item to be promoted by keeping the existing dictionary.
internal void Reset(InputEventArgs input, StagingAreaInputItem promote)
{
_input = input;
if(promote != null && promote._dictionary != null)
{
//
_dictionary = (Hashtable) promote._dictionary.Clone();
}
else
{
if(_dictionary != null)
{
_dictionary.Clear();
}
else
{
_dictionary = new Hashtable();
}
}
}
///
/// Returns the input event.
///
///
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
///
///
/// Defense In Depth - even if this leaks out, we demand here.
///
public InputEventArgs Input
{
[UIPermissionAttribute(SecurityAction.LinkDemand,Unrestricted=true)]
get {return _input;}
}
///
/// Provides storage for arbitrary data needed during the
/// processing of this input event.
///
///
/// An arbitrary key for the data. This cannot be null.
///
///
/// The data previously set for this key, or null.
///
public object GetData(object key)
{
return _dictionary[key];
}
///
/// Provides storage for arbitrary data needed during the
/// processing of this input event.
///
///
/// An arbitrary key for the data. This cannot be null.
///
///
/// The data to set for this key. This can be null.
///
///
/// Callers must have UIPermission(PermissionState.Unrestricted) to call this API.
///
///
/// Defense In Depth - even if this leaks out, we demand here.
///
[UIPermissionAttribute(SecurityAction.LinkDemand,Unrestricted=true)]
public void SetData(object key, object value)
{
_dictionary[key] = value;
}
internal bool IsMarker {get {return _isMarker;}}
private bool _isMarker;
private InputEventArgs _input;
private Hashtable _dictionary;
}
}
// 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
- XmlSchemaSearchPattern.cs
- XmlAttributeHolder.cs
- CatalogZoneBase.cs
- GraphicsPathIterator.cs
- templategroup.cs
- CryptoConfig.cs
- EditorPartChrome.cs
- LoginViewDesigner.cs
- CodeNamespace.cs
- DefaultValueConverter.cs
- ComponentGlyph.cs
- NamedPermissionSet.cs
- PropertyManager.cs
- ChunkedMemoryStream.cs
- Int32CollectionConverter.cs
- MessageQueueConverter.cs
- ScriptResourceInfo.cs
- BamlLocalizabilityResolver.cs
- DateTimeValueSerializer.cs
- unsafenativemethodsother.cs
- CompilationLock.cs
- AnyAllSearchOperator.cs
- Point4D.cs
- HWStack.cs
- BindingList.cs
- GrammarBuilderRuleRef.cs
- ConsoleTraceListener.cs
- PersonalizableAttribute.cs
- SchemaElementDecl.cs
- GridViewColumnHeaderAutomationPeer.cs
- TypeResolver.cs
- ColumnWidthChangedEvent.cs
- ViewCellRelation.cs
- TypeUnloadedException.cs
- DbgUtil.cs
- CheckBoxPopupAdapter.cs
- XmlObjectSerializerReadContextComplex.cs
- dbdatarecord.cs
- StylusEditingBehavior.cs
- OleStrCAMarshaler.cs
- XmlILModule.cs
- RectangleGeometry.cs
- SoapAttributeAttribute.cs
- webproxy.cs
- MsdtcClusterUtils.cs
- StorageAssociationTypeMapping.cs
- LoginView.cs
- filewebrequest.cs
- DrawingCollection.cs
- XmlObjectSerializerWriteContext.cs
- SqlDataSourceQueryEditorForm.cs
- Part.cs
- LayoutTable.cs
- RegexCompilationInfo.cs
- SimpleParser.cs
- HandleValueEditor.cs
- figurelengthconverter.cs
- ComplexPropertyEntry.cs
- MediaSystem.cs
- Style.cs
- NameValueFileSectionHandler.cs
- RequestCache.cs
- SchemaEntity.cs
- XDRSchema.cs
- ValidatingCollection.cs
- Scene3D.cs
- UriWriter.cs
- SmiContext.cs
- ScriptResourceInfo.cs
- SrgsNameValueTag.cs
- TempFiles.cs
- FieldBuilder.cs
- DataObjectEventArgs.cs
- DrawingContextWalker.cs
- OpCodes.cs
- DataGridPageChangedEventArgs.cs
- BitmapPalette.cs
- DebugView.cs
- Lease.cs
- TypeForwardedToAttribute.cs
- SignatureGenerator.cs
- _TransmitFileOverlappedAsyncResult.cs
- CodeValidator.cs
- CheckBoxFlatAdapter.cs
- CodeTypeDelegate.cs
- CompModSwitches.cs
- SqlDataSourceDesigner.cs
- ModelTreeEnumerator.cs
- StyleReferenceConverter.cs
- CustomErrorsSectionWrapper.cs
- TraversalRequest.cs
- OleDbException.cs
- RecordsAffectedEventArgs.cs
- ClientApiGenerator.cs
- TableLayoutCellPaintEventArgs.cs
- autovalidator.cs
- SystemDropShadowChrome.cs
- PeerNameResolver.cs
- TreeBuilderBamlTranslator.cs
- ButtonChrome.cs