Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Core / CSharp / System / Windows / SourceChangedEventArgs.cs / 1 / 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
- RawStylusInputReport.cs
- LongValidator.cs
- CookielessHelper.cs
- InstallerTypeAttribute.cs
- TemplateXamlParser.cs
- ComplexPropertyEntry.cs
- EditingCoordinator.cs
- ShutDownListener.cs
- TreeIterator.cs
- DbModificationClause.cs
- StylusPointCollection.cs
- CoTaskMemHandle.cs
- Metafile.cs
- BamlTreeUpdater.cs
- UnconditionalPolicy.cs
- ResourceCategoryAttribute.cs
- SEHException.cs
- ComboBoxItem.cs
- SqlCacheDependency.cs
- RegisteredHiddenField.cs
- PackageRelationshipCollection.cs
- PagesSection.cs
- DataGridLengthConverter.cs
- InvalidPropValue.cs
- Validator.cs
- HtmlPageAdapter.cs
- ServiceNameCollection.cs
- XmlValueConverter.cs
- ActivitiesCollection.cs
- UnionQueryOperator.cs
- BufferedReceiveManager.cs
- GridItemCollection.cs
- BufferedGraphicsManager.cs
- MenuItemStyle.cs
- BamlTreeNode.cs
- CharKeyFrameCollection.cs
- CategoryAttribute.cs
- CounterSetInstance.cs
- RegistrySecurity.cs
- ObjectStorage.cs
- SpellCheck.cs
- AppDomainEvidenceFactory.cs
- MulticastNotSupportedException.cs
- PersonalizationState.cs
- Perspective.cs
- BmpBitmapEncoder.cs
- LocalizedNameDescriptionPair.cs
- XPathDocument.cs
- UnmanagedMarshal.cs
- InputScopeConverter.cs
- NameValuePermission.cs
- Environment.cs
- CharEntityEncoderFallback.cs
- ParserOptions.cs
- ExpressionList.cs
- GroupDescription.cs
- OdbcDataReader.cs
- CommandEventArgs.cs
- Label.cs
- SemanticResolver.cs
- NullToBooleanConverter.cs
- CustomError.cs
- UriSectionReader.cs
- FileLogRecordStream.cs
- BooleanProjectedSlot.cs
- XamlSerializerUtil.cs
- BindingExpressionBase.cs
- SoapHeader.cs
- SqlAggregateChecker.cs
- __FastResourceComparer.cs
- ScrollViewer.cs
- DataFormats.cs
- RegexCode.cs
- SecureConversationSecurityTokenParameters.cs
- ProfileGroupSettings.cs
- WorkflowItemPresenter.cs
- DrawingAttributes.cs
- MessagingActivityHelper.cs
- PrePostDescendentsWalker.cs
- ConfigurationStrings.cs
- OleDbMetaDataFactory.cs
- SoapElementAttribute.cs
- ConsumerConnectionPoint.cs
- RedistVersionInfo.cs
- ItemChangedEventArgs.cs
- TableRowCollection.cs
- DriveInfo.cs
- SerialPinChanges.cs
- PasswordPropertyTextAttribute.cs
- FunctionUpdateCommand.cs
- CodeIndexerExpression.cs
- HwndMouseInputProvider.cs
- SqlRecordBuffer.cs
- DocumentXPathNavigator.cs
- IFlowDocumentViewer.cs
- HttpChannelBindingToken.cs
- DefinitionUpdate.cs
- WinEventQueueItem.cs
- Emitter.cs
- IChannel.cs