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
- TreeView.cs
- ButtonColumn.cs
- BuildManagerHost.cs
- CompositeFontInfo.cs
- GridToolTip.cs
- AssemblyBuilder.cs
- httpapplicationstate.cs
- CollectionViewSource.cs
- Flattener.cs
- ResetableIterator.cs
- DataGridViewComboBoxColumn.cs
- SvcMapFile.cs
- CellRelation.cs
- NetStream.cs
- FreezableOperations.cs
- Vector3D.cs
- StringCollection.cs
- GeneralTransform.cs
- VariableQuery.cs
- DataColumnChangeEvent.cs
- RubberbandSelector.cs
- QueryContext.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- ValidateNames.cs
- WebPartDisplayModeCollection.cs
- XamlStyleSerializer.cs
- Converter.cs
- Table.cs
- StateMachineHistory.cs
- TextModifier.cs
- KnownTypesHelper.cs
- ClientProtocol.cs
- HtmlInputPassword.cs
- CompilerLocalReference.cs
- ObjectHandle.cs
- ExtenderHelpers.cs
- RemoteWebConfigurationHost.cs
- TreeBuilder.cs
- ScriptControlDescriptor.cs
- SqlMethods.cs
- LocalizationComments.cs
- MsmqChannelFactoryBase.cs
- HierarchicalDataSourceConverter.cs
- IndexedEnumerable.cs
- ToolStripRenderer.cs
- OperationCanceledException.cs
- ActivityCollectionMarkupSerializer.cs
- SafeTokenHandle.cs
- HtmlToClrEventProxy.cs
- FileLoadException.cs
- CrossContextChannel.cs
- PlatformCulture.cs
- RtfControlWordInfo.cs
- HelpHtmlBuilder.cs
- Properties.cs
- XmlDocumentSerializer.cs
- TextBoxLine.cs
- DataGridToolTip.cs
- Script.cs
- DataGridParentRows.cs
- ServiceHttpHandlerFactory.cs
- MasterPageParser.cs
- SqlComparer.cs
- QilTargetType.cs
- ResourceReader.cs
- XmlSchemaRedefine.cs
- ConfigUtil.cs
- FontStretches.cs
- WebServiceTypeData.cs
- HttpCookieCollection.cs
- NetStream.cs
- HitTestResult.cs
- DataSourceControlBuilder.cs
- DropTarget.cs
- SamlAttributeStatement.cs
- Point3DConverter.cs
- DocumentsTrace.cs
- BindingsCollection.cs
- CompModSwitches.cs
- ToolStripContentPanelRenderEventArgs.cs
- Compiler.cs
- CopyOnWriteList.cs
- EntityKeyElement.cs
- RestHandler.cs
- _UriSyntax.cs
- SafeCertificateStore.cs
- KeyboardNavigation.cs
- InnerItemCollectionView.cs
- NameSpaceExtractor.cs
- WaitHandle.cs
- ApplicationInterop.cs
- HitTestParameters.cs
- AutoCompleteStringCollection.cs
- TrackBar.cs
- ColumnCollectionEditor.cs
- NavigateEvent.cs
- ReachSerializationUtils.cs
- SparseMemoryStream.cs
- PassportAuthenticationEventArgs.cs
- HttpProfileGroupBase.cs