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
- FormViewActionList.cs
- LogLogRecordHeader.cs
- ObjectListCommandsPage.cs
- ThreadInterruptedException.cs
- HtmlToClrEventProxy.cs
- ListViewUpdateEventArgs.cs
- ScrollChrome.cs
- TdsParserSessionPool.cs
- WeakReferenceEnumerator.cs
- SecurityKeyIdentifierClause.cs
- VisualBasic.cs
- NoPersistScope.cs
- TypeKeyValue.cs
- ReadOnlyDataSourceView.cs
- LinqDataSourceInsertEventArgs.cs
- CompiledXpathExpr.cs
- ContentValidator.cs
- MimeAnyImporter.cs
- DispatcherOperation.cs
- IntSecurity.cs
- XmlNodeList.cs
- Currency.cs
- TextWriterTraceListener.cs
- TimelineCollection.cs
- SerializationException.cs
- VirtualPathUtility.cs
- InheritanceContextChangedEventManager.cs
- AssemblyFilter.cs
- safesecurityhelperavalon.cs
- Site.cs
- DataSourceProvider.cs
- ConfigurationLockCollection.cs
- __Error.cs
- SHA1Managed.cs
- EnumUnknown.cs
- RequestQueue.cs
- Msmq4SubqueuePoisonHandler.cs
- NonSerializedAttribute.cs
- RelatedPropertyManager.cs
- ObjectPersistData.cs
- Part.cs
- ImageField.cs
- WorkflowMarkupSerializationProvider.cs
- VBIdentifierNameEditor.cs
- ControlBuilderAttribute.cs
- BehaviorEditorPart.cs
- StorageTypeMapping.cs
- TypedAsyncResult.cs
- CollectionViewProxy.cs
- GeometryModel3D.cs
- BezierSegment.cs
- JumpItem.cs
- Vector3DCollection.cs
- WindowsServiceElement.cs
- Condition.cs
- SchemaSetCompiler.cs
- LinqDataSourceDeleteEventArgs.cs
- SrgsNameValueTag.cs
- GridViewSelectEventArgs.cs
- KeyFrames.cs
- unsafenativemethodstextservices.cs
- SerializationEventsCache.cs
- EventDescriptorCollection.cs
- IPipelineRuntime.cs
- FunctionUpdateCommand.cs
- ArraySubsetEnumerator.cs
- SubpageParaClient.cs
- MouseActionValueSerializer.cs
- GlobalizationAssembly.cs
- SecurityContextKeyIdentifierClause.cs
- NameValueFileSectionHandler.cs
- filewebrequest.cs
- HttpBrowserCapabilitiesWrapper.cs
- WorkerProcess.cs
- FixedElement.cs
- TableParaClient.cs
- ClosureBinding.cs
- GridViewAutomationPeer.cs
- ExpressionEditorAttribute.cs
- DataGridTablesFactory.cs
- MessageBox.cs
- ExternalException.cs
- DataSourceSelectArguments.cs
- EmptyImpersonationContext.cs
- ServiceOperationParameter.cs
- IODescriptionAttribute.cs
- RegexBoyerMoore.cs
- WebPartPersonalization.cs
- LongMinMaxAggregationOperator.cs
- CustomGrammar.cs
- ModifierKeysValueSerializer.cs
- ConstantExpression.cs
- ServiceHttpModule.cs
- Policy.cs
- mda.cs
- ClientData.cs
- ExtensionSurface.cs
- HtmlTernaryTree.cs
- AspCompat.cs
- BigInt.cs