Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- CollectionViewSource.cs
- ContextMarshalException.cs
- MobileRedirect.cs
- QuadraticBezierSegment.cs
- QueryStringParameter.cs
- AssemblyNameProxy.cs
- ListViewItemMouseHoverEvent.cs
- ExceptionTrace.cs
- VariableQuery.cs
- PanelStyle.cs
- SimpleHandlerFactory.cs
- ConditionChanges.cs
- PairComparer.cs
- PartialToken.cs
- ListViewSelectEventArgs.cs
- DbXmlEnabledProviderManifest.cs
- ObjectDataSourceStatusEventArgs.cs
- BitmapData.cs
- DataGridViewElement.cs
- VectorCollectionConverter.cs
- Int16.cs
- References.cs
- ProcessHost.cs
- IssuedTokensHeader.cs
- DataListItemEventArgs.cs
- SqlTriggerContext.cs
- ScaleTransform3D.cs
- RepeaterItem.cs
- SafeRightsManagementPubHandle.cs
- AttributeCollection.cs
- ImageFormatConverter.cs
- MimeMapping.cs
- DateRangeEvent.cs
- InputScopeAttribute.cs
- SessionIDManager.cs
- TTSEngineProxy.cs
- PageContentCollection.cs
- Object.cs
- ZipIOLocalFileHeader.cs
- Parsers.cs
- Transform.cs
- EnvelopedSignatureTransform.cs
- SignatureToken.cs
- InstanceDataCollection.cs
- ThreadStartException.cs
- FileInfo.cs
- PolyLineSegment.cs
- DynamicQueryableWrapper.cs
- EntityReference.cs
- InternalConfigRoot.cs
- GridViewEditEventArgs.cs
- SslStream.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- TextPointer.cs
- Positioning.cs
- RootProfilePropertySettingsCollection.cs
- IssuedSecurityTokenParameters.cs
- StackSpiller.Temps.cs
- AppDomain.cs
- WebPartDeleteVerb.cs
- DbParameterCollection.cs
- HtmlUtf8RawTextWriter.cs
- Icon.cs
- FamilyMap.cs
- XmlSchemaSubstitutionGroup.cs
- DateRangeEvent.cs
- PassportAuthenticationModule.cs
- PointAnimationUsingPath.cs
- TimeSpanSecondsConverter.cs
- EncryptedReference.cs
- TypeConvertions.cs
- GifBitmapDecoder.cs
- Pair.cs
- SystemIcons.cs
- RtfToken.cs
- CompareValidator.cs
- Viewport3DVisual.cs
- SamlDoNotCacheCondition.cs
- BitmapEffectInputData.cs
- NativeMethods.cs
- ByteStorage.cs
- FunctionImportMapping.ReturnTypeRenameMapping.cs
- Vector3DCollectionConverter.cs
- PolicyStatement.cs
- EntityCollectionChangedParams.cs
- ContainsRowNumberChecker.cs
- FakeModelPropertyImpl.cs
- StorageMappingFragment.cs
- SmiGettersStream.cs
- InkPresenterAutomationPeer.cs
- NoneExcludedImageIndexConverter.cs
- EmbeddedMailObjectCollectionEditor.cs
- TextRangeAdaptor.cs
- X509CertificateTrustedIssuerElement.cs
- FunctionImportMapping.cs
- StatusBarItem.cs
- CryptoProvider.cs
- MatrixAnimationUsingPath.cs
- AutoGeneratedField.cs
- ColumnMapVisitor.cs