Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- GridViewColumnCollectionChangedEventArgs.cs
- ToolStripPanelSelectionGlyph.cs
- PageBuildProvider.cs
- XmlCharType.cs
- RtfToken.cs
- ResourceSet.cs
- altserialization.cs
- EventArgs.cs
- QualificationDataItem.cs
- MimeObjectFactory.cs
- FontStyles.cs
- DataViewSetting.cs
- QueueProcessor.cs
- FilePrompt.cs
- FontStretchConverter.cs
- DiagnosticsConfigurationHandler.cs
- ContextMenuStrip.cs
- System.Data.OracleClient_BID.cs
- XmlSchemas.cs
- CodeDelegateCreateExpression.cs
- StringValidatorAttribute.cs
- EntityDataSourceChangedEventArgs.cs
- XPathDocumentBuilder.cs
- DetailsViewDeleteEventArgs.cs
- TextTreeTextNode.cs
- EmbeddedObject.cs
- AnnotationResource.cs
- Section.cs
- TraceContextEventArgs.cs
- CssTextWriter.cs
- ToolStripLabel.cs
- CompilerResults.cs
- WebPartMovingEventArgs.cs
- ProfileModule.cs
- InternalBufferManager.cs
- DomainUpDown.cs
- WorkflowServiceHostFactory.cs
- SubqueryRules.cs
- RelationshipConverter.cs
- BaseResourcesBuildProvider.cs
- ExceptionValidationRule.cs
- InheritablePropertyChangeInfo.cs
- MLangCodePageEncoding.cs
- OverrideMode.cs
- XmlSchemaImporter.cs
- Setter.cs
- HtmlTableRow.cs
- MDIClient.cs
- ParseElement.cs
- FixedFlowMap.cs
- MulticastDelegate.cs
- CssStyleCollection.cs
- PageParserFilter.cs
- ChannelParameterCollection.cs
- GridLength.cs
- unsafeIndexingFilterStream.cs
- TypeLibConverter.cs
- TableCell.cs
- ActivityValidator.cs
- HTTPRemotingHandler.cs
- AssemblyAttributesGoHere.cs
- AutomationIdentifier.cs
- ApplicationTrust.cs
- OverrideMode.cs
- TypeInitializationException.cs
- CodeFieldReferenceExpression.cs
- TreeBuilderXamlTranslator.cs
- SAPIEngineTypes.cs
- DataServiceContext.cs
- InputLanguageSource.cs
- WinEventWrap.cs
- TrueReadOnlyCollection.cs
- IsolatedStorageFileStream.cs
- ZipIOCentralDirectoryBlock.cs
- XsdCachingReader.cs
- CustomAssemblyResolver.cs
- TransactionTable.cs
- StrokeCollection.cs
- SqlMethodTransformer.cs
- ValidatedControlConverter.cs
- UrlMapping.cs
- ContainerSelectorBehavior.cs
- RegexWorker.cs
- BrowserCapabilitiesFactory.cs
- Double.cs
- Stylesheet.cs
- HostAdapter.cs
- SiteMapSection.cs
- TreeView.cs
- newinstructionaction.cs
- HostUtils.cs
- MaskedTextProvider.cs
- SqlCaseSimplifier.cs
- SqlBulkCopyColumnMappingCollection.cs
- EventLogEntry.cs
- SqlClientWrapperSmiStreamChars.cs
- EnumerableCollectionView.cs
- ViewGenResults.cs
- SqlFactory.cs
- ProjectionCamera.cs