Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / InterOp / CursorInteropHelper.cs / 1305600 / 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 SecurityHelper=MS.Internal.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 /// [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 SecurityHelper=MS.Internal.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 /// [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
- XmlReturnWriter.cs
- UndirectedGraph.cs
- SpoolingTaskBase.cs
- SecurityNegotiationException.cs
- TextEditorTyping.cs
- ControlPaint.cs
- DCSafeHandle.cs
- StringConcat.cs
- HtmlTableRow.cs
- LinkClickEvent.cs
- NetworkInformationException.cs
- DynamicRendererThreadManager.cs
- ScrollItemPattern.cs
- DebuggerAttributes.cs
- FileRecordSequenceCompletedAsyncResult.cs
- ChildTable.cs
- SchemaContext.cs
- CapabilitiesPattern.cs
- GridViewRow.cs
- SspiSafeHandles.cs
- StateDesigner.TransitionInfo.cs
- FontFaceLayoutInfo.cs
- SqlMetaData.cs
- CodeTypeReferenceExpression.cs
- IndentedWriter.cs
- Timer.cs
- TileBrush.cs
- TextWriterEngine.cs
- RootBrowserWindow.cs
- DataKeyCollection.cs
- HtmlPhoneCallAdapter.cs
- VersionedStream.cs
- RecipientInfo.cs
- SystemIPv6InterfaceProperties.cs
- SafeProcessHandle.cs
- ScriptRegistrationManager.cs
- PersonalizationStateQuery.cs
- EventManager.cs
- _LocalDataStoreMgr.cs
- _SslState.cs
- ByteStreamGeometryContext.cs
- Timer.cs
- BuilderPropertyEntry.cs
- MasterPageBuildProvider.cs
- TokenBasedSetEnumerator.cs
- EmbeddedMailObject.cs
- ToolStripGripRenderEventArgs.cs
- CacheAxisQuery.cs
- XmlSerializerNamespaces.cs
- PropertyGridCommands.cs
- WebPartManager.cs
- BindStream.cs
- BaseDataBoundControl.cs
- MSHTMLHostUtil.cs
- RootBrowserWindowProxy.cs
- StreamUpdate.cs
- DataServiceEntityAttribute.cs
- ProvideValueServiceProvider.cs
- X509ChainElement.cs
- CodeObjectCreateExpression.cs
- CapabilitiesSection.cs
- WindowsTitleBar.cs
- LogLogRecordHeader.cs
- NamedPipeProcessProtocolHandler.cs
- PropertyEntry.cs
- FormViewModeEventArgs.cs
- SqlProcedureAttribute.cs
- OleDbTransaction.cs
- EditorBrowsableAttribute.cs
- ConfigurationElement.cs
- ProjectionCamera.cs
- TextRangeEditTables.cs
- ProfilePropertyNameValidator.cs
- DataContractSerializerSection.cs
- ModifierKeysValueSerializer.cs
- SplashScreen.cs
- ReliableChannelListener.cs
- CompositeDataBoundControl.cs
- GridViewItemAutomationPeer.cs
- BaseTemplateBuildProvider.cs
- ExpressionPrefixAttribute.cs
- WebPartEditorApplyVerb.cs
- Point.cs
- HMACMD5.cs
- listitem.cs
- TextBlock.cs
- UIAgentAsyncBeginRequest.cs
- StylusPointProperty.cs
- TargetFrameworkAttribute.cs
- XmlDomTextWriter.cs
- DynamicPropertyReader.cs
- GenericTypeParameterBuilder.cs
- ColorTransform.cs
- SoapClientProtocol.cs
- SpeechDetectedEventArgs.cs
- cookiecontainer.cs
- BitmapEffectGroup.cs
- SqlSupersetValidator.cs
- DbProviderFactory.cs
- ExtenderHelpers.cs