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 / 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
- HttpBrowserCapabilitiesWrapper.cs
- PkcsUtils.cs
- ClipboardProcessor.cs
- Int16Storage.cs
- BehaviorEditorPart.cs
- SecurityTokenResolver.cs
- SetStateDesigner.cs
- CommandID.cs
- DetailsViewRow.cs
- BoundsDrawingContextWalker.cs
- DataGridViewSelectedColumnCollection.cs
- Debug.cs
- XmlUnspecifiedAttribute.cs
- WebPartMenu.cs
- TerminatorSinks.cs
- SingleAnimationUsingKeyFrames.cs
- XPathMultyIterator.cs
- CompletedAsyncResult.cs
- WeakEventManager.cs
- StatusBarItemAutomationPeer.cs
- InvalidWMPVersionException.cs
- OdbcHandle.cs
- ContainerParaClient.cs
- AssociationEndMember.cs
- ToggleButtonAutomationPeer.cs
- TypeSource.cs
- DataColumnChangeEvent.cs
- LinearGradientBrush.cs
- FileLogRecord.cs
- TransformedBitmap.cs
- ValidatedControlConverter.cs
- OracleBinary.cs
- SQLSingleStorage.cs
- CaretElement.cs
- AttachedAnnotationChangedEventArgs.cs
- CircleHotSpot.cs
- Odbc32.cs
- DeadCharTextComposition.cs
- HighlightOverlayGlyph.cs
- SmtpTransport.cs
- BinaryMethodMessage.cs
- WriteFileContext.cs
- InvalidPipelineStoreException.cs
- StorageMappingItemLoader.cs
- SerializationObjectManager.cs
- ToRequest.cs
- StringBuilder.cs
- Input.cs
- TextWriterTraceListener.cs
- EntityConnectionStringBuilderItem.cs
- EntitySqlQueryCacheEntry.cs
- ReadOnlyDataSource.cs
- ValueOfAction.cs
- SqlClientMetaDataCollectionNames.cs
- SafePEFileHandle.cs
- EntityException.cs
- Calendar.cs
- rsa.cs
- ClientTargetSection.cs
- CallTemplateAction.cs
- SaveFileDialogDesigner.cs
- Fonts.cs
- UdpChannelListener.cs
- DragEvent.cs
- ContainerSelectorBehavior.cs
- PersonalizableAttribute.cs
- ActivityCodeDomSerializer.cs
- PropertyInfo.cs
- ProcessThread.cs
- DataGridPageChangedEventArgs.cs
- Timer.cs
- RadialGradientBrush.cs
- DataBinder.cs
- DrawingBrush.cs
- CanonicalXml.cs
- CompilerWrapper.cs
- IssuedTokenClientBehaviorsElementCollection.cs
- FileLevelControlBuilderAttribute.cs
- LoginStatusDesigner.cs
- SqlDataSourceCache.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- BulletChrome.cs
- ContentElement.cs
- JapaneseLunisolarCalendar.cs
- DashStyle.cs
- WebFormsRootDesigner.cs
- KeyGesture.cs
- WebControl.cs
- PageStatePersister.cs
- ExtensionSurface.cs
- BigInt.cs
- WmlMobileTextWriter.cs
- SecurityKeyType.cs
- SamlDoNotCacheCondition.cs
- WebPartConnection.cs
- NaturalLanguageHyphenator.cs
- AssemblyResourceLoader.cs
- DataSourceCacheDurationConverter.cs
- Menu.cs
- NetDataContractSerializer.cs