Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- CharKeyFrameCollection.cs
- Throw.cs
- StringDictionaryEditor.cs
- GridViewDeletedEventArgs.cs
- PersonalizationEntry.cs
- MenuAutomationPeer.cs
- PerformanceCounterPermission.cs
- CommonProperties.cs
- KeySpline.cs
- DeviceSpecificDialogCachedState.cs
- WeakReferenceEnumerator.cs
- StringSorter.cs
- OracleNumber.cs
- DataGridViewSelectedColumnCollection.cs
- TextEndOfSegment.cs
- TableSectionStyle.cs
- DataGridViewTextBoxCell.cs
- StreamSecurityUpgradeInitiatorAsyncResult.cs
- BeginStoryboard.cs
- ListViewPagedDataSource.cs
- SafeMemoryMappedFileHandle.cs
- SqlCommand.cs
- PolicyException.cs
- __FastResourceComparer.cs
- FlowNode.cs
- CFStream.cs
- ButtonAutomationPeer.cs
- StringUtil.cs
- WorkItem.cs
- HighlightOverlayGlyph.cs
- DecimalConstantAttribute.cs
- Transactions.cs
- SchemaElement.cs
- SystemWebSectionGroup.cs
- WindowInteractionStateTracker.cs
- _emptywebproxy.cs
- PocoPropertyAccessorStrategy.cs
- Completion.cs
- RequestCacheValidator.cs
- WindowsAuthenticationModule.cs
- BulletDecorator.cs
- StrongTypingException.cs
- BitmapEffectDrawing.cs
- ISO2022Encoding.cs
- FieldValue.cs
- DatePicker.cs
- OrderByQueryOptionExpression.cs
- CheckBoxField.cs
- DataGridViewDataConnection.cs
- baseshape.cs
- DiscoveryDocumentLinksPattern.cs
- LogManagementAsyncResult.cs
- WebPartVerb.cs
- DoubleLinkListEnumerator.cs
- Dispatcher.cs
- Attributes.cs
- ProfileSettingsCollection.cs
- XmlNamespaceMappingCollection.cs
- GeneratedCodeAttribute.cs
- SignedInfo.cs
- UnionCodeGroup.cs
- DataBoundControlAdapter.cs
- CompositeTypefaceMetrics.cs
- OleDbReferenceCollection.cs
- CustomAttributeSerializer.cs
- ToolStripLocationCancelEventArgs.cs
- UserNamePasswordValidator.cs
- RadioButton.cs
- ValidationHelper.cs
- RunClient.cs
- ProcessModuleCollection.cs
- Pointer.cs
- processwaithandle.cs
- FreeFormDragDropManager.cs
- TimeSpanSecondsConverter.cs
- WebBrowser.cs
- QueueException.cs
- CodeCommentStatementCollection.cs
- XmlSchemaFacet.cs
- DataTemplateSelector.cs
- Vector3DCollectionConverter.cs
- ApplicationSecurityInfo.cs
- CapabilitiesState.cs
- BlurBitmapEffect.cs
- FontFamilyValueSerializer.cs
- GestureRecognitionResult.cs
- ComponentCodeDomSerializer.cs
- ConfigViewGenerator.cs
- BlobPersonalizationState.cs
- DynamicRendererThreadManager.cs
- CompilerCollection.cs
- NewItemsContextMenuStrip.cs
- HttpWebRequestElement.cs
- RegisteredHiddenField.cs
- ObjectTypeMapping.cs
- ToolCreatedEventArgs.cs
- XmlIgnoreAttribute.cs
- AssemblyAttributesGoHere.cs
- DataGridColumn.cs
- ParenthesizePropertyNameAttribute.cs