Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- KeyNotFoundException.cs
- CopyOfAction.cs
- StickyNoteHelper.cs
- DefaultMemberAttribute.cs
- HyperLinkField.cs
- SessionEndingEventArgs.cs
- NamespaceEmitter.cs
- SctClaimSerializer.cs
- HttpInputStream.cs
- WebPartChrome.cs
- LinqDataSourceHelper.cs
- WebPartsPersonalizationAuthorization.cs
- DataException.cs
- RemotingException.cs
- SingleConverter.cs
- ProgressBarRenderer.cs
- MenuBase.cs
- TextViewBase.cs
- RepeatBehavior.cs
- DictionaryEntry.cs
- SecureEnvironment.cs
- RTLAwareMessageBox.cs
- RuleSettingsCollection.cs
- FontFamilyConverter.cs
- VersionedStreamOwner.cs
- HttpWriter.cs
- ProfileBuildProvider.cs
- TreeNodeBinding.cs
- ExtractCollection.cs
- SByte.cs
- CodeGroup.cs
- LicenseException.cs
- Tablet.cs
- XmlCountingReader.cs
- CustomCredentialPolicy.cs
- SqlReferenceCollection.cs
- BinaryReader.cs
- DataSourceCollectionBase.cs
- DebugInfo.cs
- WebRequest.cs
- ComNativeDescriptor.cs
- SafeEventLogWriteHandle.cs
- MethodExpr.cs
- TimeSpan.cs
- ComponentEditorPage.cs
- PathNode.cs
- TextEditorDragDrop.cs
- DataGridViewCellStyleConverter.cs
- XpsFilter.cs
- Lease.cs
- _ContextAwareResult.cs
- MatrixValueSerializer.cs
- Permission.cs
- FormsAuthenticationCredentials.cs
- SafeNativeMethods.cs
- ProcessHostMapPath.cs
- StaticFileHandler.cs
- XmlSchemaSimpleTypeUnion.cs
- MissingFieldException.cs
- DispatcherSynchronizationContext.cs
- MailSettingsSection.cs
- NotImplementedException.cs
- _ListenerResponseStream.cs
- WebPartConnectionsConnectVerb.cs
- TextEmbeddedObject.cs
- HotSpotCollection.cs
- SiteMapHierarchicalDataSourceView.cs
- ItemType.cs
- LinqToSqlWrapper.cs
- LassoHelper.cs
- TextEditorCopyPaste.cs
- AbsoluteQuery.cs
- ObjectNotFoundException.cs
- Annotation.cs
- QueryOutputWriterV1.cs
- AdjustableArrowCap.cs
- ApplicationTrust.cs
- PrefixHandle.cs
- InvalidDataContractException.cs
- Axis.cs
- DataGridItemCollection.cs
- SortQueryOperator.cs
- MatrixTransform3D.cs
- BrushValueSerializer.cs
- TreeViewImageKeyConverter.cs
- Animatable.cs
- TablePattern.cs
- CodeVariableReferenceExpression.cs
- XmlDataImplementation.cs
- TemplateXamlParser.cs
- CompModSwitches.cs
- RtfNavigator.cs
- DropShadowEffect.cs
- InfoCardTrace.cs
- HtmlInputHidden.cs
- ValueUnavailableException.cs
- StateManagedCollection.cs
- ControlBindingsConverter.cs
- MLangCodePageEncoding.cs
- ClickablePoint.cs