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
- CustomAttribute.cs
- TreeViewHitTestInfo.cs
- BufferedReadStream.cs
- IntegerFacetDescriptionElement.cs
- DataTableReader.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- DataGridItemAutomationPeer.cs
- DescendantQuery.cs
- ListViewUpdateEventArgs.cs
- ProviderException.cs
- AppDomainEvidenceFactory.cs
- InfoCardRequestException.cs
- UInt16Converter.cs
- AlignmentXValidation.cs
- ItemList.cs
- GlyphRunDrawing.cs
- DirectionalLight.cs
- FtpRequestCacheValidator.cs
- IDataContractSurrogate.cs
- FacetDescriptionElement.cs
- DataGridRow.cs
- Socket.cs
- CompositeScriptReferenceEventArgs.cs
- LabelEditEvent.cs
- HashJoinQueryOperatorEnumerator.cs
- WindowsGraphics2.cs
- ActivityInterfaces.cs
- CounterCreationDataCollection.cs
- MultipartContentParser.cs
- Rotation3DAnimationUsingKeyFrames.cs
- ItemsPresenter.cs
- PackWebRequest.cs
- ToolStripStatusLabel.cs
- RegexGroup.cs
- BaseCollection.cs
- JsonByteArrayDataContract.cs
- SymbolType.cs
- ExtensionSimplifierMarkupObject.cs
- XsltQilFactory.cs
- ZipArchive.cs
- ValidationSummary.cs
- UserUseLicenseDictionaryLoader.cs
- ColorInterpolationModeValidation.cs
- FileAuthorizationModule.cs
- SpeechAudioFormatInfo.cs
- SQLBytesStorage.cs
- Atom10FormatterFactory.cs
- DateTimeFormatInfo.cs
- PrintPreviewDialog.cs
- DodSequenceMerge.cs
- ContextMenuService.cs
- XPathDocumentNavigator.cs
- NativeMethods.cs
- HttpHandlerActionCollection.cs
- SynchronizedPool.cs
- TextChangedEventArgs.cs
- InputLanguageEventArgs.cs
- ParserHooks.cs
- HttpWriter.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- BitmapEffectGroup.cs
- __Filters.cs
- ExpandCollapseProviderWrapper.cs
- DiscoveryInnerClientAdhoc11.cs
- SqlAggregateChecker.cs
- SectionInput.cs
- WindowsSpinner.cs
- DBBindings.cs
- DebugView.cs
- UrlPath.cs
- BinHexDecoder.cs
- Padding.cs
- XmlSchemaValidationException.cs
- HighlightComponent.cs
- TypeInfo.cs
- MemberRelationshipService.cs
- InterleavedZipPartStream.cs
- HtmlImage.cs
- Shape.cs
- NavigationFailedEventArgs.cs
- CapabilitiesUse.cs
- AuthorizationRule.cs
- SoapReflector.cs
- TemplateComponentConnector.cs
- WindowsFormsHostPropertyMap.cs
- MetadataFile.cs
- PageThemeBuildProvider.cs
- InplaceBitmapMetadataWriter.cs
- DataKey.cs
- DataGridViewCellCancelEventArgs.cs
- ChineseLunisolarCalendar.cs
- TriggerActionCollection.cs
- Crypto.cs
- DataGridViewCheckBoxColumn.cs
- SingleAnimationBase.cs
- ASCIIEncoding.cs
- AnnotationMap.cs
- SystemInfo.cs
- NullableFloatSumAggregationOperator.cs
- FixedSOMPage.cs