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
- Adorner.cs
- WebPermission.cs
- XmlChildEnumerator.cs
- StackOverflowException.cs
- BulletChrome.cs
- RepeaterItemEventArgs.cs
- TaskExtensions.cs
- AdapterUtil.cs
- CodeDomSerializer.cs
- WebSysDescriptionAttribute.cs
- QueryContinueDragEvent.cs
- GroupQuery.cs
- HttpWebRequest.cs
- Options.cs
- SortDescriptionCollection.cs
- XmlReaderSettings.cs
- ExternalDataExchangeService.cs
- DrawListViewColumnHeaderEventArgs.cs
- Int64Converter.cs
- NativeMethods.cs
- ListBase.cs
- ButtonChrome.cs
- ReferenceConverter.cs
- CompositeFontInfo.cs
- Mapping.cs
- NamespaceDisplay.xaml.cs
- OdbcEnvironment.cs
- CodeObject.cs
- HandlerWithFactory.cs
- ToolStripItemTextRenderEventArgs.cs
- CacheMemory.cs
- RuleProcessor.cs
- DetectRunnableInstancesTask.cs
- PersonalizationEntry.cs
- StreamWithDictionary.cs
- DateTimeFormatInfoScanner.cs
- QueryExpression.cs
- listviewsubitemcollectioneditor.cs
- PingReply.cs
- AssignDesigner.xaml.cs
- CommonProperties.cs
- Renderer.cs
- NonDualMessageSecurityOverHttpElement.cs
- StaticExtensionConverter.cs
- HelpKeywordAttribute.cs
- SQLMoney.cs
- WebPartConnectionCollection.cs
- SQLGuidStorage.cs
- CompressionTracing.cs
- WebBrowserUriTypeConverter.cs
- VisualStyleRenderer.cs
- ReflectionTypeLoadException.cs
- PathFigureCollectionConverter.cs
- ValidateNames.cs
- ParameterBuilder.cs
- ArrayList.cs
- Msmq3PoisonHandler.cs
- SimpleHandlerBuildProvider.cs
- ObjectFullSpanRewriter.cs
- TreeNodeStyle.cs
- EmissiveMaterial.cs
- ResourceReferenceExpressionConverter.cs
- ContextMenuStripGroup.cs
- WebBrowserSiteBase.cs
- XmlSchemaComplexContentRestriction.cs
- DispatcherExceptionFilterEventArgs.cs
- FrameworkContentElement.cs
- fixedPageContentExtractor.cs
- OrderByQueryOptionExpression.cs
- TableStyle.cs
- _BufferOffsetSize.cs
- SoapCodeExporter.cs
- GridViewRowCollection.cs
- BufferAllocator.cs
- ReliableChannelFactory.cs
- PrimitiveXmlSerializers.cs
- VideoDrawing.cs
- ShapingWorkspace.cs
- RSAOAEPKeyExchangeDeformatter.cs
- OutKeywords.cs
- Matrix.cs
- DataControlCommands.cs
- UncommonField.cs
- FixedSOMTable.cs
- PageAsyncTask.cs
- LocationSectionRecord.cs
- ToolStripItem.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- DivideByZeroException.cs
- TaskDesigner.cs
- SafeArchiveContext.cs
- ClientType.cs
- ImageBrush.cs
- WebPartHeaderCloseVerb.cs
- DataGridTableCollection.cs
- DrawItemEvent.cs
- Utils.cs
- JsonQNameDataContract.cs
- BamlResourceDeserializer.cs
- RequestQueue.cs