Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / 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: [....] 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
- SqlDataSourceCache.cs
- cookieexception.cs
- Environment.cs
- FormClosingEvent.cs
- ConnectionsZoneAutoFormat.cs
- SelectionChangedEventArgs.cs
- ComPlusInstanceContextInitializer.cs
- SectionVisual.cs
- MSAANativeProvider.cs
- CompositeActivityTypeDescriptor.cs
- NameValueFileSectionHandler.cs
- TaskExceptionHolder.cs
- TrustManager.cs
- TextSearch.cs
- ItemCollection.cs
- WebControlAdapter.cs
- IndexOutOfRangeException.cs
- WebSysDescriptionAttribute.cs
- KnownColorTable.cs
- DeferrableContentConverter.cs
- ToolStripOverflow.cs
- CodeSnippetTypeMember.cs
- ConcurrentStack.cs
- EditorAttribute.cs
- ProxyGenerator.cs
- EmbeddedMailObject.cs
- FrameAutomationPeer.cs
- fixedPageContentExtractor.cs
- FixedSOMTableCell.cs
- HtmlTableRowCollection.cs
- CodeCatchClauseCollection.cs
- OleDbStruct.cs
- StructuralType.cs
- StyleCollectionEditor.cs
- OdbcConnectionString.cs
- PermissionRequestEvidence.cs
- Stack.cs
- DataGridViewAccessibleObject.cs
- EndpointInstanceProvider.cs
- FontFamilyConverter.cs
- DefinitionBase.cs
- CodePrimitiveExpression.cs
- ListViewItemMouseHoverEvent.cs
- StickyNoteHelper.cs
- SqlMethodAttribute.cs
- EtwTrace.cs
- RequestDescription.cs
- SelectionWordBreaker.cs
- CustomAttributeSerializer.cs
- XmlHierarchyData.cs
- CodeLabeledStatement.cs
- PageThemeBuildProvider.cs
- SqlServer2KCompatibilityAnnotation.cs
- XmlCollation.cs
- InstalledFontCollection.cs
- SoapFault.cs
- QuaternionAnimation.cs
- ForceCopyBuildProvider.cs
- TextEffect.cs
- FrameworkElementAutomationPeer.cs
- OletxVolatileEnlistment.cs
- DrawingVisualDrawingContext.cs
- SoundPlayer.cs
- DSACryptoServiceProvider.cs
- followingquery.cs
- UTF8Encoding.cs
- ScrollChrome.cs
- CurrentChangedEventManager.cs
- MessageBuilder.cs
- _FixedSizeReader.cs
- BitVector32.cs
- BindingValueChangedEventArgs.cs
- HttpInputStream.cs
- JsonFormatReaderGenerator.cs
- KerberosSecurityTokenProvider.cs
- ModuleBuilderData.cs
- AdRotator.cs
- WorkflowQueue.cs
- HtmlForm.cs
- JumpItem.cs
- ValidationHelpers.cs
- HttpHandlerActionCollection.cs
- WhitespaceRule.cs
- FileDialogCustomPlace.cs
- TextSchema.cs
- OrderedDictionaryStateHelper.cs
- __Error.cs
- IncrementalHitTester.cs
- DictionaryEditChange.cs
- ListViewTableCell.cs
- OleDbCommand.cs
- AssemblyBuilder.cs
- ComEventsSink.cs
- WebPartHelpVerb.cs
- CaseInsensitiveHashCodeProvider.cs
- Label.cs
- BooleanSwitch.cs
- PassportAuthentication.cs
- WindowsRichEdit.cs
- ServerReliableChannelBinder.cs