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
- IRCollection.cs
- unsafenativemethodsother.cs
- OverflowException.cs
- MultipleViewProviderWrapper.cs
- Canvas.cs
- Hash.cs
- FullTextLine.cs
- RadioButton.cs
- CompositeFontInfo.cs
- ArrangedElementCollection.cs
- HttpException.cs
- ProxyHelper.cs
- EventDescriptorCollection.cs
- PackageProperties.cs
- AuthenticationSection.cs
- DocumentViewerBaseAutomationPeer.cs
- RubberbandSelector.cs
- ArrayConverter.cs
- KeySplineConverter.cs
- Form.cs
- MultipleViewProviderWrapper.cs
- DiagnosticTraceSource.cs
- DeferredBinaryDeserializerExtension.cs
- ResourceDisplayNameAttribute.cs
- DropTarget.cs
- KeyedCollection.cs
- BlockExpression.cs
- CompositeFontInfo.cs
- Clock.cs
- X509CertificateCollection.cs
- EpmAttributeNameBuilder.cs
- StringComparer.cs
- itemelement.cs
- XPathSingletonIterator.cs
- RefreshEventArgs.cs
- DrawingContextWalker.cs
- SingleStorage.cs
- CodeTypeDelegate.cs
- HttpModule.cs
- CompilerParameters.cs
- EventDriven.cs
- IntegrationExceptionEventArgs.cs
- XmlTextReaderImpl.cs
- FixedSOMSemanticBox.cs
- SqlDataRecord.cs
- sqlmetadatafactory.cs
- HtmlControlDesigner.cs
- SolidBrush.cs
- Statements.cs
- FormatterServices.cs
- ColumnTypeConverter.cs
- EventDescriptorCollection.cs
- EntityDataSourceValidationException.cs
- Vector3DKeyFrameCollection.cs
- IISMapPath.cs
- CanExecuteRoutedEventArgs.cs
- DataGridAddNewRow.cs
- TextEditorDragDrop.cs
- Query.cs
- XamlVector3DCollectionSerializer.cs
- ToolStripDropDownButton.cs
- WebColorConverter.cs
- NameNode.cs
- Simplifier.cs
- XmlArrayAttribute.cs
- StructuredProperty.cs
- UnmanagedMemoryStreamWrapper.cs
- CompiledXpathExpr.cs
- ConnectionInterfaceCollection.cs
- Rotation3DAnimationUsingKeyFrames.cs
- HiddenField.cs
- DataServiceHostFactory.cs
- base64Transforms.cs
- AggregatePushdown.cs
- RSAPKCS1KeyExchangeFormatter.cs
- BufferedGenericXmlSecurityToken.cs
- DataBinder.cs
- ConfigurationManagerHelperFactory.cs
- TreeNodeCollection.cs
- SiteMapNodeItem.cs
- LinqDataSource.cs
- FileLogRecordEnumerator.cs
- LineSegment.cs
- NameHandler.cs
- ThreadPool.cs
- HtmlImage.cs
- ClassicBorderDecorator.cs
- ApplicationActivator.cs
- MemberProjectedSlot.cs
- SocketElement.cs
- NotifyInputEventArgs.cs
- TemplateField.cs
- XmlSchemaSubstitutionGroup.cs
- Debug.cs
- HtmlControlPersistable.cs
- SafeArchiveContext.cs
- SizeChangedInfo.cs
- MouseEvent.cs
- LinearGradientBrush.cs
- UInt32Converter.cs