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
- ObjectCloneHelper.cs
- _AuthenticationState.cs
- mil_sdk_version.cs
- GlobalProxySelection.cs
- PartialList.cs
- X509Certificate.cs
- SerializableAttribute.cs
- PeoplePickerWrapper.cs
- TextDecorationCollectionConverter.cs
- ParseElement.cs
- WorkflowStateRollbackService.cs
- InstallerTypeAttribute.cs
- WaitHandleCannotBeOpenedException.cs
- SeekStoryboard.cs
- ActivityBuilderHelper.cs
- ScriptComponentDescriptor.cs
- XmlStreamNodeWriter.cs
- XsltLibrary.cs
- ReadContentAsBinaryHelper.cs
- ObfuscateAssemblyAttribute.cs
- DummyDataSource.cs
- _CommandStream.cs
- UdpMessageProperty.cs
- ClientConfigurationSystem.cs
- Hashtable.cs
- cryptoapiTransform.cs
- CodeAttributeDeclaration.cs
- DataSourceHelper.cs
- SchemaCompiler.cs
- ProviderConnectionPointCollection.cs
- LassoSelectionBehavior.cs
- ExpressionVisitor.cs
- EastAsianLunisolarCalendar.cs
- CodeNamespaceImportCollection.cs
- BatchParser.cs
- HttpProfileBase.cs
- WindowsGraphicsWrapper.cs
- CustomCredentialPolicy.cs
- WindowsSlider.cs
- UnsafeNativeMethodsTablet.cs
- ValidationResult.cs
- EventlogProvider.cs
- exports.cs
- HelpOperationInvoker.cs
- XmlSchemaAnnotation.cs
- ThousandthOfEmRealDoubles.cs
- TypedReference.cs
- EncryptedPackageFilter.cs
- BamlLocalizer.cs
- MappingException.cs
- ComponentCommands.cs
- LayoutEditorPart.cs
- IconHelper.cs
- PersianCalendar.cs
- oledbmetadatacollectionnames.cs
- OdbcStatementHandle.cs
- ExecutionScope.cs
- ServiceErrorHandler.cs
- ComponentResourceKey.cs
- SqlGatherConsumedAliases.cs
- MatrixAnimationUsingKeyFrames.cs
- Calendar.cs
- ResourceDescriptionAttribute.cs
- MatrixAnimationUsingKeyFrames.cs
- ReadOnlyDataSource.cs
- Panel.cs
- HtmlListAdapter.cs
- ProcessModelSection.cs
- MemberHolder.cs
- _SSPIWrapper.cs
- D3DImage.cs
- DirectionalLight.cs
- TraceListener.cs
- BitStream.cs
- Comparer.cs
- DateTimeFormatInfoScanner.cs
- InternalControlCollection.cs
- XmlObjectSerializerReadContext.cs
- ISCIIEncoding.cs
- BinaryNode.cs
- RemoteWebConfigurationHostServer.cs
- TcpActivation.cs
- BindingContext.cs
- FileLoadException.cs
- RegexParser.cs
- CachedTypeface.cs
- CharacterShapingProperties.cs
- WebUtil.cs
- BamlResourceDeserializer.cs
- TextDecorationCollection.cs
- DrawingImage.cs
- ImageInfo.cs
- GroupDescription.cs
- SessionParameter.cs
- ProtocolsSection.cs
- Renderer.cs
- TextSimpleMarkerProperties.cs
- TransactionValidationBehavior.cs
- EditBehavior.cs
- CodePageUtils.cs