Code:
/ 4.0 / 4.0 / 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.
//----------------------------------------------------------------------------
//
// 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
- SqlDataSourceCache.cs
- SkinBuilder.cs
- CmsInterop.cs
- CheckBoxPopupAdapter.cs
- X509ChainPolicy.cs
- WhitespaceReader.cs
- unsafenativemethodsother.cs
- DataExpression.cs
- CodeNamespaceImportCollection.cs
- ForceCopyBuildProvider.cs
- LingerOption.cs
- OdbcConnectionOpen.cs
- GroupItemAutomationPeer.cs
- _SingleItemRequestCache.cs
- dtdvalidator.cs
- ReflectionUtil.cs
- smtpconnection.cs
- DispatcherExceptionFilterEventArgs.cs
- configsystem.cs
- UIAgentAsyncBeginRequest.cs
- StylusButtonEventArgs.cs
- SubMenuStyleCollectionEditor.cs
- OrderingQueryOperator.cs
- ValueChangedEventManager.cs
- SafeHandles.cs
- CompositionAdorner.cs
- Rotation3DAnimation.cs
- ComponentDispatcherThread.cs
- BehaviorEditorPart.cs
- GenericWebPart.cs
- SqlTypesSchemaImporter.cs
- SimpleApplicationHost.cs
- ErrorLog.cs
- Accessible.cs
- ParameterCollection.cs
- BinaryMethodMessage.cs
- FontWeightConverter.cs
- PointAnimationUsingKeyFrames.cs
- ChtmlTextWriter.cs
- VariableBinder.cs
- SimpleType.cs
- Package.cs
- Message.cs
- FieldMetadata.cs
- SQlBooleanStorage.cs
- FaultPropagationRecord.cs
- RootProjectionNode.cs
- SQLBoolean.cs
- ReachDocumentPageSerializer.cs
- QilLoop.cs
- EventsTab.cs
- BaseCodePageEncoding.cs
- KeyFrames.cs
- LicenseException.cs
- SHA256CryptoServiceProvider.cs
- SelectManyQueryOperator.cs
- Control.cs
- JavaScriptObjectDeserializer.cs
- UncommonField.cs
- SimpleTextLine.cs
- VerticalAlignConverter.cs
- XmlSchemaComplexContent.cs
- ResourceExpressionBuilder.cs
- XmlSortKeyAccumulator.cs
- Model3D.cs
- XmlSchemaDocumentation.cs
- WebHttpBehavior.cs
- EntityDataSourceStatementEditor.cs
- HotSpot.cs
- EndpointConfigContainer.cs
- EventHandlingScope.cs
- FigureParaClient.cs
- Msmq4PoisonHandler.cs
- FileUtil.cs
- SingleSelectRootGridEntry.cs
- ElementNotEnabledException.cs
- MessageAction.cs
- StorageEntityTypeMapping.cs
- ToolStripItemCollection.cs
- ObjectDataSourceSelectingEventArgs.cs
- XmlExpressionDumper.cs
- CodeThrowExceptionStatement.cs
- __ComObject.cs
- UpdateCompiler.cs
- KerberosSecurityTokenAuthenticator.cs
- BlurBitmapEffect.cs
- PropertyChangeTracker.cs
- XmlQueryRuntime.cs
- XXXInfos.cs
- BindingBase.cs
- VisualBasic.cs
- XmlDictionaryReader.cs
- BuildResultCache.cs
- WebPartCancelEventArgs.cs
- UnauthorizedWebPart.cs
- ReferentialConstraint.cs
- FocusChangedEventArgs.cs
- CryptographicAttribute.cs
- RegexCompiler.cs
- SchemaNames.cs