Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Core / CSharp / System / Windows / InterOp / CursorInteropHelper.cs / 1 / CursorInteropHelper.cs
//---------------------------------------------------------------------------- // // File: CursorInteropHelper.cs // // Description: Implements Avalon CursorInteropHelper class, which helps // interop b/w Cursor handles and Avalon Cursor objects. // // Copyright (C) 2005 by Microsoft Corporation. All rights reserved. // // History: // 06/30/05 jdmack Created //--------------------------------------------------------------------------- using System; using System.Runtime.InteropServices; using System.Security; using System.Windows.Input; using MS.Internal.PresentationCore; // SecurityHelper namespace System.Windows.Interop { #region class CursorInteropHelper ////// Implements Avalon CursorInteropHelper classes, which helps /// interop b/w legacy Cursor handles and Avalon Cursor objects. /// public static class CursorInteropHelper { //--------------------------------------------------- // // Public Methods // //--------------------------------------------------- #region Public Methods ////// Creates a Cursor from a SafeHandle to a native Win32 Cursor /// /// /// SafeHandle to a native Win32 cursor /// ////// Callers must have UIPermission(UIPermissionWindow.AllWindows) to call this API. /// ////// Critical: This causes the cursor to change and accesses the SetHandleInternalMethod /// PublicOK: There is a demand. /// [SecurityCritical ] public static Cursor Create(SafeHandle cursorHandle) { SecurityHelper.DemandUIWindowPermission(); return CriticalCreate(cursorHandle); } #endregion Public Methods //---------------------------------------------------- // // Internal Methods // //--------------------------------------------------- #region Internal Methods ////// Creates a Cursor from a SafeHandle to a native Win32 Cursor /// /// /// SafeHandle to a native Win32 cursor /// ////// Critical: This causes the cursor to change and accesses the SetHandleInternalMethod /// [FriendAccessAllowed] [SecurityCritical] internal static Cursor CriticalCreate(SafeHandle cursorHandle) { return new Cursor(cursorHandle); } #endregion Internal Methods } #endregion class CursorInteropHelper } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // File: CursorInteropHelper.cs // // Description: Implements Avalon CursorInteropHelper class, which helps // interop b/w Cursor handles and Avalon Cursor objects. // // Copyright (C) 2005 by Microsoft Corporation. All rights reserved. // // History: // 06/30/05 jdmack Created //--------------------------------------------------------------------------- using System; using System.Runtime.InteropServices; using System.Security; using System.Windows.Input; using MS.Internal.PresentationCore; // SecurityHelper namespace System.Windows.Interop { #region class CursorInteropHelper ////// Implements Avalon CursorInteropHelper classes, which helps /// interop b/w legacy Cursor handles and Avalon Cursor objects. /// public static class CursorInteropHelper { //--------------------------------------------------- // // Public Methods // //--------------------------------------------------- #region Public Methods ////// Creates a Cursor from a SafeHandle to a native Win32 Cursor /// /// /// SafeHandle to a native Win32 cursor /// ////// Callers must have UIPermission(UIPermissionWindow.AllWindows) to call this API. /// ////// Critical: This causes the cursor to change and accesses the SetHandleInternalMethod /// PublicOK: There is a demand. /// [SecurityCritical ] public static Cursor Create(SafeHandle cursorHandle) { SecurityHelper.DemandUIWindowPermission(); return CriticalCreate(cursorHandle); } #endregion Public Methods //---------------------------------------------------- // // Internal Methods // //--------------------------------------------------- #region Internal Methods ////// Creates a Cursor from a SafeHandle to a native Win32 Cursor /// /// /// SafeHandle to a native Win32 cursor /// ////// Critical: This causes the cursor to change and accesses the SetHandleInternalMethod /// [FriendAccessAllowed] [SecurityCritical] internal static Cursor CriticalCreate(SafeHandle cursorHandle) { return new Cursor(cursorHandle); } #endregion Internal Methods } #endregion class CursorInteropHelper } // 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
- QueryStringHandler.cs
- CommentAction.cs
- DbQueryCommandTree.cs
- FormsAuthenticationModule.cs
- TransactionWaitAsyncResult.cs
- MaskedTextProvider.cs
- PropertyGridView.cs
- MessageAction.cs
- Color.cs
- HtmlContainerControl.cs
- NullableFloatMinMaxAggregationOperator.cs
- AssemblyBuilder.cs
- CompilationSection.cs
- CompiledRegexRunner.cs
- MaterialGroup.cs
- SmtpNtlmAuthenticationModule.cs
- XmlTypeMapping.cs
- SetIterators.cs
- ComponentEvent.cs
- CharacterHit.cs
- DataObjectMethodAttribute.cs
- XmlElementAttribute.cs
- SurrogateSelector.cs
- PartManifestEntry.cs
- UnknownBitmapDecoder.cs
- SafeNativeMethods.cs
- MatrixTransform3D.cs
- SessionStateUtil.cs
- GroupItem.cs
- AuthenticationSection.cs
- FileDialog.cs
- TokenBasedSet.cs
- LinearKeyFrames.cs
- FormsIdentity.cs
- Int32.cs
- ControlPersister.cs
- LogicalExpressionEditor.cs
- UiaCoreApi.cs
- MembershipSection.cs
- AttributeEmitter.cs
- IdnMapping.cs
- TypedReference.cs
- DotExpr.cs
- DataServiceHostFactory.cs
- ScrollEventArgs.cs
- followingquery.cs
- GridViewColumnCollection.cs
- TextTreeDeleteContentUndoUnit.cs
- IDispatchConstantAttribute.cs
- CommandID.cs
- TraceUtils.cs
- MatrixTransform.cs
- WebHttpElement.cs
- AnimationException.cs
- CalendarAutoFormat.cs
- DataServiceConfiguration.cs
- KeyEventArgs.cs
- TriggerAction.cs
- DropSource.cs
- ReachPrintTicketSerializer.cs
- VideoDrawing.cs
- ClientSession.cs
- SafeFileMappingHandle.cs
- SchemaEntity.cs
- PagePropertiesChangingEventArgs.cs
- XmlBoundElement.cs
- Wow64ConfigurationLoader.cs
- RectangleHotSpot.cs
- X509Chain.cs
- ObjectViewFactory.cs
- MatrixCamera.cs
- XsltFunctions.cs
- ADMembershipProvider.cs
- ListView.cs
- WinFormsComponentEditor.cs
- Membership.cs
- Point3DAnimationBase.cs
- BitmapScalingModeValidation.cs
- MbpInfo.cs
- AttachedPropertyMethodSelector.cs
- RegexBoyerMoore.cs
- ComponentDispatcher.cs
- XmlSerializerVersionAttribute.cs
- EventSourceCreationData.cs
- DesignerTextViewAdapter.cs
- CodeObjectCreateExpression.cs
- GAC.cs
- WebHttpBindingElement.cs
- StateMachineAction.cs
- SqlTriggerContext.cs
- OutputCacheSection.cs
- SerialErrors.cs
- StateMachineWorkflowInstance.cs
- ViewBase.cs
- XmlSchemaChoice.cs
- Setter.cs
- PropertyStore.cs
- SemaphoreSlim.cs
- GenericAuthenticationEventArgs.cs
- OrderingQueryOperator.cs