Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- MenuStrip.cs
- FramingFormat.cs
- ToolBar.cs
- FlowNode.cs
- FastEncoder.cs
- DefaultAsyncDataDispatcher.cs
- FunctionCommandText.cs
- ResourceReferenceExpression.cs
- NCryptNative.cs
- IndexedString.cs
- HttpHandlerAction.cs
- OleDbParameter.cs
- LinkClickEvent.cs
- EventLogSession.cs
- ProfileManager.cs
- DataMemberConverter.cs
- SqlExpander.cs
- PathNode.cs
- SocketElement.cs
- MemberProjectedSlot.cs
- AssemblyGen.cs
- Version.cs
- DetailsViewDeleteEventArgs.cs
- ItemContainerProviderWrapper.cs
- DependencyPropertyChangedEventArgs.cs
- CompositeKey.cs
- CodeRemoveEventStatement.cs
- CompatibleComparer.cs
- ConfigurationSchemaErrors.cs
- SecurityCriticalDataForSet.cs
- TransformerInfo.cs
- SchemaContext.cs
- SHA1CryptoServiceProvider.cs
- Validator.cs
- IndentedTextWriter.cs
- SettingsPropertyValue.cs
- XmlSchemaSimpleType.cs
- SHA1.cs
- EventBuilder.cs
- CellIdBoolean.cs
- BinaryCommonClasses.cs
- HtmlHistory.cs
- SelectedGridItemChangedEvent.cs
- CommandDevice.cs
- XmlTextReader.cs
- OleDbConnectionFactory.cs
- SByteConverter.cs
- NegotiateStream.cs
- AdRotator.cs
- MethodCallTranslator.cs
- MinimizableAttributeTypeConverter.cs
- XmlWhitespace.cs
- IdleTimeoutMonitor.cs
- OleDbReferenceCollection.cs
- Function.cs
- PrintControllerWithStatusDialog.cs
- TextElementCollection.cs
- XamlFrame.cs
- UriWriter.cs
- InstanceData.cs
- StylusPointProperty.cs
- PolyLineSegment.cs
- DataGridViewTextBoxEditingControl.cs
- CompositeDataBoundControl.cs
- SqlCrossApplyToCrossJoin.cs
- Rotation3D.cs
- InvariantComparer.cs
- ReadOnlyDataSourceView.cs
- PersonalizationState.cs
- XmlSchemaComplexContentRestriction.cs
- _AutoWebProxyScriptEngine.cs
- StreamAsIStream.cs
- StorageSetMapping.cs
- CharUnicodeInfo.cs
- Translator.cs
- PropertySourceInfo.cs
- IItemProperties.cs
- ToolStripContentPanel.cs
- TextTreeTextElementNode.cs
- WhiteSpaceTrimStringConverter.cs
- EpmAttributeNameBuilder.cs
- ObjectStateEntryDbDataRecord.cs
- UnsafeNativeMethods.cs
- SerialReceived.cs
- BreakRecordTable.cs
- XmlSchemaAppInfo.cs
- SafeArrayTypeMismatchException.cs
- SqlTopReducer.cs
- VisualBrush.cs
- TemplateComponentConnector.cs
- WebPartRestoreVerb.cs
- DBNull.cs
- CharUnicodeInfo.cs
- COM2ColorConverter.cs
- ToolStripOverflow.cs
- XmlSchemaIdentityConstraint.cs
- ExpressionBuilder.cs
- DataStorage.cs
- HttpChannelListener.cs
- FixedSOMTable.cs