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
- StringConcat.cs
- PageCatalogPart.cs
- SqlCommandSet.cs
- MemberAssignmentAnalysis.cs
- ConfigurationConverterBase.cs
- WebPartConnectionsConfigureVerb.cs
- PagedDataSource.cs
- SQLInt64.cs
- AutomationProperties.cs
- TouchFrameEventArgs.cs
- ActivityDesigner.cs
- SafeProcessHandle.cs
- WindowsSolidBrush.cs
- BaseValidator.cs
- LogSwitch.cs
- HttpChannelBindingToken.cs
- WindowsScroll.cs
- ScriptingAuthenticationServiceSection.cs
- RegistrationServices.cs
- Cursors.cs
- AlignmentXValidation.cs
- DataKey.cs
- DeriveBytes.cs
- CodeIdentifier.cs
- ComponentConverter.cs
- RNGCryptoServiceProvider.cs
- DataViewSetting.cs
- ObjectListTitleAttribute.cs
- TraceInternal.cs
- WmlCalendarAdapter.cs
- BooleanKeyFrameCollection.cs
- DocComment.cs
- Material.cs
- OperationAbortedException.cs
- BindableTemplateBuilder.cs
- XmlChildEnumerator.cs
- SuppressMergeCheckAttribute.cs
- RadialGradientBrush.cs
- IssuanceLicense.cs
- ModifierKeysConverter.cs
- DBCommandBuilder.cs
- CommonObjectSecurity.cs
- SelectedGridItemChangedEvent.cs
- FrameworkContextData.cs
- XmlSchemaFacet.cs
- Semaphore.cs
- RectangleHotSpot.cs
- QilName.cs
- PtsHelper.cs
- PerformanceCounterLib.cs
- HttpResponseInternalWrapper.cs
- CodeEntryPointMethod.cs
- securitycriticaldata.cs
- _ServiceNameStore.cs
- TypeUtil.cs
- SerialErrors.cs
- ContractTypeNameElement.cs
- StateDesigner.Layouts.cs
- WorkflowInstanceRecord.cs
- DockPattern.cs
- NativeMethods.cs
- IntegerValidatorAttribute.cs
- ClientApiGenerator.cs
- _ConnectOverlappedAsyncResult.cs
- EventEntry.cs
- Crypto.cs
- COM2FontConverter.cs
- PanelStyle.cs
- DependencyObjectCodeDomSerializer.cs
- DataGridViewCellCollection.cs
- WorkflowInlining.cs
- ComplexTypeEmitter.cs
- FlowDocumentReader.cs
- DirectoryNotFoundException.cs
- DesignerVerb.cs
- MaterialGroup.cs
- ValidationSummaryDesigner.cs
- SafeArrayTypeMismatchException.cs
- TableCellsCollectionEditor.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- Win32Exception.cs
- DataServiceHostFactory.cs
- ImageMap.cs
- FactoryMaker.cs
- SizeValueSerializer.cs
- DigitalSignature.cs
- FactoryMaker.cs
- LassoHelper.cs
- TextRangeAdaptor.cs
- CompareInfo.cs
- XmlObjectSerializerReadContextComplex.cs
- RegisteredExpandoAttribute.cs
- ProfileProvider.cs
- WebPartZoneBaseDesigner.cs
- DLinqColumnProvider.cs
- TextTreeText.cs
- SystemDropShadowChrome.cs
- SchemaCollectionPreprocessor.cs
- DeclarativeExpressionConditionDeclaration.cs
- CodeTypeParameter.cs