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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- EventHandlersDesigner.cs
- ProcessThreadCollection.cs
- TraceXPathNavigator.cs
- ProcessModelSection.cs
- DBCommandBuilder.cs
- CompilerParameters.cs
- DocumentGridPage.cs
- PaintEvent.cs
- MarshalDirectiveException.cs
- SystemIPGlobalStatistics.cs
- XXXOnTypeBuilderInstantiation.cs
- X509ServiceCertificateAuthentication.cs
- SolidColorBrush.cs
- NamedPipeProcessProtocolHandler.cs
- Rect.cs
- SocketStream.cs
- PrinterSettings.cs
- Internal.cs
- UITypeEditor.cs
- SiteMapNodeCollection.cs
- COAUTHINFO.cs
- NetMsmqSecurity.cs
- OuterGlowBitmapEffect.cs
- Relationship.cs
- DBConcurrencyException.cs
- Cursor.cs
- Ray3DHitTestResult.cs
- XMLDiffLoader.cs
- StylusPointPropertyInfo.cs
- PublisherMembershipCondition.cs
- ApplicationHost.cs
- MultipartContentParser.cs
- ConfigurationValue.cs
- X509SecurityToken.cs
- WebPartConnectionsConnectVerb.cs
- SiteMembershipCondition.cs
- DiscoveryClientChannelFactory.cs
- TreeView.cs
- DataRecordInternal.cs
- StrongTypingException.cs
- DataGridLinkButton.cs
- SerialPort.cs
- ProfessionalColors.cs
- connectionpool.cs
- ConnectionsZoneDesigner.cs
- DigestComparer.cs
- WebBrowsableAttribute.cs
- EncryptedReference.cs
- PositiveTimeSpanValidatorAttribute.cs
- JoinSymbol.cs
- Camera.cs
- KnownTypeDataContractResolver.cs
- CollectionDataContract.cs
- EllipticalNodeOperations.cs
- WorkflowRuntime.cs
- DataContractSerializerMessageContractImporter.cs
- securestring.cs
- TreeViewAutomationPeer.cs
- HtmlInputCheckBox.cs
- AssemblyBuilderData.cs
- MetadataProperty.cs
- CompModSwitches.cs
- SystemIPv4InterfaceProperties.cs
- ChainOfDependencies.cs
- ContractMapping.cs
- UnhandledExceptionEventArgs.cs
- WhiteSpaceTrimStringConverter.cs
- Int16Animation.cs
- RenameRuleObjectDialog.cs
- CodeArrayIndexerExpression.cs
- TcpProcessProtocolHandler.cs
- PageThemeBuildProvider.cs
- CodeMemberEvent.cs
- Content.cs
- AppDomainResourcePerfCounters.cs
- SecurityManager.cs
- AsnEncodedData.cs
- ConfigurationUtility.cs
- DiscoveryService.cs
- SupportingTokenSecurityTokenResolver.cs
- VisualStyleElement.cs
- MILUtilities.cs
- ObjectViewQueryResultData.cs
- CornerRadius.cs
- Renderer.cs
- GenericXmlSecurityToken.cs
- MemoryRecordBuffer.cs
- XmlCharCheckingWriter.cs
- assertwrapper.cs
- DatatypeImplementation.cs
- PagedDataSource.cs
- DifferencingCollection.cs
- basemetadatamappingvisitor.cs
- MailMessageEventArgs.cs
- TreeNodeClickEventArgs.cs
- ConnectionPointGlyph.cs
- HtmlInputCheckBox.cs
- ColumnMap.cs
- MachineKeyConverter.cs
- BitmapEffectInput.cs