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
- PropVariant.cs
- KeyConverter.cs
- ConfigXmlCDataSection.cs
- CheckBoxRenderer.cs
- KeyValuePairs.cs
- PropertyItemInternal.cs
- MulticastDelegate.cs
- TrackingMemoryStreamFactory.cs
- SystemWebSectionGroup.cs
- SymbolType.cs
- XsdDateTime.cs
- ContractHandle.cs
- ModuleBuilderData.cs
- WebPartEditorApplyVerb.cs
- ADMembershipUser.cs
- DataGridViewLinkColumn.cs
- WindowsScrollBar.cs
- TcpConnectionPool.cs
- StorageRoot.cs
- SQLStringStorage.cs
- LocalizableAttribute.cs
- DllHostInitializer.cs
- WindowsTooltip.cs
- DBBindings.cs
- SqlOuterApplyReducer.cs
- GraphicsState.cs
- DataGridViewCheckBoxColumn.cs
- RtfToXamlLexer.cs
- DoubleAnimation.cs
- HostVisual.cs
- DataBindEngine.cs
- TextReader.cs
- FontSizeConverter.cs
- DetailsViewUpdateEventArgs.cs
- WindowPattern.cs
- TemplatePartAttribute.cs
- Rfc2898DeriveBytes.cs
- InfoCardMasterKey.cs
- JavaScriptSerializer.cs
- SHA384Cng.cs
- DataGridViewCellStyleEditor.cs
- BigIntegerStorage.cs
- ToolStripStatusLabel.cs
- ToolStripDropDownMenu.cs
- DES.cs
- PeerNameResolver.cs
- SimpleBitVector32.cs
- PerfService.cs
- ResourceReader.cs
- MarkedHighlightComponent.cs
- FunctionQuery.cs
- SudsCommon.cs
- StyleReferenceConverter.cs
- BufferedGraphicsManager.cs
- DataBoundLiteralControl.cs
- WindowsScrollBar.cs
- _SslState.cs
- ObjectSecurityT.cs
- RelatedPropertyManager.cs
- GeometryDrawing.cs
- PropertyExpression.cs
- StateWorkerRequest.cs
- TransactionContextValidator.cs
- XXXInfos.cs
- UntypedNullExpression.cs
- TextServicesPropertyRanges.cs
- AdjustableArrowCap.cs
- ControlAdapter.cs
- OleDbRowUpdatingEvent.cs
- OleStrCAMarshaler.cs
- ElementsClipboardData.cs
- Repeater.cs
- DbModificationCommandTree.cs
- XmlSchemaInclude.cs
- AutoGeneratedField.cs
- DynamicQueryStringParameter.cs
- SubclassTypeValidatorAttribute.cs
- SendActivityValidator.cs
- MonikerProxyAttribute.cs
- CacheDependency.cs
- XmlSchemaValidator.cs
- SpeakCompletedEventArgs.cs
- NodeLabelEditEvent.cs
- WindowClosedEventArgs.cs
- SwitchAttribute.cs
- EventData.cs
- ExecutedRoutedEventArgs.cs
- AggregatePushdown.cs
- ClientSideQueueItem.cs
- FixedSchema.cs
- SubMenuStyleCollection.cs
- CompoundFileReference.cs
- BitmapData.cs
- LoginDesigner.cs
- DSACryptoServiceProvider.cs
- HostedHttpContext.cs
- Durable.cs
- CodeIndexerExpression.cs
- StringExpressionSet.cs
- QilParameter.cs