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
- _OSSOCK.cs
- SqlDataSourceRefreshSchemaForm.cs
- DelegateHelpers.cs
- ParenthesizePropertyNameAttribute.cs
- ResumeStoryboard.cs
- counter.cs
- BitmapEffectDrawingContent.cs
- DropShadowBitmapEffect.cs
- BooleanKeyFrameCollection.cs
- PartialTrustVisibleAssembliesSection.cs
- TrackingServices.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- DocumentEventArgs.cs
- SelectionPattern.cs
- SiteMapNodeItemEventArgs.cs
- IgnoreDeviceFilterElementCollection.cs
- Point3DKeyFrameCollection.cs
- ToolStripLabel.cs
- CounterSample.cs
- SqlClientWrapperSmiStream.cs
- TableLayoutColumnStyleCollection.cs
- DBDataPermission.cs
- DefaultIfEmptyQueryOperator.cs
- FixedSOMGroup.cs
- ProfilePropertySettings.cs
- Scripts.cs
- AdCreatedEventArgs.cs
- HtmlInputReset.cs
- References.cs
- AutomationElement.cs
- WorkflowInstanceContextProvider.cs
- HashCodeCombiner.cs
- XmlSchemaDocumentation.cs
- ResourcePool.cs
- BuildProvider.cs
- RegisteredScript.cs
- OneOfElement.cs
- SubpageParagraph.cs
- EntityProviderFactory.cs
- WorkflowRequestContext.cs
- PartManifestEntry.cs
- ValidationSummary.cs
- DynamicEntity.cs
- ConditionalExpression.cs
- ModulesEntry.cs
- DataGridViewRowHeaderCell.cs
- XmlDataSourceNodeDescriptor.cs
- CallbackValidator.cs
- Literal.cs
- SerTrace.cs
- WriteFileContext.cs
- RootAction.cs
- CodeThrowExceptionStatement.cs
- AgileSafeNativeMemoryHandle.cs
- StyleReferenceConverter.cs
- AttachmentService.cs
- DataKeyArray.cs
- DbBuffer.cs
- DataObject.cs
- ClientRoleProvider.cs
- MetadataAssemblyHelper.cs
- InfoCardProofToken.cs
- ReadOnlyPermissionSet.cs
- ImageCollectionEditor.cs
- DataGridViewRowCollection.cs
- EntityWithChangeTrackerStrategy.cs
- AsyncResult.cs
- TextViewSelectionProcessor.cs
- CallbackHandler.cs
- ChangeConflicts.cs
- AsymmetricKeyExchangeDeformatter.cs
- SAPIEngineTypes.cs
- TableLayout.cs
- SerializationObjectManager.cs
- SignerInfo.cs
- XmlException.cs
- RelatedEnd.cs
- SamlAuthorizationDecisionStatement.cs
- CodeCastExpression.cs
- WorkflowOperationInvoker.cs
- CompilerWrapper.cs
- FullTextState.cs
- TreeIterator.cs
- ThousandthOfEmRealDoubles.cs
- NodeFunctions.cs
- TakeQueryOptionExpression.cs
- TiffBitmapEncoder.cs
- UshortList2.cs
- InteropTrackingRecord.cs
- ObjectListSelectEventArgs.cs
- XmlNodeChangedEventManager.cs
- SequenceNumber.cs
- RegexBoyerMoore.cs
- TrackingConditionCollection.cs
- EditableTreeList.cs
- CollaborationHelperFunctions.cs
- TraceFilter.cs
- PreProcessInputEventArgs.cs
- NamespaceQuery.cs
- TrackPoint.cs