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
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CodeAttributeArgument.cs
- MatrixTransform3D.cs
- RowVisual.cs
- SystemInformation.cs
- DataTemplateKey.cs
- SqlDataSourceCache.cs
- DES.cs
- SiteMap.cs
- WpfGeneratedKnownTypes.cs
- ComEventsHelper.cs
- MetabaseServerConfig.cs
- SQLMembershipProvider.cs
- CodeDirectoryCompiler.cs
- CodeDirectoryCompiler.cs
- SessionPageStatePersister.cs
- CodeLinePragma.cs
- DataServiceProcessingPipelineEventArgs.cs
- DropShadowEffect.cs
- CustomError.cs
- ReadOnlyState.cs
- WebPartMenu.cs
- COM2DataTypeToManagedDataTypeConverter.cs
- DecimalStorage.cs
- PhysicalAddress.cs
- ToolStripRenderEventArgs.cs
- RayHitTestParameters.cs
- RegistrationServices.cs
- CharConverter.cs
- InputLangChangeEvent.cs
- TableColumn.cs
- TrackingProfile.cs
- SQLInt16.cs
- ShaperBuffers.cs
- DocComment.cs
- PropertyTabAttribute.cs
- HtmlShimManager.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- IisTraceWebEventProvider.cs
- DateTimeValueSerializerContext.cs
- AssemblyFilter.cs
- Configuration.cs
- MostlySingletonList.cs
- TreeViewAutomationPeer.cs
- Encoding.cs
- TextServicesPropertyRanges.cs
- MenuItemBindingCollection.cs
- ErrorEventArgs.cs
- SQLConvert.cs
- EdmType.cs
- BitmapEffectGeneralTransform.cs
- ReadingWritingEntityEventArgs.cs
- DataGridViewCellLinkedList.cs
- WeakEventTable.cs
- IconEditor.cs
- ButtonAutomationPeer.cs
- CompilerResults.cs
- PermissionSet.cs
- DelayedRegex.cs
- MethodExpression.cs
- Utility.cs
- Partitioner.cs
- SchemaMapping.cs
- MessageSecurityOverHttpElement.cs
- DataPagerFieldItem.cs
- ListenerAdapterBase.cs
- EncryptedKeyHashIdentifierClause.cs
- AttributeTableBuilder.cs
- behaviorssection.cs
- ipaddressinformationcollection.cs
- ThreadAbortException.cs
- MobileListItemCollection.cs
- VisualBrush.cs
- XPathSingletonIterator.cs
- LongSumAggregationOperator.cs
- WebPartMenuStyle.cs
- DragEvent.cs
- ObjectStateEntry.cs
- Deserializer.cs
- PartialTrustHelpers.cs
- Int32Rect.cs
- RecognizerBase.cs
- LiteralTextContainerControlBuilder.cs
- XmlAtomicValue.cs
- BinaryFormatterWriter.cs
- Vector3D.cs
- OleDbDataAdapter.cs
- AutoResetEvent.cs
- RegexGroupCollection.cs
- TypeToken.cs
- TemplatedWizardStep.cs
- JsonMessageEncoderFactory.cs
- SoapEnumAttribute.cs
- PartDesigner.cs
- GridViewSelectEventArgs.cs
- StatusBarPanel.cs
- PipelineModuleStepContainer.cs
- RemoteAsymmetricSignatureFormatter.cs
- AccessViolationException.cs
- ScaleTransform3D.cs
- IPCCacheManager.cs