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
- NodeFunctions.cs
- WindowsSysHeader.cs
- SHA1.cs
- XPathExpr.cs
- ReturnEventArgs.cs
- RoutedEventConverter.cs
- OdbcPermission.cs
- DataGridViewSelectedColumnCollection.cs
- FunctionNode.cs
- DefaultBinder.cs
- HttpModuleCollection.cs
- MenuItemStyleCollection.cs
- AncillaryOps.cs
- PrivacyNoticeElement.cs
- DynamicDocumentPaginator.cs
- PlatformNotSupportedException.cs
- GlyphCache.cs
- ConfigXmlText.cs
- HwndProxyElementProvider.cs
- SimpleFieldTemplateUserControl.cs
- NamedPipeHostedTransportConfiguration.cs
- SQLByteStorage.cs
- EpmAttributeNameBuilder.cs
- ErrorLog.cs
- InheritanceContextChangedEventManager.cs
- COM2ComponentEditor.cs
- ParseHttpDate.cs
- ApplicationActivator.cs
- DiscoveryMessageSequenceCD1.cs
- ProxyWebPartConnectionCollection.cs
- ToolBarPanel.cs
- TraceXPathNavigator.cs
- wmiprovider.cs
- ComplexLine.cs
- StringFormat.cs
- DataGridCellItemAutomationPeer.cs
- ReferenceEqualityComparer.cs
- DynamicMetaObjectBinder.cs
- ChtmlTextWriter.cs
- StaticDataManager.cs
- KeyboardDevice.cs
- InheritanceRules.cs
- ComponentManagerBroker.cs
- ASCIIEncoding.cs
- ClassHandlersStore.cs
- JsonSerializer.cs
- MenuScrollingVisibilityConverter.cs
- MsmqUri.cs
- TemplateBamlRecordReader.cs
- ConnectionConsumerAttribute.cs
- ProcessInfo.cs
- SubpageParaClient.cs
- XmlParserContext.cs
- ProcessThreadCollection.cs
- _UriSyntax.cs
- TextMetrics.cs
- ExceptionValidationRule.cs
- HotCommands.cs
- GenerateTemporaryTargetAssembly.cs
- SqlInternalConnectionSmi.cs
- XamlReader.cs
- CodeAttachEventStatement.cs
- EditingScope.cs
- GridViewCancelEditEventArgs.cs
- SiteMapNodeCollection.cs
- StringResourceManager.cs
- UidManager.cs
- HealthMonitoringSectionHelper.cs
- MaskedTextProvider.cs
- FormClosedEvent.cs
- iisPickupDirectory.cs
- GraphicsPathIterator.cs
- DocumentXPathNavigator.cs
- ElementMarkupObject.cs
- LineProperties.cs
- SystemThemeKey.cs
- IntranetCredentialPolicy.cs
- WebPartHelpVerb.cs
- ErrorWebPart.cs
- StringValueSerializer.cs
- ManipulationPivot.cs
- CapabilitiesAssignment.cs
- DocumentSequenceHighlightLayer.cs
- WeakEventManager.cs
- CompilerGlobalScopeAttribute.cs
- BrowserPolicyValidator.cs
- UnknownBitmapEncoder.cs
- __Error.cs
- PopupControlService.cs
- SolidColorBrush.cs
- StateRuntime.cs
- BitmapDownload.cs
- Deflater.cs
- SafeCertificateStore.cs
- XXXInfos.cs
- ResolveNameEventArgs.cs
- HttpPostProtocolImporter.cs
- SingleSelectRootGridEntry.cs
- DynamicExpression.cs
- PeerCollaboration.cs