Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / InterOp / CursorInteropHelper.cs / 1305600 / 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 SecurityHelper=MS.Internal.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
///
[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
- Base64Decoder.cs
- ComponentTray.cs
- CustomValidator.cs
- MachineSettingsSection.cs
- SafeNativeMemoryHandle.cs
- HttpPostedFile.cs
- CornerRadiusConverter.cs
- AttributeCallbackBuilder.cs
- DuplicateWaitObjectException.cs
- PackageRelationshipCollection.cs
- QueryPageSettingsEventArgs.cs
- OrderingInfo.cs
- TableLayoutStyleCollection.cs
- RecommendedAsConfigurableAttribute.cs
- BamlRecordWriter.cs
- SecurityException.cs
- _Connection.cs
- TileModeValidation.cs
- TextWriterTraceListener.cs
- PenContexts.cs
- ZipIOModeEnforcingStream.cs
- FilteredSchemaElementLookUpTable.cs
- XmlSchemaObjectTable.cs
- SessionEndingCancelEventArgs.cs
- KeyEvent.cs
- ObjectSet.cs
- TransactionFlowElement.cs
- BStrWrapper.cs
- TypeExtension.cs
- HitTestDrawingContextWalker.cs
- SecurityTokenRequirement.cs
- ZipPackage.cs
- Compiler.cs
- ApplicationInfo.cs
- SafeEventHandle.cs
- AttributeData.cs
- HttpInputStream.cs
- AtomMaterializerLog.cs
- UIAgentMonitorHandle.cs
- Error.cs
- GlyphRunDrawing.cs
- GeometryModel3D.cs
- HtmlInputPassword.cs
- VectorAnimationUsingKeyFrames.cs
- ToolStripRenderEventArgs.cs
- Switch.cs
- DataControlFieldHeaderCell.cs
- Helper.cs
- ArraySet.cs
- ControlsConfig.cs
- PatternMatcher.cs
- PbrsForward.cs
- TextUtf8RawTextWriter.cs
- SizeLimitedCache.cs
- HeaderedItemsControl.cs
- MetadataUtil.cs
- RepeatBehavior.cs
- Error.cs
- GridViewCommandEventArgs.cs
- CompilationUtil.cs
- BuildManagerHost.cs
- DataGridViewHitTestInfo.cs
- ObservableDictionary.cs
- DisplayNameAttribute.cs
- LinqDataSourceContextData.cs
- PropertySegmentSerializationProvider.cs
- Interlocked.cs
- VisualProxy.cs
- HttpApplicationFactory.cs
- GeometryHitTestParameters.cs
- SafeBitVector32.cs
- WindowVisualStateTracker.cs
- Hyperlink.cs
- BitmapEffectDrawingContextWalker.cs
- DrawingBrush.cs
- TextEditorLists.cs
- OleAutBinder.cs
- StringUtil.cs
- BinaryObjectInfo.cs
- CodeExporter.cs
- SafeArrayTypeMismatchException.cs
- RadialGradientBrush.cs
- CommonDialog.cs
- Array.cs
- StreamWriter.cs
- DataRelationPropertyDescriptor.cs
- PenCursorManager.cs
- WebServiceBindingAttribute.cs
- _DigestClient.cs
- ILGenerator.cs
- DataGridViewCellStateChangedEventArgs.cs
- KeyboardDevice.cs
- EventBindingService.cs
- XmlExpressionDumper.cs
- SafeFreeMibTable.cs
- VerificationAttribute.cs
- PersonalizationProvider.cs
- DuplicateWaitObjectException.cs
- CustomErrorsSection.cs
- CfgArc.cs