Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Core / CSharp / System / Windows / Input / RawUIStateInputReport.cs / 1 / RawUIStateInputReport.cs
using System; using System.Security; using System.Security.Permissions; using MS.Internal; using MS.Win32; using System.Windows; namespace System.Windows.Input { ////// The RawUIStateInputReport class encapsulates the raw input /// provided from WM_*UISTATE* messages. /// internal class RawUIStateInputReport : InputReport { ////// Constructs an instance of the RawUIStateInputReport class. /// /// /// The input source that provided this input. /// /// /// The mode in which the input is being provided. /// /// /// The time when the input occured. /// /// /// The action being reported. /// /// /// The targets being reported. /// ////// Critical:This handles critical data in the form of PresentationSource /// TreatAsSafe:The data has demands on the property when someone tries to access it. /// [SecurityCritical,SecurityTreatAsSafe] public RawUIStateInputReport( PresentationSource inputSource, InputMode mode, int timestamp, RawUIStateActions action, RawUIStateTargets targets) : base(inputSource, InputType.Keyboard, mode, timestamp) { if (!IsValidRawUIStateAction(action)) throw new System.ComponentModel.InvalidEnumArgumentException("action", (int)action, typeof(RawUIStateActions)); if (!IsValidRawUIStateTargets(targets)) throw new System.ComponentModel.InvalidEnumArgumentException("targets", (int)targets, typeof(RawUIStateTargets)); _action = action; _targets = targets; } ////// Read-only access to the action that was reported. /// public RawUIStateActions Action {get {return _action;}} ////// Read-only access to the targets that were reported. /// public RawUIStateTargets Targets {get {return _targets;}} // IsValid Method for RawUIStateActions. internal static bool IsValidRawUIStateAction(RawUIStateActions action) { return (action == RawUIStateActions.Set || action == RawUIStateActions.Clear || action == RawUIStateActions.Initialize); } // IsValid Method for RawUIStateTargets. Relies on the enum being [Flags]. internal static bool IsValidRawUIStateTargets(RawUIStateTargets targets) { return ((targets & (RawUIStateTargets.HideFocus | RawUIStateTargets.HideAccelerators | RawUIStateTargets.Active)) == targets); } private RawUIStateActions _action; private RawUIStateTargets _targets; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; using System.Security; using System.Security.Permissions; using MS.Internal; using MS.Win32; using System.Windows; namespace System.Windows.Input { ////// The RawUIStateInputReport class encapsulates the raw input /// provided from WM_*UISTATE* messages. /// internal class RawUIStateInputReport : InputReport { ////// Constructs an instance of the RawUIStateInputReport class. /// /// /// The input source that provided this input. /// /// /// The mode in which the input is being provided. /// /// /// The time when the input occured. /// /// /// The action being reported. /// /// /// The targets being reported. /// ////// Critical:This handles critical data in the form of PresentationSource /// TreatAsSafe:The data has demands on the property when someone tries to access it. /// [SecurityCritical,SecurityTreatAsSafe] public RawUIStateInputReport( PresentationSource inputSource, InputMode mode, int timestamp, RawUIStateActions action, RawUIStateTargets targets) : base(inputSource, InputType.Keyboard, mode, timestamp) { if (!IsValidRawUIStateAction(action)) throw new System.ComponentModel.InvalidEnumArgumentException("action", (int)action, typeof(RawUIStateActions)); if (!IsValidRawUIStateTargets(targets)) throw new System.ComponentModel.InvalidEnumArgumentException("targets", (int)targets, typeof(RawUIStateTargets)); _action = action; _targets = targets; } ////// Read-only access to the action that was reported. /// public RawUIStateActions Action {get {return _action;}} ////// Read-only access to the targets that were reported. /// public RawUIStateTargets Targets {get {return _targets;}} // IsValid Method for RawUIStateActions. internal static bool IsValidRawUIStateAction(RawUIStateActions action) { return (action == RawUIStateActions.Set || action == RawUIStateActions.Clear || action == RawUIStateActions.Initialize); } // IsValid Method for RawUIStateTargets. Relies on the enum being [Flags]. internal static bool IsValidRawUIStateTargets(RawUIStateTargets targets) { return ((targets & (RawUIStateTargets.HideFocus | RawUIStateTargets.HideAccelerators | RawUIStateTargets.Active)) == targets); } private RawUIStateActions _action; private RawUIStateTargets _targets; } } // 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
- CompletedAsyncResult.cs
- SerializationInfo.cs
- HitTestResult.cs
- PTUtility.cs
- DisableDpiAwarenessAttribute.cs
- PartialList.cs
- MergablePropertyAttribute.cs
- TraceSection.cs
- BlurBitmapEffect.cs
- XmlRootAttribute.cs
- WebPartsPersonalizationAuthorization.cs
- httpserverutility.cs
- ThreadStateException.cs
- DBConnection.cs
- NameObjectCollectionBase.cs
- AffineTransform3D.cs
- ModelTreeEnumerator.cs
- PerspectiveCamera.cs
- FixUpCollection.cs
- WebPartUtil.cs
- CompoundFileIOPermission.cs
- Aggregates.cs
- MsdtcWrapper.cs
- XmlUnspecifiedAttribute.cs
- XmlElementAttribute.cs
- PropertyIDSet.cs
- InstalledVoice.cs
- ScriptServiceAttribute.cs
- Models.cs
- StreamWithDictionary.cs
- NamedElement.cs
- NotificationContext.cs
- ProcessInfo.cs
- Grant.cs
- ConnectionPointCookie.cs
- UidPropertyAttribute.cs
- HttpModuleActionCollection.cs
- VersionedStream.cs
- XmlUtil.cs
- DetailsViewCommandEventArgs.cs
- ApplicationHost.cs
- EndpointAddress.cs
- TdsValueSetter.cs
- DataGridViewDataConnection.cs
- EditorZoneBase.cs
- KeysConverter.cs
- CodePropertyReferenceExpression.cs
- _NestedSingleAsyncResult.cs
- WebConfigurationHostFileChange.cs
- Control.cs
- XPathAncestorIterator.cs
- SymbolMethod.cs
- SmiConnection.cs
- SoapInteropTypes.cs
- ShaderEffect.cs
- CommandID.cs
- PointLight.cs
- DockPanel.cs
- WebServiceErrorEvent.cs
- EntityType.cs
- IgnoreSectionHandler.cs
- RemotingAttributes.cs
- TailPinnedEventArgs.cs
- OracleInfoMessageEventArgs.cs
- DataGridViewCellValidatingEventArgs.cs
- PersonalizationEntry.cs
- CachedFontFace.cs
- ColumnPropertiesGroup.cs
- StrongNameSignatureInformation.cs
- XmlUtf8RawTextWriter.cs
- SecurityRuntime.cs
- ImpersonateTokenRef.cs
- DataGridViewColumnEventArgs.cs
- XhtmlCssHandler.cs
- PrivilegeNotHeldException.cs
- Focus.cs
- TextEditorParagraphs.cs
- Rfc2898DeriveBytes.cs
- IsolatedStorage.cs
- UIAgentInitializationException.cs
- Utils.cs
- SyndicationDeserializer.cs
- SendSecurityHeaderElementContainer.cs
- PlatformCulture.cs
- TreeViewHitTestInfo.cs
- HttpCapabilitiesBase.cs
- TemplatedWizardStep.cs
- odbcmetadatacollectionnames.cs
- KnownBoxes.cs
- AmbientEnvironment.cs
- GeneralTransform.cs
- DbParameterCollectionHelper.cs
- RijndaelCryptoServiceProvider.cs
- DefaultMemberAttribute.cs
- SHA512Managed.cs
- TdsEnums.cs
- TransactionFlowBindingElement.cs
- Timer.cs
- Rotation3D.cs
- VirtualPath.cs