Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Core / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- IgnoreDeviceFilterElement.cs
- ThreadExceptionEvent.cs
- PnrpPeerResolver.cs
- FilterElement.cs
- Atom10FormatterFactory.cs
- StickyNote.cs
- AuthenticationException.cs
- cryptoapiTransform.cs
- ArrayWithOffset.cs
- FrameworkContentElement.cs
- ClientCredentialsSecurityTokenManager.cs
- DataServiceQueryOfT.cs
- OneWayBindingElementImporter.cs
- TraceListeners.cs
- RightsManagementEncryptionTransform.cs
- PerformanceCounterLib.cs
- RelativeSource.cs
- DrawListViewColumnHeaderEventArgs.cs
- EventLogPermissionAttribute.cs
- SelectedDatesCollection.cs
- BCryptSafeHandles.cs
- RadioButtonStandardAdapter.cs
- counter.cs
- CanExecuteRoutedEventArgs.cs
- TaiwanLunisolarCalendar.cs
- LocatorBase.cs
- RC2CryptoServiceProvider.cs
- EndpointDispatcher.cs
- GenericUriParser.cs
- DummyDataSource.cs
- DataGridTableStyleMappingNameEditor.cs
- RectangleGeometry.cs
- DefaultPropertyAttribute.cs
- XmlKeywords.cs
- Parser.cs
- EntityClientCacheKey.cs
- UserControlAutomationPeer.cs
- Mappings.cs
- HtmlImage.cs
- TagMapCollection.cs
- MultipleViewPattern.cs
- SerializationSectionGroup.cs
- TypedAsyncResult.cs
- LongValidatorAttribute.cs
- NativeRightsManagementAPIsStructures.cs
- WindowsToolbarItemAsMenuItem.cs
- Point3DAnimationUsingKeyFrames.cs
- ValueHandle.cs
- HostProtectionPermission.cs
- ParserHooks.cs
- RemotingServices.cs
- XmlNodeList.cs
- SingleResultAttribute.cs
- XamlPathDataSerializer.cs
- SystemWebSectionGroup.cs
- _OSSOCK.cs
- DbDataAdapter.cs
- MatrixCamera.cs
- BitStream.cs
- TransformerInfoCollection.cs
- ToolStripDropTargetManager.cs
- TypeDefinition.cs
- ListBindingConverter.cs
- KeyTimeConverter.cs
- SharedStatics.cs
- ValueChangedEventManager.cs
- Sql8ExpressionRewriter.cs
- ConcurrentDictionary.cs
- OptimisticConcurrencyException.cs
- DataGridTable.cs
- TraceProvider.cs
- ParallelLoopState.cs
- EtwTrace.cs
- Environment.cs
- XmlIncludeAttribute.cs
- EditorResources.cs
- Maps.cs
- Highlights.cs
- EditorBrowsableAttribute.cs
- Viewport2DVisual3D.cs
- FieldTemplateUserControl.cs
- SqlPersistenceWorkflowInstanceDescription.cs
- OracleLob.cs
- PartEditor.cs
- AsyncOperation.cs
- XPathEmptyIterator.cs
- Process.cs
- BinaryReader.cs
- BufferCache.cs
- ActiveXHost.cs
- WindowsNonControl.cs
- UInt64Converter.cs
- CharacterBuffer.cs
- WorkflowDurableInstance.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- HttpVersion.cs
- CodeCommentStatement.cs
- XmlDownloadManager.cs
- HtmlEncodedRawTextWriter.cs
- XmlMapping.cs