Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- XsdValidatingReader.cs
- SafeLibraryHandle.cs
- CodeGenerator.cs
- CustomAttributeBuilder.cs
- HandlerMappingMemo.cs
- PassportPrincipal.cs
- HotSpotCollection.cs
- Collection.cs
- ParameterBuilder.cs
- SafeThreadHandle.cs
- NativeMethods.cs
- EntityClientCacheEntry.cs
- WindowsAltTab.cs
- ConfigurationValue.cs
- FontStyle.cs
- CoTaskMemSafeHandle.cs
- DataColumnPropertyDescriptor.cs
- XPathNavigatorReader.cs
- DefaultValidator.cs
- CurrencyWrapper.cs
- Set.cs
- DbProviderServices.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- FormsAuthenticationCredentials.cs
- ToolStripSystemRenderer.cs
- DataKeyArray.cs
- TimeZone.cs
- HttpHeaderCollection.cs
- DataStreamFromComStream.cs
- XmlMembersMapping.cs
- Msec.cs
- TaiwanCalendar.cs
- ConditionedDesigner.cs
- ExpressionLink.cs
- _SslState.cs
- sqlstateclientmanager.cs
- DecoratedNameAttribute.cs
- XPathNodeIterator.cs
- TrackingStringDictionary.cs
- CornerRadius.cs
- FaultReason.cs
- SymDocumentType.cs
- ConfigurationLockCollection.cs
- AlphabeticalEnumConverter.cs
- PropertyRecord.cs
- SynchronousChannel.cs
- ArrayWithOffset.cs
- UnsafeNativeMethodsPenimc.cs
- WebSysDefaultValueAttribute.cs
- Splitter.cs
- TemplateControlBuildProvider.cs
- LateBoundBitmapDecoder.cs
- PointHitTestParameters.cs
- GridItemPatternIdentifiers.cs
- HandleRef.cs
- ResXDataNode.cs
- TcpChannelHelper.cs
- rsa.cs
- itemelement.cs
- ValidationSummaryDesigner.cs
- UnsafeNativeMethods.cs
- NavigationHelper.cs
- ToolStripSettings.cs
- DataGridViewCellLinkedList.cs
- CodeDirectiveCollection.cs
- StringArrayConverter.cs
- XmlBinaryReaderSession.cs
- UnmanagedMemoryAccessor.cs
- XslUrlEditor.cs
- TextCollapsingProperties.cs
- SynchronizationLockException.cs
- PersonalizablePropertyEntry.cs
- HttpServerVarsCollection.cs
- FormViewDeleteEventArgs.cs
- AnnotationHighlightLayer.cs
- Interlocked.cs
- TaskExceptionHolder.cs
- Globals.cs
- RangeValidator.cs
- CodeDomLoader.cs
- AttributeProviderAttribute.cs
- OpenTypeLayoutCache.cs
- TraceSource.cs
- FrameworkRichTextComposition.cs
- CatalogPart.cs
- EntityAdapter.cs
- JavascriptCallbackMessageInspector.cs
- Section.cs
- TemplatedMailWebEventProvider.cs
- FixedHyperLink.cs
- TextSegment.cs
- AuthenticatingEventArgs.cs
- NativeMethods.cs
- TransformPattern.cs
- MouseEventArgs.cs
- printdlgexmarshaler.cs
- CharacterBuffer.cs
- MenuTracker.cs
- ComponentDispatcher.cs
- hresults.cs