Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Framework / System / Windows / Interop / WindowInteropHelper.cs / 1 / WindowInteropHelper.cs
//---------------------------------------------------------------------------- // // File: WindowInteropHelper.cs // // Description: Implements Avalon WindowInteropHelper classes, which helps // interop b/w legacy and Avalon Window. // // Created: 05/06/03 // // Copyright (C) 2001 by Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.Windows; using System.Windows.Interop; using System.Security; using System.Security.Permissions; using System.Diagnostics; using MS.Internal; using MS.Internal.PresentationFramework; // SecurityHelper using MS.Win32; namespace System.Windows.Interop { #region class WindowInteropHelper ////// Implements Avalon WindowInteropHelper classes, which helps /// interop b/w legacy and Avalon Window. /// public sealed class WindowInteropHelper { //--------------------------------------------------- // // Constructors // //--------------------------------------------------- #region Constructors ////// /// /// public WindowInteropHelper(Window window) { if (window == null) throw new ArgumentNullException("window"); _window = window; } #endregion Constructors //---------------------------------------------------- // // Public Properties // //--------------------------------------------------- #region Public Properties ////// Get the Handle of the window /// ////// Callers must have UIPermission(UIPermissionWindow.AllWindows) to call this API. /// ////// Critical: Exposes a handle /// PublicOK: There is a demand , this API not available in internet zone /// public IntPtr Handle { [SecurityCritical] get { SecurityHelper.DemandUIWindowPermission(); return CriticalHandle; } } ////// Critical: Exposes a handle /// internal IntPtr CriticalHandle { [SecurityCritical] get { Invariant.Assert(_window != null, "Cannot be null since we verify in the constructor"); return _window.CriticalHandle; } } ////// Get/Set the Owner handle of the window /// ////// Callers must have UIPermission(UIPermissionWindow.AllWindows) to call this API. /// ////// Critical: Exposes a handle /// PublicOK: There is a demand , this API not available in internet zone /// public IntPtr Owner { [SecurityCritical] get { SecurityHelper.DemandUIWindowPermission(); Debug.Assert(_window != null, "Cannot be null since we verify in the constructor"); return _window.OwnerHandle; } [SecurityCritical] set { SecurityHelper.DemandUIWindowPermission(); Debug.Assert(_window != null, "Cannot be null since we verify in the constructor"); // error checking done in Window _window.OwnerHandle = value; } } #endregion Public Properties //---------------------------------------------- // // Private Fields // //---------------------------------------------- #region Private Fields private Window _window; #endregion Private Members } #endregion class WindowInteropHelper } // 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
- MouseBinding.cs
- Typeface.cs
- Menu.cs
- HtmlGenericControl.cs
- RuleProcessor.cs
- CssClassPropertyAttribute.cs
- ProfileService.cs
- TextChange.cs
- ResourceSet.cs
- TemplateApplicationHelper.cs
- ComplexTypeEmitter.cs
- SmtpClient.cs
- ToolStripArrowRenderEventArgs.cs
- ToolStripItemImageRenderEventArgs.cs
- contentDescriptor.cs
- ElementsClipboardData.cs
- BamlLocalizableResourceKey.cs
- AppDomainEvidenceFactory.cs
- OutputCacheProfileCollection.cs
- Lease.cs
- StructuredType.cs
- StyleSheetRefUrlEditor.cs
- RegisteredScript.cs
- SoapFault.cs
- BooleanFunctions.cs
- updateconfighost.cs
- dtdvalidator.cs
- RemotingConfigParser.cs
- IgnoreFlushAndCloseStream.cs
- ComProxy.cs
- X509UI.cs
- SystemFonts.cs
- SettingsSavedEventArgs.cs
- DataControlField.cs
- AxHost.cs
- autovalidator.cs
- ControllableStoryboardAction.cs
- PermissionSetTriple.cs
- SqlTransaction.cs
- FormDocumentDesigner.cs
- ResourcePart.cs
- CellConstant.cs
- XmlNavigatorStack.cs
- FragmentNavigationEventArgs.cs
- RuntimeIdentifierPropertyAttribute.cs
- FormatConvertedBitmap.cs
- ReferencedType.cs
- DataGridViewRowConverter.cs
- ExtendedPropertiesHandler.cs
- mactripleDES.cs
- StrokeFIndices.cs
- XmlImplementation.cs
- SimpleFieldTemplateUserControl.cs
- Stack.cs
- DuplicateWaitObjectException.cs
- LinkAreaEditor.cs
- MemberDomainMap.cs
- PhoneCall.cs
- XPathPatternBuilder.cs
- WSHttpSecurityElement.cs
- entitydatasourceentitysetnameconverter.cs
- DecimalSumAggregationOperator.cs
- StylusButton.cs
- LogArchiveSnapshot.cs
- XmlValueConverter.cs
- OdbcReferenceCollection.cs
- Bookmark.cs
- TableLayoutSettings.cs
- XmlSchemaInclude.cs
- ObjectIDGenerator.cs
- KnowledgeBase.cs
- SqlCacheDependencyDatabaseCollection.cs
- DrawingGroupDrawingContext.cs
- ToolboxItemAttribute.cs
- AnnotationResourceCollection.cs
- ObjectToken.cs
- PrivilegedConfigurationManager.cs
- PipelineModuleStepContainer.cs
- CorrelationResolver.cs
- WindowsFormsSynchronizationContext.cs
- BackStopAuthenticationModule.cs
- TCPClient.cs
- HttpModuleActionCollection.cs
- ComplexTypeEmitter.cs
- RtfToXamlReader.cs
- CollectionBase.cs
- TextBounds.cs
- XmlChoiceIdentifierAttribute.cs
- TextElementCollection.cs
- TransformationRules.cs
- MemberHolder.cs
- SurrogateEncoder.cs
- GrammarBuilderRuleRef.cs
- AsyncResult.cs
- Keyboard.cs
- LazyTextWriterCreator.cs
- XmlTextReaderImplHelpers.cs
- RelationshipEndMember.cs
- ImageFormat.cs
- ViewCellSlot.cs