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
- TouchDevice.cs
- ToolZone.cs
- SelectionRangeConverter.cs
- CheckoutException.cs
- WorkflowMarkupSerializerMapping.cs
- Parser.cs
- EncodingTable.cs
- UnsafeNativeMethodsCLR.cs
- Point3DValueSerializer.cs
- StatusBarPanelClickEvent.cs
- CalendarButtonAutomationPeer.cs
- ContextBase.cs
- ConfigXmlComment.cs
- EventlogProvider.cs
- XamlTemplateSerializer.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- RequestQueryProcessor.cs
- SqlServer2KCompatibilityCheck.cs
- WebServiceErrorEvent.cs
- Int64.cs
- DbDataSourceEnumerator.cs
- UnhandledExceptionEventArgs.cs
- AssemblyFilter.cs
- KoreanCalendar.cs
- BadImageFormatException.cs
- ClientScriptManager.cs
- RuntimeEnvironment.cs
- ContentPosition.cs
- MethodToken.cs
- AsnEncodedData.cs
- XhtmlCssHandler.cs
- ValidationHelpers.cs
- ProxyManager.cs
- FlowDocumentPaginator.cs
- MessageQueueConverter.cs
- FacetDescriptionElement.cs
- DescendentsWalkerBase.cs
- TypeToken.cs
- InkPresenterAutomationPeer.cs
- JsonServiceDocumentSerializer.cs
- SmiTypedGetterSetter.cs
- DataGridViewImageCell.cs
- XmlSchemaInfo.cs
- BindingSourceDesigner.cs
- SupportsEventValidationAttribute.cs
- XmlEntity.cs
- BaseCodePageEncoding.cs
- CodeGroup.cs
- HighlightComponent.cs
- XmlQueryType.cs
- SqlConnectionManager.cs
- RadioButton.cs
- LoginView.cs
- TripleDES.cs
- DrawingContextFlattener.cs
- TableRow.cs
- SelectingProviderEventArgs.cs
- WorkflowServiceBehavior.cs
- WinEventWrap.cs
- ClassGenerator.cs
- TreeNodeEventArgs.cs
- StringFunctions.cs
- ScriptDescriptor.cs
- Image.cs
- ChangeProcessor.cs
- ValidateNames.cs
- Win32Exception.cs
- VersionedStream.cs
- HGlobalSafeHandle.cs
- RegexCapture.cs
- TextSearch.cs
- SafePEFileHandle.cs
- FrameworkContentElementAutomationPeer.cs
- AlignmentYValidation.cs
- FaultDesigner.cs
- BitmapImage.cs
- CodeIdentifier.cs
- SHA512.cs
- Decimal.cs
- TemplateControlParser.cs
- PEFileReader.cs
- GridView.cs
- LowerCaseStringConverter.cs
- EmptyControlCollection.cs
- ErrorInfoXmlDocument.cs
- TransformationRules.cs
- ExceptionHandlerDesigner.cs
- NativeRightsManagementAPIsStructures.cs
- TraceContextRecord.cs
- SemanticBasicElement.cs
- ADConnectionHelper.cs
- KeyValueSerializer.cs
- WindowsIPAddress.cs
- ButtonBase.cs
- EvidenceBase.cs
- AssemblyAttributes.cs
- SizeAnimationClockResource.cs
- NullExtension.cs
- RectAnimationClockResource.cs
- LayoutTableCell.cs