Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- ConfigurationStrings.cs
- PeerContact.cs
- HwndHostAutomationPeer.cs
- DataMisalignedException.cs
- SourceFilter.cs
- SocketException.cs
- Decimal.cs
- SemaphoreSecurity.cs
- GridViewCommandEventArgs.cs
- Preprocessor.cs
- InputReport.cs
- MailWriter.cs
- PhysicalOps.cs
- BuildResultCache.cs
- Misc.cs
- QilDataSource.cs
- DrawingAttributes.cs
- HttpResponseHeader.cs
- CqlGenerator.cs
- RegexCharClass.cs
- HostingEnvironment.cs
- BlobPersonalizationState.cs
- XmlSchemaDocumentation.cs
- XPathDocumentNavigator.cs
- TableDetailsCollection.cs
- TemplateComponentConnector.cs
- GradientStopCollection.cs
- AssociatedControlConverter.cs
- HyperlinkAutomationPeer.cs
- SimpleExpression.cs
- ApplicationGesture.cs
- PrimitiveXmlSerializers.cs
- PointConverter.cs
- CharacterBufferReference.cs
- PageSetupDialog.cs
- GlobalizationAssembly.cs
- DataGridAutoFormat.cs
- Rights.cs
- NullableFloatMinMaxAggregationOperator.cs
- PassportIdentity.cs
- wmiprovider.cs
- QilXmlReader.cs
- PKCS1MaskGenerationMethod.cs
- CategoryAttribute.cs
- CopyCodeAction.cs
- ParameterElementCollection.cs
- BaseTemplateBuildProvider.cs
- UrlPath.cs
- DataTableTypeConverter.cs
- TypeExtensionConverter.cs
- DataTableMappingCollection.cs
- SymmetricSecurityProtocol.cs
- UdpChannelListener.cs
- DataRecordInternal.cs
- Normalization.cs
- SocketAddress.cs
- EntityDataSourceQueryBuilder.cs
- XmlComplianceUtil.cs
- ThreadSafeList.cs
- CodeCatchClause.cs
- SerializationStore.cs
- ContactManager.cs
- CTreeGenerator.cs
- Deserializer.cs
- InvalidAsynchronousStateException.cs
- Missing.cs
- SimpleFileLog.cs
- InkPresenter.cs
- TabControlCancelEvent.cs
- TableCell.cs
- ArrangedElement.cs
- TabControl.cs
- PolyLineSegment.cs
- GridView.cs
- SystemResources.cs
- Application.cs
- ParentQuery.cs
- ObjectTag.cs
- DataServiceHostFactory.cs
- RMPermissions.cs
- ExecutorLocksHeldException.cs
- DataGridViewRowsRemovedEventArgs.cs
- milrender.cs
- EventBuilder.cs
- PreviewPrintController.cs
- Misc.cs
- DataGridViewBand.cs
- CodeSubDirectory.cs
- ToolStripMenuItemCodeDomSerializer.cs
- DataContract.cs
- DoubleConverter.cs
- AtomContentProperty.cs
- CryptoProvider.cs
- ViewCellSlot.cs
- BasePattern.cs
- TabRenderer.cs
- XmlSchemaComplexContent.cs
- AuthenticationModulesSection.cs
- DataGridPageChangedEventArgs.cs
- SplineQuaternionKeyFrame.cs