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
- RootDesignerSerializerAttribute.cs
- DataListItemCollection.cs
- WinFormsUtils.cs
- SchemaSetCompiler.cs
- HotSpot.cs
- SHA256Cng.cs
- EDesignUtil.cs
- RankException.cs
- ActionMismatchAddressingException.cs
- OptimizedTemplateContent.cs
- NameValuePair.cs
- RightsManagementPermission.cs
- EntityAdapter.cs
- ImageSource.cs
- PeerNameRegistration.cs
- CompatibleIComparer.cs
- KnownTypesProvider.cs
- SEHException.cs
- DesignerValidationSummaryAdapter.cs
- MediaElementAutomationPeer.cs
- CompilationUnit.cs
- XmlSchemaDatatype.cs
- ServiceOperation.cs
- SqlLiftIndependentRowExpressions.cs
- XmlSchemaDatatype.cs
- SqlStream.cs
- UidManager.cs
- MessageAction.cs
- InkCanvas.cs
- GlobalItem.cs
- TableLayoutCellPaintEventArgs.cs
- XslException.cs
- WebPartConnection.cs
- DesignerAttribute.cs
- DataGridViewToolTip.cs
- ByteAnimationUsingKeyFrames.cs
- CursorConverter.cs
- ConstraintStruct.cs
- shaper.cs
- WebPartsSection.cs
- DataGridViewComponentPropertyGridSite.cs
- ProxyElement.cs
- ContentElement.cs
- CodeDomConfigurationHandler.cs
- BamlWriter.cs
- DocumentOrderQuery.cs
- WindowsFormsSynchronizationContext.cs
- ThreadSafeList.cs
- ProgressBar.cs
- DropSource.cs
- DataService.cs
- LinearKeyFrames.cs
- Pair.cs
- OperationFormatStyle.cs
- RedirectionProxy.cs
- DispatcherExceptionFilterEventArgs.cs
- ThreadAbortException.cs
- StateRuntime.cs
- DataControlFieldCollection.cs
- PlainXmlDeserializer.cs
- WindowsListViewItemCheckBox.cs
- Oid.cs
- PolyBezierSegment.cs
- Baml2006Reader.cs
- NativeMethods.cs
- SqlClientWrapperSmiStream.cs
- DBParameter.cs
- EpmCustomContentSerializer.cs
- InvalidPropValue.cs
- LayoutManager.cs
- PermissionSetEnumerator.cs
- ResourceDescriptionAttribute.cs
- contentDescriptor.cs
- SmtpTransport.cs
- Path.cs
- IList.cs
- WriteFileContext.cs
- HostProtectionPermission.cs
- XPathException.cs
- MediaPlayer.cs
- SimpleTableProvider.cs
- WeakEventTable.cs
- TreeViewHitTestInfo.cs
- EncoderExceptionFallback.cs
- GridViewCommandEventArgs.cs
- DefaultValueTypeConverter.cs
- String.cs
- SpecialNameAttribute.cs
- Listbox.cs
- PowerModeChangedEventArgs.cs
- PathFigureCollection.cs
- XPathBuilder.cs
- TextShapeableCharacters.cs
- PerfCounters.cs
- RecommendedAsConfigurableAttribute.cs
- SerializerWriterEventHandlers.cs
- WindowsAuthenticationModule.cs
- DesignTimeParseData.cs
- LongValidatorAttribute.cs
- ServiceOperation.cs