Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- XmlSchemaSimpleContent.cs
- WebConfigurationHost.cs
- DrawingDrawingContext.cs
- TextServicesDisplayAttributePropertyRanges.cs
- CodeIndexerExpression.cs
- MimeFormatter.cs
- FormsAuthenticationConfiguration.cs
- DetailsViewDesigner.cs
- ElementUtil.cs
- TextTreeExtractElementUndoUnit.cs
- WebEvents.cs
- OleDbSchemaGuid.cs
- EventItfInfo.cs
- UrlEncodedParameterWriter.cs
- Certificate.cs
- sqlinternaltransaction.cs
- SendActivityDesigner.cs
- AppliedDeviceFiltersEditor.cs
- UnionCqlBlock.cs
- MenuScrollingVisibilityConverter.cs
- AssemblyResourceLoader.cs
- OutputCacheSettingsSection.cs
- DrawingAttributes.cs
- ActivityBuilderHelper.cs
- SHA1Managed.cs
- DateTimeOffset.cs
- TextComposition.cs
- SendMailErrorEventArgs.cs
- CustomValidator.cs
- SizeF.cs
- XmlAttributeProperties.cs
- CryptoHandle.cs
- ObjectParameterCollection.cs
- Parallel.cs
- DesignerRegionMouseEventArgs.cs
- DrawingContextDrawingContextWalker.cs
- ValueSerializerAttribute.cs
- Main.cs
- FtpCachePolicyElement.cs
- HtmlTextArea.cs
- Pointer.cs
- PersonalizationEntry.cs
- PrimitiveRenderer.cs
- OdbcConnectionString.cs
- CommandLibraryHelper.cs
- Imaging.cs
- _RequestCacheProtocol.cs
- ListDesigner.cs
- SeekableReadStream.cs
- PaperSource.cs
- BlockCollection.cs
- PrivilegedConfigurationManager.cs
- ReplyAdapterChannelListener.cs
- FormatException.cs
- EnumUnknown.cs
- FileLoadException.cs
- ExpressionConverter.cs
- DocumentOrderComparer.cs
- IxmlLineInfo.cs
- basecomparevalidator.cs
- CodeTypeReferenceExpression.cs
- BufferedWebEventProvider.cs
- ThemeInfoAttribute.cs
- EntityObject.cs
- MessageSmuggler.cs
- AssemblyInfo.cs
- SyntaxCheck.cs
- Package.cs
- ResourceType.cs
- SynchronizingStream.cs
- BinHexEncoder.cs
- SecurityKeyType.cs
- SoapFault.cs
- XmlStreamStore.cs
- ProfilePropertySettings.cs
- SessionStateUtil.cs
- AsyncCompletedEventArgs.cs
- CriticalFinalizerObject.cs
- Typeface.cs
- LinqDataSourceContextEventArgs.cs
- Tuple.cs
- HostProtectionException.cs
- CalendarButton.cs
- InterleavedZipPartStream.cs
- ConfigurationSection.cs
- DbDataRecord.cs
- PartitionResolver.cs
- AnnotationComponentManager.cs
- Mappings.cs
- RetrieveVirtualItemEventArgs.cs
- srgsitem.cs
- GlobalizationSection.cs
- PreviewPageInfo.cs
- metadatamappinghashervisitor.cs
- ScriptReference.cs
- VariableQuery.cs
- PackageDocument.cs
- CodeAttributeDeclarationCollection.cs
- LabelLiteral.cs
- BitmapCache.cs