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
- PropertyDescriptor.cs
- sqlser.cs
- _SafeNetHandles.cs
- SafeLibraryHandle.cs
- MTConfigUtil.cs
- DefaultValueTypeConverter.cs
- TextTreeInsertElementUndoUnit.cs
- QEncodedStream.cs
- PageHandlerFactory.cs
- Italic.cs
- FixedSOMGroup.cs
- Thumb.cs
- Pkcs7Recipient.cs
- CacheEntry.cs
- validation.cs
- ExtensionSimplifierMarkupObject.cs
- ThreadTrace.cs
- HttpCachePolicyElement.cs
- TypeViewSchema.cs
- EventArgs.cs
- CompilerCollection.cs
- ResizeGrip.cs
- LambdaExpression.cs
- TemplateControlBuildProvider.cs
- VerificationException.cs
- HtmlUtf8RawTextWriter.cs
- SelectionRangeConverter.cs
- RegexRunnerFactory.cs
- XamlSerializationHelper.cs
- ListViewUpdateEventArgs.cs
- DataGridViewTopRowAccessibleObject.cs
- CodeAttributeArgument.cs
- CharacterBuffer.cs
- NetSectionGroup.cs
- OleDbConnectionFactory.cs
- HtmlUtf8RawTextWriter.cs
- PasswordTextContainer.cs
- SyndicationDeserializer.cs
- DependentList.cs
- COSERVERINFO.cs
- BigInt.cs
- IsolatedStorageFile.cs
- SelectorAutomationPeer.cs
- BreakRecordTable.cs
- smtppermission.cs
- Attributes.cs
- HMACSHA1.cs
- InkCanvasInnerCanvas.cs
- SQLBoolean.cs
- Oid.cs
- Pointer.cs
- ResourcesBuildProvider.cs
- BooleanFunctions.cs
- LinkButton.cs
- UnsignedPublishLicense.cs
- System.Data_BID.cs
- WebServiceMethodData.cs
- WsatServiceCertificate.cs
- ResourcePool.cs
- OdbcReferenceCollection.cs
- DoubleCollection.cs
- SizeAnimation.cs
- TdsParser.cs
- DataServiceKeyAttribute.cs
- GPRECT.cs
- Rijndael.cs
- DictionaryBase.cs
- ObjectSet.cs
- MsmqIntegrationProcessProtocolHandler.cs
- ProfileServiceManager.cs
- HashCoreRequest.cs
- OleAutBinder.cs
- MatrixValueSerializer.cs
- SpellerStatusTable.cs
- AttachedPropertyBrowsableAttribute.cs
- TransformConverter.cs
- AccessViolationException.cs
- LingerOption.cs
- Graphics.cs
- ImmutableCollection.cs
- TextServicesProperty.cs
- EditorZoneAutoFormat.cs
- SecurityDescriptor.cs
- XmlSchemaImport.cs
- ClusterRegistryConfigurationProvider.cs
- XmlEnumAttribute.cs
- InvalidComObjectException.cs
- SizeConverter.cs
- assemblycache.cs
- TextServicesDisplayAttribute.cs
- DataGridItem.cs
- WebBaseEventKeyComparer.cs
- AsyncDataRequest.cs
- UIElementParaClient.cs
- SelectionItemPattern.cs
- InsufficientMemoryException.cs
- XmlWellformedWriter.cs
- HtmlTitle.cs
- DesignBindingEditor.cs
- sitestring.cs