Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Shared / MS / Internal / safesecurityhelperavalon.cs / 1305600 / 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
- MediaTimeline.cs
- SchemaEntity.cs
- PagerSettings.cs
- ControlTemplate.cs
- PersonalizationProviderCollection.cs
- NameValueCache.cs
- DataException.cs
- BooleanToSelectiveScrollingOrientationConverter.cs
- RoleGroup.cs
- UiaCoreTypesApi.cs
- SchemaDeclBase.cs
- PeerNodeTraceRecord.cs
- Polygon.cs
- TimerExtension.cs
- Formatter.cs
- DBParameter.cs
- DependencyObjectPropertyDescriptor.cs
- PolyBezierSegment.cs
- ControlEvent.cs
- SystemGatewayIPAddressInformation.cs
- CellParagraph.cs
- Model3D.cs
- AttachInfo.cs
- DomainConstraint.cs
- DispatchChannelSink.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- ContainerAction.cs
- CqlLexer.cs
- Point.cs
- SafeEventLogWriteHandle.cs
- DateTimeParse.cs
- ProfileService.cs
- EntityDataSourceContextCreatedEventArgs.cs
- PrimitiveList.cs
- MaterialGroup.cs
- Canvas.cs
- EventLevel.cs
- RegexStringValidator.cs
- DbProviderConfigurationHandler.cs
- shaperfactory.cs
- HttpAsyncResult.cs
- Line.cs
- WeakEventManager.cs
- DataServiceRequest.cs
- InstanceLockQueryResult.cs
- WmlValidatorAdapter.cs
- Simplifier.cs
- MaterialCollection.cs
- OrderPreservingMergeHelper.cs
- DbConvert.cs
- HttpListenerTimeoutManager.cs
- MasterPageBuildProvider.cs
- AutomationPeer.cs
- MediaSystem.cs
- BuildProvidersCompiler.cs
- BufferedWebEventProvider.cs
- jithelpers.cs
- cookiecollection.cs
- Msec.cs
- SettingsContext.cs
- thaishape.cs
- InvalidFilterCriteriaException.cs
- prefixendpointaddressmessagefilter.cs
- ImageList.cs
- InvokeProviderWrapper.cs
- HttpProfileBase.cs
- Frame.cs
- DataGridViewRow.cs
- ChameleonKey.cs
- CurrentChangingEventArgs.cs
- InfoCardRSACryptoProvider.cs
- ColumnMapCopier.cs
- KeyValueInternalCollection.cs
- MemberPathMap.cs
- StorageTypeMapping.cs
- SoapProtocolImporter.cs
- PartitionResolver.cs
- DelegatingTypeDescriptionProvider.cs
- ColorAnimationBase.cs
- InitializerFacet.cs
- TextRange.cs
- ConfigurationErrorsException.cs
- SqlCacheDependencySection.cs
- LifetimeServices.cs
- TdsParserSafeHandles.cs
- TextEditorCopyPaste.cs
- ActivityValidator.cs
- Privilege.cs
- HwndSourceParameters.cs
- ConfigurationLoader.cs
- StaticExtensionConverter.cs
- DiscoveryDocumentSearchPattern.cs
- FloatMinMaxAggregationOperator.cs
- Calendar.cs
- WizardStepBase.cs
- FileStream.cs
- UserInitiatedRoutedEventPermission.cs
- GeneralTransform3DGroup.cs
- _NetworkingPerfCounters.cs
- XmlSchemaElement.cs