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
- rsa.cs
- GeometryHitTestParameters.cs
- AppDomainProtocolHandler.cs
- PerformanceCounterNameAttribute.cs
- SerializeAbsoluteContext.cs
- GregorianCalendarHelper.cs
- HitTestResult.cs
- Options.cs
- PasswordBoxAutomationPeer.cs
- DataGridViewRowPostPaintEventArgs.cs
- TableLayoutPanelCellPosition.cs
- SyndicationCategory.cs
- InstanceLockedException.cs
- BulletedListEventArgs.cs
- TCPListener.cs
- ExtensionFile.cs
- BulletChrome.cs
- _Events.cs
- EventData.cs
- AccessibilityHelperForXpWin2k3.cs
- CheckableControlBaseAdapter.cs
- MessagePropertyAttribute.cs
- ToolStripOverflowButton.cs
- EntityContainerEmitter.cs
- HtmlEmptyTagControlBuilder.cs
- RichListBox.cs
- AttributeXamlType.cs
- KnownAssembliesSet.cs
- DotExpr.cs
- ListViewEditEventArgs.cs
- ServiceOperationParameter.cs
- PropertyIDSet.cs
- InvalidFilterCriteriaException.cs
- CheckoutException.cs
- WindowsSpinner.cs
- DataGridItem.cs
- SqlNotificationEventArgs.cs
- AttributeCollection.cs
- QueryOutputWriter.cs
- DataGridTextBoxColumn.cs
- ChannelSinkStacks.cs
- CompilerError.cs
- Speller.cs
- PointConverter.cs
- CapabilitiesAssignment.cs
- ScrollItemPatternIdentifiers.cs
- PkcsUtils.cs
- ResolveDuplexAsyncResult.cs
- DragEvent.cs
- CodeEventReferenceExpression.cs
- AvTraceDetails.cs
- ExceptionNotification.cs
- ProcessHostMapPath.cs
- ElementsClipboardData.cs
- ScrollProviderWrapper.cs
- ISFClipboardData.cs
- AdornedElementPlaceholder.cs
- SoundPlayerAction.cs
- QuaternionAnimationUsingKeyFrames.cs
- StringDictionary.cs
- NameValueSectionHandler.cs
- SafeSecurityHelper.cs
- RowUpdatingEventArgs.cs
- SecurityTokenRequirement.cs
- TreeBuilderXamlTranslator.cs
- GlobalAllocSafeHandle.cs
- CodeAccessSecurityEngine.cs
- FormViewDeleteEventArgs.cs
- OdbcErrorCollection.cs
- ToolStripDesignerAvailabilityAttribute.cs
- ModelUIElement3D.cs
- XmlILModule.cs
- SecurityKeyUsage.cs
- PipelineModuleStepContainer.cs
- HandlerWithFactory.cs
- VScrollBar.cs
- FontSourceCollection.cs
- MILUtilities.cs
- DataRelationCollection.cs
- RootBrowserWindowProxy.cs
- ActionFrame.cs
- EditorZone.cs
- FileDialog.cs
- BigInt.cs
- TreeNodeMouseHoverEvent.cs
- UrlAuthFailedErrorFormatter.cs
- OperationCanceledException.cs
- WorkerRequest.cs
- ImplicitInputBrush.cs
- ChannelOptions.cs
- Executor.cs
- TransformerInfoCollection.cs
- oledbconnectionstring.cs
- BrushMappingModeValidation.cs
- Solver.cs
- CompositeDuplexBindingElementImporter.cs
- PauseStoryboard.cs
- AdPostCacheSubstitution.cs
- CodeTypeConstructor.cs
- WizardForm.cs