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
- ComNativeDescriptor.cs
- ConfigXmlComment.cs
- FormatPage.cs
- HostProtectionPermission.cs
- SendActivity.cs
- MonitorWrapper.cs
- SignedXml.cs
- PreservationFileWriter.cs
- BasicDesignerLoader.cs
- Bidi.cs
- AuthenticationModuleElement.cs
- ProxySimple.cs
- SmiConnection.cs
- ButtonFieldBase.cs
- IdleTimeoutMonitor.cs
- HwndPanningFeedback.cs
- ConnectionPointCookie.cs
- ImageMetadata.cs
- UnionCodeGroup.cs
- TreeNodeBindingDepthConverter.cs
- BezierSegment.cs
- MetadataArtifactLoader.cs
- MissingMethodException.cs
- ChannelCacheDefaults.cs
- DateTimeValueSerializer.cs
- ViewLoader.cs
- Fonts.cs
- RectAnimationUsingKeyFrames.cs
- DocumentViewerConstants.cs
- PolyQuadraticBezierSegment.cs
- BinarySerializer.cs
- DBCommand.cs
- MultilineStringEditor.cs
- Cursor.cs
- ExpressionBuilder.cs
- ThemeInfoAttribute.cs
- RsaKeyIdentifierClause.cs
- ErrorCodes.cs
- ApplicationDirectoryMembershipCondition.cs
- FixedSchema.cs
- SimpleLine.cs
- _FtpControlStream.cs
- PlatformNotSupportedException.cs
- unitconverter.cs
- RequestCachePolicyConverter.cs
- FactoryMaker.cs
- TimeSpanStorage.cs
- ASCIIEncoding.cs
- LocationUpdates.cs
- Selector.cs
- LinearGradientBrush.cs
- StreamingContext.cs
- AccessDataSourceView.cs
- XpsFilter.cs
- BitmapSizeOptions.cs
- RedBlackList.cs
- HttpWebRequestElement.cs
- CodeArgumentReferenceExpression.cs
- TypeSystemProvider.cs
- PropertyItemInternal.cs
- HtmlControl.cs
- HtmlCalendarAdapter.cs
- OracleMonthSpan.cs
- UpDownBaseDesigner.cs
- AutoResizedEvent.cs
- BasicExpandProvider.cs
- XmlEntityReference.cs
- AsyncPostBackTrigger.cs
- VectorCollection.cs
- GridSplitterAutomationPeer.cs
- UIElementAutomationPeer.cs
- MetadataImporter.cs
- xmlsaver.cs
- ServiceBehaviorElement.cs
- WebPartDisplayModeCollection.cs
- CurrentTimeZone.cs
- login.cs
- CollectionDataContractAttribute.cs
- ValidationResult.cs
- TreeViewImageIndexConverter.cs
- ComponentManagerBroker.cs
- InputReport.cs
- TypeNameConverter.cs
- IsolatedStorageFile.cs
- TriState.cs
- ConfigurationManager.cs
- UnitySerializationHolder.cs
- HttpListenerException.cs
- DBCSCodePageEncoding.cs
- CultureSpecificCharacterBufferRange.cs
- PathFigure.cs
- Int32CAMarshaler.cs
- Path.cs
- AbandonedMutexException.cs
- ProtocolViolationException.cs
- ConfigurationValidatorAttribute.cs
- EncodingDataItem.cs
- LoginUtil.cs
- XD.cs
- DbConnectionHelper.cs