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
- SequenceDesignerAccessibleObject.cs
- DefaultValueTypeConverter.cs
- AttributeParameterInfo.cs
- Rfc2898DeriveBytes.cs
- SimpleLine.cs
- PolicyReader.cs
- login.cs
- ByteAnimationBase.cs
- FontCollection.cs
- Triplet.cs
- BezierSegment.cs
- SHA512.cs
- TabRenderer.cs
- OutputCacheProfileCollection.cs
- KeyboardDevice.cs
- InfoCardSymmetricCrypto.cs
- RenderTargetBitmap.cs
- ConnectionsZone.cs
- EditingCommands.cs
- SqlTransaction.cs
- HttpHandlerAction.cs
- ConnectionStringsSection.cs
- ImageMapEventArgs.cs
- RuntimeEnvironment.cs
- SessionState.cs
- DelegatingStream.cs
- BitmapEffectRenderDataResource.cs
- _DigestClient.cs
- TextTreeRootTextBlock.cs
- SeverityFilter.cs
- BrowserTree.cs
- HierarchicalDataSourceControl.cs
- InteropDesigner.xaml.cs
- DependencyPropertyConverter.cs
- TextElementAutomationPeer.cs
- _AutoWebProxyScriptHelper.cs
- DrawingDrawingContext.cs
- PointCollectionValueSerializer.cs
- DataSvcMapFileSerializer.cs
- XmlAnyElementAttributes.cs
- ActivityTrace.cs
- InstallerTypeAttribute.cs
- CapabilitiesUse.cs
- FolderLevelBuildProviderCollection.cs
- Vector3DConverter.cs
- TTSVoice.cs
- SqlRetyper.cs
- LowerCaseStringConverter.cs
- UserControl.cs
- XmlHierarchicalDataSourceView.cs
- UIElement3D.cs
- OrderablePartitioner.cs
- HtmlTextArea.cs
- WebResourceUtil.cs
- SQLSingle.cs
- ClockController.cs
- PolygonHotSpot.cs
- SingleKeyFrameCollection.cs
- DataGridViewLinkColumn.cs
- QuaternionAnimation.cs
- PrintDialog.cs
- UserPersonalizationStateInfo.cs
- DocumentPaginator.cs
- XmlTextAttribute.cs
- TextTreeObjectNode.cs
- WebPartEditorCancelVerb.cs
- EdmPropertyAttribute.cs
- InvalidCommandTreeException.cs
- TableRowGroupCollection.cs
- TextElementEnumerator.cs
- Rect.cs
- DataGridComboBoxColumn.cs
- DebuggerAttributes.cs
- StringUtil.cs
- UIPropertyMetadata.cs
- ExtensionWindow.cs
- DictionarySectionHandler.cs
- WebBrowser.cs
- HttpResponseWrapper.cs
- Menu.cs
- DataGridDetailsPresenter.cs
- _ShellExpression.cs
- OracleString.cs
- NamespaceDisplay.xaml.cs
- XmlValidatingReader.cs
- Catch.cs
- SocketConnection.cs
- ProtocolsConfigurationEntry.cs
- SystemIcmpV6Statistics.cs
- TcpConnectionPoolSettings.cs
- ISFClipboardData.cs
- JoinSymbol.cs
- StrokeCollection2.cs
- BitmapDecoder.cs
- XmlFormatExtensionAttribute.cs
- SectionInput.cs
- ConnectionPoolManager.cs
- MonitorWrapper.cs
- Container.cs
- DrawingImage.cs