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
- TypeTypeConverter.cs
- OleDbReferenceCollection.cs
- ToolBar.cs
- DesignOnlyAttribute.cs
- UserPersonalizationStateInfo.cs
- ByteFacetDescriptionElement.cs
- xml.cs
- DiscoveryServerProtocol.cs
- NativeRightsManagementAPIsStructures.cs
- TextBoxAutoCompleteSourceConverter.cs
- ListViewVirtualItemsSelectionRangeChangedEvent.cs
- PermissionListSet.cs
- EditorPart.cs
- RtfControls.cs
- TimeSpanOrInfiniteConverter.cs
- RequestQueryProcessor.cs
- Vector3DKeyFrameCollection.cs
- CheckBoxAutomationPeer.cs
- RecordBuilder.cs
- _RequestCacheProtocol.cs
- CodeComment.cs
- UIElement.cs
- GPPOINTF.cs
- ArraySubsetEnumerator.cs
- DictionaryKeyPropertyAttribute.cs
- Vector3DConverter.cs
- diagnosticsswitches.cs
- DetailsViewInsertEventArgs.cs
- CheckBoxBaseAdapter.cs
- NativeMethods.cs
- PropertyDescriptorCollection.cs
- DesignerHierarchicalDataSourceView.cs
- AuthenticatingEventArgs.cs
- RectConverter.cs
- TablePattern.cs
- CrossContextChannel.cs
- QuaternionRotation3D.cs
- GradientBrush.cs
- EncryptedKeyIdentifierClause.cs
- HashSet.cs
- DrawListViewSubItemEventArgs.cs
- SoapElementAttribute.cs
- Pts.cs
- JulianCalendar.cs
- ScrollBar.cs
- _LazyAsyncResult.cs
- WebPart.cs
- ICspAsymmetricAlgorithm.cs
- RuntimeVariableList.cs
- listitem.cs
- DataErrorValidationRule.cs
- ServiceX509SecurityTokenProvider.cs
- EventHandlersStore.cs
- RtfToken.cs
- EnumerableRowCollectionExtensions.cs
- DiscreteKeyFrames.cs
- ResourceReferenceExpression.cs
- StringSorter.cs
- EncryptedData.cs
- StructureChangedEventArgs.cs
- PageContentCollection.cs
- RegexTree.cs
- SelectedDatesCollection.cs
- HashAlgorithm.cs
- PageWrapper.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- ExclusiveHandleList.cs
- SelectQueryOperator.cs
- DataGridViewCellCollection.cs
- Mappings.cs
- ITextView.cs
- EditorZone.cs
- ValueChangedEventManager.cs
- GeometryHitTestParameters.cs
- Expression.cs
- CannotUnloadAppDomainException.cs
- Unit.cs
- UserUseLicenseDictionaryLoader.cs
- SerialReceived.cs
- XmlImplementation.cs
- AppModelKnownContentFactory.cs
- documentsequencetextview.cs
- TabControlAutomationPeer.cs
- JournalNavigationScope.cs
- ProviderCollection.cs
- TextParentUndoUnit.cs
- ParallelLoopState.cs
- DataBindingHandlerAttribute.cs
- ProviderBase.cs
- WeakReadOnlyCollection.cs
- TileModeValidation.cs
- LoginUtil.cs
- RequestBringIntoViewEventArgs.cs
- TextParagraph.cs
- PEFileReader.cs
- TransformValueSerializer.cs
- XslException.cs
- PointValueSerializer.cs
- DataBindEngine.cs
- WebBrowserEvent.cs