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
- WebPartDisplayModeEventArgs.cs
- TextEditorThreadLocalStore.cs
- MD5.cs
- LinkArea.cs
- QuaternionIndependentAnimationStorage.cs
- ISAPIRuntime.cs
- NaturalLanguageHyphenator.cs
- BindingElementCollection.cs
- WebScriptMetadataMessageEncoderFactory.cs
- HttpCapabilitiesSectionHandler.cs
- ModelItemDictionaryImpl.cs
- OdbcConnectionString.cs
- ListParagraph.cs
- XmlSchemaNotation.cs
- ProcessThreadCollection.cs
- DataRowComparer.cs
- ObjectDataSourceEventArgs.cs
- SystemIPAddressInformation.cs
- OdbcErrorCollection.cs
- JpegBitmapEncoder.cs
- HtmlTableRow.cs
- TextTreeUndoUnit.cs
- CodeDirectiveCollection.cs
- ColumnHeaderConverter.cs
- ButtonAutomationPeer.cs
- Events.cs
- TraceUtils.cs
- GridViewPageEventArgs.cs
- ApplicationSecurityInfo.cs
- BindingContext.cs
- CreateUserWizardAutoFormat.cs
- SessionEndingCancelEventArgs.cs
- TaskFileService.cs
- MetafileEditor.cs
- FunctionNode.cs
- TextTreeTextElementNode.cs
- ParameterReplacerVisitor.cs
- Expressions.cs
- QueryAsyncResult.cs
- ListBoxItem.cs
- WeakEventTable.cs
- SqlEnums.cs
- PeerApplication.cs
- DataGridViewTextBoxCell.cs
- Ray3DHitTestResult.cs
- LineServicesRun.cs
- ResourceProperty.cs
- RequestCachePolicy.cs
- SoapAttributes.cs
- Rotation3DKeyFrameCollection.cs
- ToolboxComponentsCreatedEventArgs.cs
- SafeWaitHandle.cs
- Authorization.cs
- Nodes.cs
- DataListAutoFormat.cs
- ByteFacetDescriptionElement.cs
- ValueSerializerAttribute.cs
- SqlWriter.cs
- DesignerSerializationManager.cs
- ScriptManagerProxy.cs
- TdsParserSafeHandles.cs
- oledbmetadatacolumnnames.cs
- XmlILOptimizerVisitor.cs
- CommandConverter.cs
- WrappedKeySecurityToken.cs
- AppModelKnownContentFactory.cs
- BuildManagerHost.cs
- TraceSource.cs
- SQLDateTimeStorage.cs
- UntrustedRecipientException.cs
- Crc32.cs
- CodeRegionDirective.cs
- GradientBrush.cs
- XhtmlCssHandler.cs
- HttpProcessUtility.cs
- WasNotInstalledException.cs
- ReadOnlyAttribute.cs
- MetadataItem_Static.cs
- MetadataFile.cs
- CookielessData.cs
- PeerChannelListener.cs
- FormDocumentDesigner.cs
- ChildrenQuery.cs
- mediapermission.cs
- BaseTemplateParser.cs
- TransportSecurityProtocolFactory.cs
- IdentitySection.cs
- OleDbParameter.cs
- Repeater.cs
- FolderLevelBuildProviderAppliesToAttribute.cs
- TimeBoundedCache.cs
- PowerStatus.cs
- ObjectQuery.cs
- CorruptingExceptionCommon.cs
- InvokeMemberBinder.cs
- XmlSchemaSimpleContentRestriction.cs
- HashAlgorithm.cs
- WpfGeneratedKnownProperties.cs
- MetadataArtifactLoaderCompositeResource.cs
- DataGridViewColumnHeaderCell.cs