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
- ZoneIdentityPermission.cs
- LoginCancelEventArgs.cs
- DataGridViewRowCancelEventArgs.cs
- WaitHandle.cs
- PostBackOptions.cs
- QuaternionValueSerializer.cs
- XmlSchemaRedefine.cs
- BooleanConverter.cs
- RegexTree.cs
- DateTimeSerializationSection.cs
- AnyReturnReader.cs
- WindowsTooltip.cs
- UserNameSecurityTokenAuthenticator.cs
- DataGridHeaderBorder.cs
- Signature.cs
- CacheAxisQuery.cs
- SQLSingle.cs
- EventLogInternal.cs
- InvalidPrinterException.cs
- Int16Converter.cs
- LinkTarget.cs
- Positioning.cs
- LinqDataSourceContextEventArgs.cs
- FrameworkName.cs
- EventProviderWriter.cs
- XPathPatternParser.cs
- SqlConnectionPoolGroupProviderInfo.cs
- Matrix.cs
- GlyphTypeface.cs
- Vector3DCollectionValueSerializer.cs
- SqlFunctionAttribute.cs
- ProgressChangedEventArgs.cs
- ToolStripRenderEventArgs.cs
- InternalConfigHost.cs
- XmlEncApr2001.cs
- StyleCollectionEditor.cs
- ConfigurationManagerInternalFactory.cs
- FtpRequestCacheValidator.cs
- GPRECT.cs
- ObjectTokenCategory.cs
- WindowCollection.cs
- TextTrailingWordEllipsis.cs
- SecurityException.cs
- ObjectDataSourceDisposingEventArgs.cs
- TypeValidationEventArgs.cs
- SqlClientFactory.cs
- RichTextBoxConstants.cs
- Tablet.cs
- StringKeyFrameCollection.cs
- CreateUserErrorEventArgs.cs
- NetworkInformationPermission.cs
- TypeGenericEnumerableViewSchema.cs
- mediaclock.cs
- ObjectContextServiceProvider.cs
- OperationBehaviorAttribute.cs
- MimePart.cs
- BridgeDataRecord.cs
- UserInitiatedNavigationPermission.cs
- DataGridViewRowsRemovedEventArgs.cs
- ListViewHitTestInfo.cs
- AsyncOperationManager.cs
- ToolZone.cs
- XamlReader.cs
- RecognizedAudio.cs
- XmlReaderSettings.cs
- RootNamespaceAttribute.cs
- ToolStripPanelRow.cs
- SqlAliasesReferenced.cs
- TextServicesContext.cs
- BitmapSource.cs
- HtmlElementEventArgs.cs
- securitycriticaldata.cs
- RichTextBoxConstants.cs
- TraceListener.cs
- DataGridViewDataErrorEventArgs.cs
- SectionXmlInfo.cs
- MailSettingsSection.cs
- FilterEventArgs.cs
- CodeCastExpression.cs
- SafeLibraryHandle.cs
- QilXmlReader.cs
- BindingCompleteEventArgs.cs
- HTMLTextWriter.cs
- BindingValueChangedEventArgs.cs
- IsolatedStorageFilePermission.cs
- ExtendedProtectionPolicyTypeConverter.cs
- namescope.cs
- TimeoutValidationAttribute.cs
- ResourceKey.cs
- LabelAutomationPeer.cs
- ObjectFullSpanRewriter.cs
- UpdateTranslator.cs
- DataSourceCacheDurationConverter.cs
- LazyTextWriterCreator.cs
- JsonEncodingStreamWrapper.cs
- DependencyPropertyKey.cs
- AssemblyCollection.cs
- TableLayoutStyle.cs
- ListViewGroupItemCollection.cs
- ProviderBase.cs