Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- XsltLoader.cs
- TextOutput.cs
- WebEncodingValidatorAttribute.cs
- QueryExtender.cs
- CommandValueSerializer.cs
- ColumnPropertiesGroup.cs
- InvalidFilterCriteriaException.cs
- RankException.cs
- UnsafeNativeMethods.cs
- MethodRental.cs
- TrackingConditionCollection.cs
- UniqueCodeIdentifierScope.cs
- HostExecutionContextManager.cs
- XPathNavigator.cs
- Itemizer.cs
- IndexedEnumerable.cs
- __TransparentProxy.cs
- EndpointDiscoveryBehavior.cs
- DataControlImageButton.cs
- Pair.cs
- SchemaNames.cs
- SecurityAlgorithmSuite.cs
- PenThreadWorker.cs
- DriveNotFoundException.cs
- TaskFileService.cs
- DataGridColumnCollection.cs
- JsonSerializer.cs
- DataServiceQuery.cs
- OptimizerPatterns.cs
- _ContextAwareResult.cs
- AttributeExtensions.cs
- SmtpDigestAuthenticationModule.cs
- SubMenuStyle.cs
- MembershipAdapter.cs
- AutomationPattern.cs
- ArrayConverter.cs
- KeysConverter.cs
- RankException.cs
- SymbolDocumentInfo.cs
- DefaultTextStore.cs
- CompilationRelaxations.cs
- NavigatorInput.cs
- PatternMatchRules.cs
- ResourceFallbackManager.cs
- AnnotationComponentChooser.cs
- RadioButtonFlatAdapter.cs
- BamlResourceDeserializer.cs
- AssertUtility.cs
- Timer.cs
- EnvironmentPermission.cs
- EventLogEntryCollection.cs
- Bits.cs
- _FtpDataStream.cs
- ScrollProviderWrapper.cs
- Publisher.cs
- SQLMoneyStorage.cs
- XmlCodeExporter.cs
- EntityDataSourceChangedEventArgs.cs
- TimeZoneNotFoundException.cs
- ObjectRef.cs
- TcpClientCredentialType.cs
- DbMetaDataColumnNames.cs
- TransformerInfo.cs
- RadioButtonFlatAdapter.cs
- PopupRootAutomationPeer.cs
- LoginCancelEventArgs.cs
- PrintingPermissionAttribute.cs
- WebEventCodes.cs
- AssociationType.cs
- LinqDataSourceStatusEventArgs.cs
- AutomationElementCollection.cs
- objectresult_tresulttype.cs
- TimeSpanValidator.cs
- XmlNavigatorFilter.cs
- CallSiteHelpers.cs
- TreeNodeStyleCollection.cs
- SEHException.cs
- ExpandCollapsePattern.cs
- DiagnosticSection.cs
- PeerToPeerException.cs
- ArraySubsetEnumerator.cs
- WebSysDisplayNameAttribute.cs
- SqlConnectionStringBuilder.cs
- JapaneseCalendar.cs
- WebPartManagerInternals.cs
- SqlOuterApplyReducer.cs
- DateRangeEvent.cs
- MergePropertyDescriptor.cs
- SimpleType.cs
- InfoCardProofToken.cs
- NumericExpr.cs
- WorkflowApplicationTerminatedException.cs
- XsltContext.cs
- SectionRecord.cs
- XmlSchemaSubstitutionGroup.cs
- StringUtil.cs
- RawStylusInputCustomDataList.cs
- VolatileEnlistmentState.cs
- ExternalFile.cs
- HtmlTableRowCollection.cs