Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ResourceBinder.cs
- XmlRootAttribute.cs
- OpCopier.cs
- ListBoxChrome.cs
- GridViewRowEventArgs.cs
- BlobPersonalizationState.cs
- DataControlButton.cs
- KernelTypeValidation.cs
- CollectionAdapters.cs
- RTLAwareMessageBox.cs
- Mappings.cs
- LinqDataSourceDisposeEventArgs.cs
- ToolboxDataAttribute.cs
- SqlBuffer.cs
- FileChangeNotifier.cs
- HttpsTransportElement.cs
- RuntimeHelpers.cs
- WebExceptionStatus.cs
- HostedElements.cs
- PropertyToken.cs
- AppModelKnownContentFactory.cs
- HttpVersion.cs
- OperatorExpressions.cs
- SqlFlattener.cs
- HostingEnvironmentException.cs
- DataList.cs
- SelfIssuedAuthAsymmetricKey.cs
- CodeAccessSecurityEngine.cs
- StrongNameKeyPair.cs
- SqlUserDefinedTypeAttribute.cs
- SimpleMailWebEventProvider.cs
- ScriptIgnoreAttribute.cs
- OracleParameterCollection.cs
- SqlInternalConnectionTds.cs
- SRef.cs
- Internal.cs
- FilterableAttribute.cs
- DbTypeMap.cs
- Wildcard.cs
- ErrorTolerantObjectWriter.cs
- AppLevelCompilationSectionCache.cs
- DelegatingTypeDescriptionProvider.cs
- EntityCodeGenerator.cs
- MsiStyleLogWriter.cs
- ColorBlend.cs
- ComponentResourceKeyConverter.cs
- DesignerListAdapter.cs
- SystemIcmpV6Statistics.cs
- XsltInput.cs
- GeometryModel3D.cs
- UdpDuplexChannel.cs
- HtmlTextArea.cs
- TemplateBamlRecordReader.cs
- TextEffect.cs
- FixedSOMFixedBlock.cs
- UnsafeNativeMethodsPenimc.cs
- RawStylusInput.cs
- Util.cs
- MailDefinition.cs
- WebScriptClientGenerator.cs
- PassportPrincipal.cs
- OpCodes.cs
- MenuItemBindingCollection.cs
- MergeFilterQuery.cs
- MiniAssembly.cs
- GeometryConverter.cs
- WindowsListViewItem.cs
- NativeMethodsCLR.cs
- ObjectNavigationPropertyMapping.cs
- ParameterBuilder.cs
- CodeThrowExceptionStatement.cs
- ByteConverter.cs
- OSFeature.cs
- EntityContainerAssociationSet.cs
- InfoCardBinaryReader.cs
- Vector3DCollection.cs
- MailWebEventProvider.cs
- MarshalByRefObject.cs
- SmiRecordBuffer.cs
- FixedSchema.cs
- Int32Rect.cs
- WindowsRegion.cs
- TraceEventCache.cs
- Pkcs9Attribute.cs
- InvalidCastException.cs
- StdValidatorsAndConverters.cs
- CodeTypeMember.cs
- Comparer.cs
- XmlSchemaObject.cs
- DataGridState.cs
- EventItfInfo.cs
- WebPartConnectionsCancelVerb.cs
- FormatException.cs
- WebPartUtil.cs
- MimePart.cs
- CustomErrorCollection.cs
- UrlAuthorizationModule.cs
- HtmlFormParameterReader.cs
- _SSPISessionCache.cs
- PerfCounters.cs