Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Shared / MS / Internal / safesecurityhelperavalon.cs / 1 / safesecurityhelperavalon.cs
/****************************************************************************\ * * File: SafeSecurityHelper.cs * * Purpose: Helper functions for avalon code that require elevation but are safe to use. * * History: * 12/09/04: marka Created * * Copyright (C) 2004 by Microsoft Corporation. All rights reserved. * \***************************************************************************/ using System; using System.Globalization; using System.Security; using System.Security.Permissions; using System.Reflection; using System.Windows.Media ; using System.Windows; //**************** // // this class is for helpers that require avalon. // done this way so that Compiler doesn't build this file to minimize dependencies compiler has. // //**************** #if WINDOWS_BASE namespace MS.Internal.WindowsBase #elif PRESENTATION_CORE namespace MS.Internal.PresentationCore #elif PRESENTATIONFRAMEWORK namespace MS.Internal.PresentationFramework #elif DRT namespace MS.Internal.Drt #else #error Attempting to use this class from an unknown assembly. #endif { internal static partial class SafeSecurityHelper { ////// is this visual connected to presentation source ? /// i.e. is it "renderable" ? /// ////// Critical - extracts presentationsource /// TreatAsSafe - Knowing whether you're connected to presentation source is ok. /// [SecurityCritical, SecurityTreatAsSafe] internal static bool IsConnectedToPresentationSource( Visual visual ) { bool isConnected = false; isConnected = PresentationSource.CriticalFromVisual(visual ) != null; return isConnected ; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. /****************************************************************************\ * * File: SafeSecurityHelper.cs * * Purpose: Helper functions for avalon code that require elevation but are safe to use. * * History: * 12/09/04: marka Created * * Copyright (C) 2004 by Microsoft Corporation. All rights reserved. * \***************************************************************************/ using System; using System.Globalization; using System.Security; using System.Security.Permissions; using System.Reflection; using System.Windows.Media ; using System.Windows; //**************** // // this class is for helpers that require avalon. // done this way so that Compiler doesn't build this file to minimize dependencies compiler has. // //**************** #if WINDOWS_BASE namespace MS.Internal.WindowsBase #elif PRESENTATION_CORE namespace MS.Internal.PresentationCore #elif PRESENTATIONFRAMEWORK namespace MS.Internal.PresentationFramework #elif DRT namespace MS.Internal.Drt #else #error Attempting to use this class from an unknown assembly. #endif { internal static partial class SafeSecurityHelper { ////// is this visual connected to presentation source ? /// i.e. is it "renderable" ? /// ////// Critical - extracts presentationsource /// TreatAsSafe - Knowing whether you're connected to presentation source is ok. /// [SecurityCritical, SecurityTreatAsSafe] internal static bool IsConnectedToPresentationSource( Visual visual ) { bool isConnected = false; isConnected = PresentationSource.CriticalFromVisual(visual ) != null; return isConnected ; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PersonalizationDictionary.cs
- SqlTrackingService.cs
- SubMenuStyleCollection.cs
- StorageRoot.cs
- DataControlReferenceCollection.cs
- SystemIPInterfaceStatistics.cs
- DocumentOutline.cs
- PieceNameHelper.cs
- NotFiniteNumberException.cs
- TextElementEnumerator.cs
- XmlSchemaFacet.cs
- ContextProperty.cs
- AmbientLight.cs
- EventItfInfo.cs
- PartialCachingControl.cs
- ButtonChrome.cs
- TextTreeDeleteContentUndoUnit.cs
- AttributeCollection.cs
- HttpListenerException.cs
- TcpTransportElement.cs
- InstanceContext.cs
- DataGridViewSortCompareEventArgs.cs
- ToolBarPanel.cs
- BitmapData.cs
- SoapAttributeOverrides.cs
- QilIterator.cs
- WebDisplayNameAttribute.cs
- AuthorizationRuleCollection.cs
- DefaultValueTypeConverter.cs
- DownloadProgressEventArgs.cs
- BuildProviderCollection.cs
- EmptyEnumerator.cs
- TypeForwardedToAttribute.cs
- ObjectItemAssemblyLoader.cs
- CopyOnWriteList.cs
- SessionEndedEventArgs.cs
- MediaElementAutomationPeer.cs
- _ListenerResponseStream.cs
- CodeCompiler.cs
- SafeRegistryHandle.cs
- Span.cs
- SqlNotificationRequest.cs
- ContainerFilterService.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- UnmanagedMarshal.cs
- MDIControlStrip.cs
- RuntimeConfig.cs
- UrlMappingCollection.cs
- SerializationInfoEnumerator.cs
- StrokeNodeData.cs
- RemotingService.cs
- Variant.cs
- _ProxyChain.cs
- CodeCatchClause.cs
- ListViewCommandEventArgs.cs
- MailWriter.cs
- WebPartsPersonalizationAuthorization.cs
- BoolExpression.cs
- ISFClipboardData.cs
- Point3DAnimationUsingKeyFrames.cs
- DocobjHost.cs
- PopupRoot.cs
- EnumType.cs
- DeferredSelectedIndexReference.cs
- ActivityInterfaces.cs
- RemotingHelper.cs
- ComponentConverter.cs
- AssemblyBuilder.cs
- ApplicationGesture.cs
- DataTemplateKey.cs
- SourceLineInfo.cs
- HashRepartitionStream.cs
- DeviceSpecificChoice.cs
- XsltArgumentList.cs
- SplashScreenNativeMethods.cs
- DataProtection.cs
- LineGeometry.cs
- ArgumentsParser.cs
- ThicknessAnimation.cs
- QueryStoreStatusRequest.cs
- EditCommandColumn.cs
- Utility.cs
- KnownBoxes.cs
- MethodBuilder.cs
- FtpCachePolicyElement.cs
- LayoutTable.cs
- SecurityContext.cs
- RequestCachePolicyConverter.cs
- ColumnBinding.cs
- TemplatedControlDesigner.cs
- QualifiedId.cs
- AsyncDataRequest.cs
- WebReferencesBuildProvider.cs
- XmlSerializableWriter.cs
- SafeNativeMethodsOther.cs
- TableCellAutomationPeer.cs
- NextPreviousPagerField.cs
- ZipIOExtraFieldZip64Element.cs
- BindingContext.cs
- ScriptRegistrationManager.cs