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
- Debug.cs
- MessageQueuePermissionEntryCollection.cs
- Style.cs
- BuilderPropertyEntry.cs
- SiteMap.cs
- PageThemeCodeDomTreeGenerator.cs
- ExpressionBuilder.cs
- PropertyPath.cs
- HtmlInputControl.cs
- ViewManager.cs
- ZipIOBlockManager.cs
- WebPartDisplayMode.cs
- CroppedBitmap.cs
- Mutex.cs
- IgnoreDeviceFilterElement.cs
- Point3DKeyFrameCollection.cs
- AdapterUtil.cs
- Int16AnimationBase.cs
- BrushValueSerializer.cs
- ArrayElementGridEntry.cs
- iisPickupDirectory.cs
- DbMetaDataCollectionNames.cs
- MsmqBindingElementBase.cs
- CompressionTransform.cs
- CalendarAutoFormatDialog.cs
- SearchForVirtualItemEventArgs.cs
- RemoveStoryboard.cs
- DataProtectionSecurityStateEncoder.cs
- CodeGroup.cs
- DataServiceRequestOfT.cs
- ProtectedUri.cs
- ConfigPathUtility.cs
- ArraySortHelper.cs
- MaterialGroup.cs
- SafeNativeMethodsMilCoreApi.cs
- CallbackValidatorAttribute.cs
- SetStoryboardSpeedRatio.cs
- NavigationFailedEventArgs.cs
- XmlSerializerNamespaces.cs
- ControllableStoryboardAction.cs
- ContentPresenter.cs
- WebPartMinimizeVerb.cs
- CodeExpressionStatement.cs
- UpDownBase.cs
- _FtpControlStream.cs
- AttributeXamlType.cs
- XmlWrappingWriter.cs
- CaseInsensitiveHashCodeProvider.cs
- EventHandlingScope.cs
- PtsHost.cs
- DataGridTablesFactory.cs
- PassportAuthenticationEventArgs.cs
- EdmToObjectNamespaceMap.cs
- altserialization.cs
- HttpResponseHeader.cs
- BamlTreeUpdater.cs
- ObjectViewFactory.cs
- ParameterCollection.cs
- ButtonBaseAutomationPeer.cs
- BitmapSource.cs
- Process.cs
- SettingsBase.cs
- Message.cs
- GroupQuery.cs
- RadioButtonStandardAdapter.cs
- PropertyGeneratedEventArgs.cs
- Triplet.cs
- StringUtil.cs
- OdbcDataAdapter.cs
- CodeTryCatchFinallyStatement.cs
- _Win32.cs
- NegotiationTokenProvider.cs
- recordstatescratchpad.cs
- DataFormat.cs
- MaterialCollection.cs
- SmiEventSink_Default.cs
- SqlDataSourceStatusEventArgs.cs
- ObjectListSelectEventArgs.cs
- DependencyPropertyHelper.cs
- DataGridPagerStyle.cs
- xml.cs
- CompareInfo.cs
- XmlSchemaImporter.cs
- CTreeGenerator.cs
- EntityProviderFactory.cs
- FigureHelper.cs
- TextControlDesigner.cs
- DebuggerAttributes.cs
- BindingContext.cs
- FontNamesConverter.cs
- WebPartZoneBase.cs
- ScrollPattern.cs
- AppDomainInstanceProvider.cs
- TimestampInformation.cs
- AsynchronousChannel.cs
- CounterCreationDataCollection.cs
- PointCollection.cs
- ReadOnlyHierarchicalDataSourceView.cs
- DiscoveryClientReferences.cs
- URLIdentityPermission.cs