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
- WebPartZone.cs
- sitestring.cs
- StringComparer.cs
- AssemblyBuilder.cs
- DataSourceControl.cs
- Mappings.cs
- ControlBuilderAttribute.cs
- SizeLimitedCache.cs
- NullPackagingPolicy.cs
- ProcessProtocolHandler.cs
- DocumentEventArgs.cs
- CookieParameter.cs
- TrimSurroundingWhitespaceAttribute.cs
- HtmlDocument.cs
- GcSettings.cs
- StorageComplexPropertyMapping.cs
- XmlMemberMapping.cs
- CodeStatementCollection.cs
- DbConnectionPoolIdentity.cs
- GridViewCommandEventArgs.cs
- TemplateParser.cs
- ItemContainerProviderWrapper.cs
- RestHandler.cs
- CompilerErrorCollection.cs
- RevocationPoint.cs
- DeferredReference.cs
- CustomError.cs
- XhtmlBasicLinkAdapter.cs
- LocalizationComments.cs
- GridViewItemAutomationPeer.cs
- SqlCacheDependencyDatabase.cs
- ReferentialConstraint.cs
- Selector.cs
- MenuItemBinding.cs
- PageCatalogPart.cs
- HMAC.cs
- NavigationPropertySingletonExpression.cs
- ListViewDeleteEventArgs.cs
- HtmlTextArea.cs
- ExpressionPrefixAttribute.cs
- RtfToXamlReader.cs
- SmtpNtlmAuthenticationModule.cs
- ObjectItemCachedAssemblyLoader.cs
- PathFigureCollectionConverter.cs
- GridViewRowCollection.cs
- TableLayoutColumnStyleCollection.cs
- FormatterServices.cs
- WindowsHyperlink.cs
- ControlAdapter.cs
- XPathDocument.cs
- PenThreadPool.cs
- SmiEventSink_DeferedProcessing.cs
- ReflectionPermission.cs
- ReferentialConstraint.cs
- ComponentEvent.cs
- ProcessHostMapPath.cs
- linebase.cs
- SignatureToken.cs
- WebPermission.cs
- ResourceDictionaryCollection.cs
- AccessText.cs
- HttpAsyncResult.cs
- SqlNodeAnnotations.cs
- DefaultSection.cs
- State.cs
- CheckBoxField.cs
- InternalConfigSettingsFactory.cs
- Module.cs
- ChangesetResponse.cs
- DataControlCommands.cs
- TypeDelegator.cs
- RegexInterpreter.cs
- WorkflowRuntimeEndpoint.cs
- PropertyEmitterBase.cs
- HttpBufferlessInputStream.cs
- HyperLinkField.cs
- KnownColorTable.cs
- RenderContext.cs
- DropSource.cs
- NetworkInterface.cs
- XmlSchemaValidationException.cs
- HttpBrowserCapabilitiesWrapper.cs
- EntryWrittenEventArgs.cs
- WeakRefEnumerator.cs
- TextRangeEditLists.cs
- SortExpressionBuilder.cs
- ApplicationHost.cs
- baseaxisquery.cs
- SharedStatics.cs
- AsymmetricSecurityProtocol.cs
- CaseInsensitiveComparer.cs
- ZoomPercentageConverter.cs
- CacheMode.cs
- StatusBar.cs
- WebPartCatalogCloseVerb.cs
- VisemeEventArgs.cs
- CharConverter.cs
- HexParser.cs
- DataGridRelationshipRow.cs
- Configuration.cs