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
- HttpPostServerProtocol.cs
- InfoCardBaseException.cs
- BaseCollection.cs
- CodeGenerator.cs
- PropertyKey.cs
- AstNode.cs
- WindowShowOrOpenTracker.cs
- GradientStopCollection.cs
- NavigationEventArgs.cs
- InsufficientExecutionStackException.cs
- SingleAnimation.cs
- ThousandthOfEmRealDoubles.cs
- ListQueryResults.cs
- DesignerDataSchemaClass.cs
- Debug.cs
- WebPartEventArgs.cs
- Stack.cs
- PropertyDescriptor.cs
- ProvidersHelper.cs
- PasswordTextContainer.cs
- FixedSOMTableRow.cs
- MimeWriter.cs
- Interfaces.cs
- XmlIterators.cs
- WebPartHelpVerb.cs
- SafeCryptoHandles.cs
- SolidBrush.cs
- PassportAuthenticationModule.cs
- GridViewColumnHeaderAutomationPeer.cs
- SecurityContext.cs
- PublishLicense.cs
- DetailsView.cs
- Pen.cs
- ListViewGroupCollectionEditor.cs
- TraceEventCache.cs
- PermissionToken.cs
- WorkflowApplication.cs
- Hyperlink.cs
- ListBoxChrome.cs
- HttpDebugHandler.cs
- SettingsSection.cs
- CodeThrowExceptionStatement.cs
- BamlCollectionHolder.cs
- DoubleCollectionConverter.cs
- IsolationInterop.cs
- WeakHashtable.cs
- MatrixUtil.cs
- EdmScalarPropertyAttribute.cs
- StylusCollection.cs
- WebPartChrome.cs
- AuthenticationConfig.cs
- _FtpControlStream.cs
- RecognizedAudio.cs
- UriExt.cs
- CapabilitiesSection.cs
- PropertyTabAttribute.cs
- OdbcParameter.cs
- DNS.cs
- DecoderFallbackWithFailureFlag.cs
- ComponentResourceManager.cs
- StandardBindingOptionalReliableSessionElement.cs
- Publisher.cs
- ToolStripRenderEventArgs.cs
- CodeIdentifiers.cs
- ContentType.cs
- KeyPullup.cs
- WindowsAltTab.cs
- BitmapCodecInfo.cs
- CssClassPropertyAttribute.cs
- HebrewCalendar.cs
- TextTrailingWordEllipsis.cs
- EncryptedPackage.cs
- DependencyPropertyKey.cs
- OracleDataAdapter.cs
- CacheOutputQuery.cs
- WindowsGraphics2.cs
- DependencyObjectProvider.cs
- IApplicationTrustManager.cs
- Configuration.cs
- SpotLight.cs
- TaiwanLunisolarCalendar.cs
- Attributes.cs
- BmpBitmapDecoder.cs
- Cursors.cs
- DummyDataSource.cs
- DbConnectionClosed.cs
- Scheduler.cs
- storepermission.cs
- RelatedImageListAttribute.cs
- PathFigureCollectionConverter.cs
- PingReply.cs
- ChangeToolStripParentVerb.cs
- StylusSystemGestureEventArgs.cs
- AutoResizedEvent.cs
- ToolStripSettings.cs
- ExpressionVisitor.cs
- IncrementalCompileAnalyzer.cs
- CompiledQuery.cs
- SoapObjectInfo.cs
- EventLogEntryCollection.cs