Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Input / ProcessInputEventArgs.cs / 1305600 / ProcessInputEventArgs.cs
using System; using System.Security.Permissions; using System.Security; using MS.Internal; using MS.Internal.PresentationCore; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows.Input { ////// Provides access to the input manager's staging area. /// ////// An instance of this class, or a derived class, is passed to the /// handlers of the following events: /// public class ProcessInputEventArgs : NotifyInputEventArgs { // Only we can make these. Note that we cache and resuse instances. internal ProcessInputEventArgs() {} //////
///- ///
////// - ///
////// /// Critical - calls a critical method base.Reset /// [SecurityCritical] internal override void Reset(StagingAreaInputItem input, InputManager inputManager) { _allowAccessToStagingArea = true; base.Reset(input, inputManager); } ////// Pushes an input event onto the top of the staging area. /// /// /// The input event to place on the staging area. This may not /// be null, and may not already exist in the staging area. /// /// /// An existing staging area item to promote the state from. /// ////// The staging area input item that wraps the specified input. /// ////// Callers must have UIPermission(PermissionState.Unrestricted) to call this API. /// ////// Critical - calls a critical method ( PushInput) /// PublicOK - there is a link demand for public callers. /// [SecurityCritical ] [UIPermissionAttribute(SecurityAction.LinkDemand,Unrestricted=true)] public StagingAreaInputItem PushInput(InputEventArgs input, StagingAreaInputItem promote) // Note: this should be a bool, and always use the InputItem available on these args. { if(!_allowAccessToStagingArea) { throw new InvalidOperationException(SR.Get(SRID.NotAllowedToAccessStagingArea)); } return this.UnsecureInputManager.PushInput(input, promote); } ////// Pushes an input event onto the top of the staging area. /// /// /// The input event to place on the staging area. This may not /// be null, and may not already exist in the staging area. /// ////// The specified staging area input item. /// ////// Callers must have UIPermission(PermissionState.Unrestricted) to call this API. /// ////// Critical - calls a critical method ( PushInput) /// PublicOK - there is a link demand for public callers. /// [SecurityCritical] [UIPermissionAttribute(SecurityAction.LinkDemand,Unrestricted=true)] public StagingAreaInputItem PushInput(StagingAreaInputItem input) { if(!_allowAccessToStagingArea) { throw new InvalidOperationException(SR.Get(SRID.NotAllowedToAccessStagingArea)); } return this.UnsecureInputManager.PushInput(input); } ////// Pops off the input event on the top of the staging area. /// ////// The input event that was on the top of the staging area. /// This can be null, if the staging area was empty. /// ////// Callers must have UIPermission(PermissionState.Unrestricted) to call this API. /// ////// Critical - calls a critical function ( InputManager.PopInput) /// PublicOK - there is a demand. /// [SecurityCritical] public StagingAreaInputItem PopInput() { SecurityHelper.DemandUnrestrictedUIPermission(); if(!_allowAccessToStagingArea) { throw new InvalidOperationException(SR.Get(SRID.NotAllowedToAccessStagingArea)); } return this.UnsecureInputManager.PopInput(); } ////// Returns the input event on the top of the staging area. /// ////// The input event that is on the top of the staging area. /// This can be null, if the staging area is empty. /// ////// Callers must have UIPermission(PermissionState.Unrestricted) to call this API. /// ////// Critical - accesses UnsecureInputManager /// PublicOK - there is a demand. /// [SecurityCritical] public StagingAreaInputItem PeekInput() { SecurityHelper.DemandUnrestrictedUIPermission(); if(!_allowAccessToStagingArea) { throw new InvalidOperationException(SR.Get(SRID.NotAllowedToAccessStagingArea)); } return this.UnsecureInputManager.PeekInput(); } private bool _allowAccessToStagingArea; } ////// Delegate type for handles of events that use /// public delegate void ProcessInputEventHandler(object sender, ProcessInputEventArgs e); } // 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
- TargetParameterCountException.cs
- TemplateField.cs
- TraceContextRecord.cs
- WebPartVerb.cs
- CollectionContainer.cs
- IPGlobalProperties.cs
- PolicyDesigner.cs
- Comparer.cs
- UITypeEditor.cs
- MetafileHeaderWmf.cs
- SelectionHighlightInfo.cs
- CodeGeneratorOptions.cs
- DummyDataSource.cs
- Parser.cs
- DataSet.cs
- odbcmetadatacolumnnames.cs
- _NestedMultipleAsyncResult.cs
- TextSelection.cs
- Environment.cs
- TablePattern.cs
- ProtocolsInstallComponent.cs
- ReferentialConstraint.cs
- MobileResource.cs
- WsatServiceAddress.cs
- SqlBuffer.cs
- LexicalChunk.cs
- ComplexLine.cs
- SelectionUIHandler.cs
- CodeCompileUnit.cs
- GlobalDataBindingHandler.cs
- Rectangle.cs
- XmlSchemaFacet.cs
- MaskedTextBox.cs
- ContentIterators.cs
- ProfilePropertyNameValidator.cs
- Label.cs
- DatePickerTextBox.cs
- CaseStatement.cs
- ellipse.cs
- ZipIOCentralDirectoryFileHeader.cs
- CustomWebEventKey.cs
- ResourceExpressionBuilder.cs
- RenderDataDrawingContext.cs
- ProjectionCamera.cs
- DictionaryEntry.cs
- WindowsListBox.cs
- Trace.cs
- TextMetrics.cs
- DCSafeHandle.cs
- ApplicationException.cs
- SqlDataSourceFilteringEventArgs.cs
- DesignBinding.cs
- translator.cs
- _HelperAsyncResults.cs
- SecurityTokenResolver.cs
- FlowDocument.cs
- ConditionValidator.cs
- RequiredAttributeAttribute.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- EventListenerClientSide.cs
- PerfCounterSection.cs
- ConfigurationManagerInternal.cs
- VectorKeyFrameCollection.cs
- UnsafeNativeMethods.cs
- WebPartEditorApplyVerb.cs
- XslVisitor.cs
- Descriptor.cs
- FederatedMessageSecurityOverHttpElement.cs
- WindowsAuthenticationEventArgs.cs
- AuthenticationConfig.cs
- TypePresenter.xaml.cs
- ActiveXContainer.cs
- FacetValueContainer.cs
- ClientSideProviderDescription.cs
- TableRow.cs
- HeaderCollection.cs
- TrackBar.cs
- Util.cs
- RepeatBehavior.cs
- BaseInfoTable.cs
- PageWrapper.cs
- _IPv4Address.cs
- QuotedPairReader.cs
- Graphics.cs
- WorkerRequest.cs
- SqlProviderManifest.cs
- WindowsListViewItem.cs
- _AuthenticationState.cs
- SnapshotChangeTrackingStrategy.cs
- PermissionRequestEvidence.cs
- EntityDataSourceMemberPath.cs
- ContextMenuStrip.cs
- Wizard.cs
- _NestedMultipleAsyncResult.cs
- ParseNumbers.cs
- XmlComment.cs
- DbModificationCommandTree.cs
- Soap12ProtocolImporter.cs
- Filter.cs
- PagesSection.cs