Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / SourceChangedEventArgs.cs / 1305600 / SourceChangedEventArgs.cs
using System;
using System.Security;
using System.Security.Permissions;
using MS.Internal;
using MS.Internal.PresentationCore; // SecurityHelper
using MS.Win32;
namespace System.Windows
{
///
/// Provides data for the SourceChanged event.
///
public sealed class SourceChangedEventArgs : RoutedEventArgs
{
///
/// Initializes a new instance of the SourceChangedEventArgs class.
///
///
/// The old source that this handler is being notified about.
///
///
/// The new source that this handler is being notified about.
///
///
/// Critical:This handles critical in the form of PresentationSource but there are demands on the
/// data
/// PublicOK: As this code does not expose the data.
///
[SecurityCritical]
public SourceChangedEventArgs(PresentationSource oldSource,
PresentationSource newSource)
:this(oldSource, newSource, null, null)
{
}
///
/// Initializes a new instance of the SourceChangedEventArgs class.
///
///
/// The old source that this handler is being notified about.
///
///
/// The new source that this handler is being notified about.
///
///
/// The element whose parent changed causing the source to change.
///
///
/// The old parent of the element whose parent changed causing the
/// source to change.
///
///
/// Critical:This handles critical data in the form of PresentationSource but there are demands on the
/// critical data.
/// PublicOK:As this code does not expose any critical data.
///
[SecurityCritical]
public SourceChangedEventArgs(PresentationSource oldSource,
PresentationSource newSource,
IInputElement element,
IInputElement oldParent)
{
_oldSource = new SecurityCriticalData(oldSource);
_newSource = new SecurityCriticalData(newSource);
_element = element;
_oldParent = oldParent;
}
///
/// The old source that this handler is being notified about.
///
///
/// Callers must have UIPermission(UIPermissionWindow.AllWindows) to call this API.
///
///
/// Critical: This handles critical data in the form of PresentationSource but there are demands on the
/// critical data
/// PublicOK: There exists a demand
///
public PresentationSource OldSource
{
[SecurityCritical]
get
{
SecurityHelper.DemandUIWindowPermission();
return _oldSource.Value;
}
}
///
/// The new source that this handler is being notified about.
///
///
/// Callers must have UIPermission(UIPermissionWindow.AllWindows) to call this API.
///
///
/// Critical: This handles critical data in the form of PresentationSource but there are demands on the
/// critical data
/// PublicOK: There exists a demand
///
public PresentationSource NewSource
{
[SecurityCritical]
get
{
SecurityHelper.DemandUIWindowPermission();
return _newSource.Value;
}
}
///
/// The element whose parent changed causing the source to change.
///
public IInputElement Element
{
get {return _element;}
}
///
/// The old parent of the element whose parent changed causing the
/// source to change.
///
public IInputElement OldParent
{
get {return _oldParent;}
}
///
/// The mechanism used to call the type-specific handler on the
/// target.
///
///
/// The generic handler to call in a type-specific way.
///
///
/// The target to call the handler on.
///
protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget)
{
SourceChangedEventHandler handler = (SourceChangedEventHandler) genericHandler;
handler(genericTarget, this);
}
///
/// Critical: This holds reference to a presentation source not safe to give out
///
private SecurityCriticalData _oldSource;
///
/// Critical: This holds reference to a presentation source not safe to give out
///
private SecurityCriticalData _newSource;
private IInputElement _element;
private IInputElement _oldParent;
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
using System;
using System.Security;
using System.Security.Permissions;
using MS.Internal;
using MS.Internal.PresentationCore; // SecurityHelper
using MS.Win32;
namespace System.Windows
{
///
/// Provides data for the SourceChanged event.
///
public sealed class SourceChangedEventArgs : RoutedEventArgs
{
///
/// Initializes a new instance of the SourceChangedEventArgs class.
///
///
/// The old source that this handler is being notified about.
///
///
/// The new source that this handler is being notified about.
///
///
/// Critical:This handles critical in the form of PresentationSource but there are demands on the
/// data
/// PublicOK: As this code does not expose the data.
///
[SecurityCritical]
public SourceChangedEventArgs(PresentationSource oldSource,
PresentationSource newSource)
:this(oldSource, newSource, null, null)
{
}
///
/// Initializes a new instance of the SourceChangedEventArgs class.
///
///
/// The old source that this handler is being notified about.
///
///
/// The new source that this handler is being notified about.
///
///
/// The element whose parent changed causing the source to change.
///
///
/// The old parent of the element whose parent changed causing the
/// source to change.
///
///
/// Critical:This handles critical data in the form of PresentationSource but there are demands on the
/// critical data.
/// PublicOK:As this code does not expose any critical data.
///
[SecurityCritical]
public SourceChangedEventArgs(PresentationSource oldSource,
PresentationSource newSource,
IInputElement element,
IInputElement oldParent)
{
_oldSource = new SecurityCriticalData(oldSource);
_newSource = new SecurityCriticalData(newSource);
_element = element;
_oldParent = oldParent;
}
///
/// The old source that this handler is being notified about.
///
///
/// Callers must have UIPermission(UIPermissionWindow.AllWindows) to call this API.
///
///
/// Critical: This handles critical data in the form of PresentationSource but there are demands on the
/// critical data
/// PublicOK: There exists a demand
///
public PresentationSource OldSource
{
[SecurityCritical]
get
{
SecurityHelper.DemandUIWindowPermission();
return _oldSource.Value;
}
}
///
/// The new source that this handler is being notified about.
///
///
/// Callers must have UIPermission(UIPermissionWindow.AllWindows) to call this API.
///
///
/// Critical: This handles critical data in the form of PresentationSource but there are demands on the
/// critical data
/// PublicOK: There exists a demand
///
public PresentationSource NewSource
{
[SecurityCritical]
get
{
SecurityHelper.DemandUIWindowPermission();
return _newSource.Value;
}
}
///
/// The element whose parent changed causing the source to change.
///
public IInputElement Element
{
get {return _element;}
}
///
/// The old parent of the element whose parent changed causing the
/// source to change.
///
public IInputElement OldParent
{
get {return _oldParent;}
}
///
/// The mechanism used to call the type-specific handler on the
/// target.
///
///
/// The generic handler to call in a type-specific way.
///
///
/// The target to call the handler on.
///
protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget)
{
SourceChangedEventHandler handler = (SourceChangedEventHandler) genericHandler;
handler(genericTarget, this);
}
///
/// Critical: This holds reference to a presentation source not safe to give out
///
private SecurityCriticalData _oldSource;
///
/// Critical: This holds reference to a presentation source not safe to give out
///
private SecurityCriticalData _newSource;
private IInputElement _element;
private IInputElement _oldParent;
}
}
// 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
- WorkflowInvoker.cs
- ScriptComponentDescriptor.cs
- _CacheStreams.cs
- AddInContractAttribute.cs
- BinHexEncoder.cs
- URL.cs
- ReadOnlyDataSourceView.cs
- ThicknessConverter.cs
- SqlComparer.cs
- BamlTreeUpdater.cs
- AsmxEndpointPickerExtension.cs
- SymbolEqualComparer.cs
- HandleExceptionArgs.cs
- ValidationErrorInfo.cs
- SecUtil.cs
- DBNull.cs
- ShapeTypeface.cs
- SafeLibraryHandle.cs
- Interlocked.cs
- TreePrinter.cs
- IdentityModelDictionary.cs
- FontEmbeddingManager.cs
- DataListItemEventArgs.cs
- CreateRefExpr.cs
- MimeParameters.cs
- XamlWriter.cs
- AuthenticationSection.cs
- Win32SafeHandles.cs
- RoutedCommand.cs
- GroupQuery.cs
- MethodRental.cs
- XmlSchemaAll.cs
- KeyValueInternalCollection.cs
- DrawingBrush.cs
- ToolBar.cs
- CodeExpressionStatement.cs
- IndexedGlyphRun.cs
- LineServicesRun.cs
- EditorPartCollection.cs
- EngineSiteSapi.cs
- TableStyle.cs
- AtomicFile.cs
- OleDbConnection.cs
- PreservationFileReader.cs
- DataControlCommands.cs
- DiffuseMaterial.cs
- ObjectTypeMapping.cs
- CompoundFileIOPermission.cs
- FtpWebResponse.cs
- XamlWriter.cs
- ObjectSecurity.cs
- AutoGeneratedFieldProperties.cs
- WindowsToolbarAsMenu.cs
- SQLSingleStorage.cs
- DecoderBestFitFallback.cs
- ExpressionSelection.cs
- MemberInfoSerializationHolder.cs
- CodeCompiler.cs
- Parser.cs
- ScalarOps.cs
- SafeTimerHandle.cs
- relpropertyhelper.cs
- NavigationCommands.cs
- WizardPanel.cs
- XmlConvert.cs
- StoreAnnotationsMap.cs
- TimeSpanSecondsConverter.cs
- Mappings.cs
- EntityRecordInfo.cs
- _NestedMultipleAsyncResult.cs
- InvokeDelegate.cs
- SmtpMail.cs
- SoapConverter.cs
- PrintingPermissionAttribute.cs
- CodeTypeDeclaration.cs
- MenuItem.cs
- SiteOfOriginPart.cs
- ListControlConvertEventArgs.cs
- Path.cs
- ConnectionStringSettings.cs
- CodeEntryPointMethod.cs
- SerialReceived.cs
- EntityContainerAssociationSet.cs
- TreeViewImageIndexConverter.cs
- _CacheStreams.cs
- ProgressBar.cs
- DeferredSelectedIndexReference.cs
- XmlDataSourceView.cs
- PageWrapper.cs
- RewritingValidator.cs
- BaseAsyncResult.cs
- DbReferenceCollection.cs
- CustomValidator.cs
- AutoGeneratedFieldProperties.cs
- QualificationDataAttribute.cs
- ConcurrentQueue.cs
- IncrementalReadDecoders.cs
- KeyFrames.cs
- IncrementalHitTester.cs
- TypeLibConverter.cs