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
- StateItem.cs
- AffineTransform3D.cs
- UserCancellationException.cs
- SerializationEventsCache.cs
- WebEventCodes.cs
- RequestBringIntoViewEventArgs.cs
- NonSerializedAttribute.cs
- SharedRuntimeState.cs
- IProvider.cs
- ElementHost.cs
- GenericsInstances.cs
- FaultConverter.cs
- CodeMemberProperty.cs
- DataGridViewRowCollection.cs
- SafeSecurityHandles.cs
- DataRowCollection.cs
- WebPartConnection.cs
- QilName.cs
- UpdateCommand.cs
- TextServicesPropertyRanges.cs
- AbandonedMutexException.cs
- MatchAttribute.cs
- AdCreatedEventArgs.cs
- CuspData.cs
- InheritanceContextChangedEventManager.cs
- ObjectAssociationEndMapping.cs
- KeyGestureConverter.cs
- CalendarDateChangedEventArgs.cs
- PublisherMembershipCondition.cs
- MetaTableHelper.cs
- Timeline.cs
- ThumbAutomationPeer.cs
- StringTraceRecord.cs
- OleDbDataAdapter.cs
- SourceElementsCollection.cs
- ParseHttpDate.cs
- TextViewDesigner.cs
- BounceEase.cs
- ParallelActivityDesigner.cs
- UnsafeNativeMethodsMilCoreApi.cs
- XpsSerializationManagerAsync.cs
- RectConverter.cs
- OracleBoolean.cs
- Section.cs
- IInstanceTable.cs
- ObjectSet.cs
- CacheVirtualItemsEvent.cs
- TcpSocketManager.cs
- TextContainerHelper.cs
- SwitchExpression.cs
- XmlSchemaComplexContentExtension.cs
- XmlReader.cs
- GeometryDrawing.cs
- NetMsmqSecurity.cs
- EndOfStreamException.cs
- HMAC.cs
- x509store.cs
- GraphicsPathIterator.cs
- SafeFindHandle.cs
- PageSetupDialog.cs
- ContextToken.cs
- GridViewPageEventArgs.cs
- ConnectionsZone.cs
- LayoutTable.cs
- TraceSwitch.cs
- CollectionViewSource.cs
- WebException.cs
- DeobfuscatingStream.cs
- XmlQueryContext.cs
- PageContentAsyncResult.cs
- CatalogPartCollection.cs
- TraceSection.cs
- CommonGetThemePartSize.cs
- ButtonRenderer.cs
- RegexFCD.cs
- SpecularMaterial.cs
- NativeBuffer.cs
- SqlProfileProvider.cs
- ColorTransform.cs
- LinqTreeNodeEvaluator.cs
- PersistenceProviderFactory.cs
- ExpressionLexer.cs
- ModelFunction.cs
- StatusBar.cs
- UpdatableWrapper.cs
- CollectionContainer.cs
- ServiceHttpModule.cs
- TextSchema.cs
- MatrixAnimationUsingPath.cs
- SqlDependencyUtils.cs
- DataGridColumn.cs
- DataDocumentXPathNavigator.cs
- PlatformNotSupportedException.cs
- BackStopAuthenticationModule.cs
- ElementNotEnabledException.cs
- Validator.cs
- FileRecordSequenceCompletedAsyncResult.cs
- RegexCharClass.cs
- EntityContainerRelationshipSet.cs
- Path.cs