Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Navigation / NavigatingCancelEventArgs.cs / 1305600 / NavigatingCancelEventArgs.cs
//---------------------------------------------------------------------------------------------- // File: NavigatingCancelEventArgs.cs // // Copyright (C) 2004 by Microsoft Corporation. All rights reserved. // // Description: // This event is fired before we start a navigation. The NavigationMode // property specifies the type of navigation (normal, refresh, journal) // This event is fired on INavigator and refired on the Application // // History: // 08/10/04: kusumav Moved out of Application.cs to its own separate file. // //--------------------------------------------------------------------------------------------- using System.ComponentModel; using System.Net; namespace System.Windows.Navigation { ////// Event args for Navigating event. /// The NavigatingCancelEventArgs contain the uri or root element of the content being navigated to /// and an enum value that indicates the type of navigation. Canceling this event prevents the /// application from navigating. By default, Cancel is set to false. /// Note: An application hosted in the browser cannot prevent navigation away from the application /// by canceling this event. /// Note: In the PDC build, if an application hosts the WebOC, this event is not raised for /// navigations within the WebOC. /// public class NavigatingCancelEventArgs : CancelEventArgs { // Internal constructor // URI of the markup page being navigated to. // Root of the element tree being navigated to. // Enum {New, Back, Forward, Refresh} // navigator that raised this event internal NavigatingCancelEventArgs( Uri uri, Object content, CustomContentState customContentState, Object extraData, NavigationMode navigationMode, WebRequest request, object Navigator, bool isNavInitiator) { _uri = uri; _content = content; _targetContentState = customContentState; _navigationMode = navigationMode; _extraData = extraData; _webRequest = request; _isNavInitiator = isNavInitiator; _navigator = Navigator; } ////// URI of the markup page being navigated to. /// public Uri Uri { get { return _uri; } } ////// Root of the element tree being navigated to. /// Note: Only one of the Content or Uri property will be set, depending on whether /// the navigation was to a Uri or an existing element tree. /// public Object Content { get { return _content; } } ///Target custom content state or view state public CustomContentState TargetContentState { get { return _targetContentState; } } ////// An event handler can set this property to the current content state or view state, to be /// saved in a journal entry. If not provided here, the framework will call /// IProvideCustomContentState.GetContentState() on the current Content object. /// public CustomContentState ContentStateToSave { set { _contentStateToSave = value; } get { return _contentStateToSave; } } ////// Exposes extra data object which was optionally passed as a parameter to Navigate. /// public Object ExtraData { //Though we are handing out an object that may potentially contain //sensitive information, no one can use it except the app developer //unless they have type information for this object. One cannot de-serialize //this without Serialization permissions which are not granted by default //in partial trust scenarios. get { return _extraData; } } ////// NavigationMode Enum {New, Back, Forward, Refresh} - where New means a new navigation, /// Forward, Back, and Refresh mean the navigation was initiated from the GoForward, GoBack, /// or Refresh method (or corresponding UI button). /// public NavigationMode NavigationMode { get { return _navigationMode; } } ////// Exposes the WebRequest used to retrieve content. This enables access to HTTP headers. /// public WebRequest WebRequest { get { return _webRequest; } } ////// Indicates whether this navigator is initiating the navigation or whether a parent /// navigator is being navigated (e.g., the current navigator is a frame /// inside a page thats being navigated to inside a parent navigator). A developer /// can use this property to determine whether to spin the globe on a LoadStarted event or /// to stop spinning the globe on a LoadCompleted event. /// If this property is False, the navigators parent navigator is also navigating and /// the globe is already spinning. /// If this property is True, the navigation was initiated inside the current frame and /// the developer should spin the globe (or stop spinning the globe, depending on /// which event is being handled.) /// public bool IsNavigationInitiator { get { return _isNavInitiator; } } ////// The navigator that raised this event /// public object Navigator { get { return _navigator; } } private Uri _uri; private Object _content; private CustomContentState _targetContentState, _contentStateToSave; private Object _extraData; private NavigationMode _navigationMode; private WebRequest _webRequest; private bool _isNavInitiator; object _navigator; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------------------------- // File: NavigatingCancelEventArgs.cs // // Copyright (C) 2004 by Microsoft Corporation. All rights reserved. // // Description: // This event is fired before we start a navigation. The NavigationMode // property specifies the type of navigation (normal, refresh, journal) // This event is fired on INavigator and refired on the Application // // History: // 08/10/04: kusumav Moved out of Application.cs to its own separate file. // //--------------------------------------------------------------------------------------------- using System.ComponentModel; using System.Net; namespace System.Windows.Navigation { ////// Event args for Navigating event. /// The NavigatingCancelEventArgs contain the uri or root element of the content being navigated to /// and an enum value that indicates the type of navigation. Canceling this event prevents the /// application from navigating. By default, Cancel is set to false. /// Note: An application hosted in the browser cannot prevent navigation away from the application /// by canceling this event. /// Note: In the PDC build, if an application hosts the WebOC, this event is not raised for /// navigations within the WebOC. /// public class NavigatingCancelEventArgs : CancelEventArgs { // Internal constructor // URI of the markup page being navigated to. // Root of the element tree being navigated to. // Enum {New, Back, Forward, Refresh} // navigator that raised this event internal NavigatingCancelEventArgs( Uri uri, Object content, CustomContentState customContentState, Object extraData, NavigationMode navigationMode, WebRequest request, object Navigator, bool isNavInitiator) { _uri = uri; _content = content; _targetContentState = customContentState; _navigationMode = navigationMode; _extraData = extraData; _webRequest = request; _isNavInitiator = isNavInitiator; _navigator = Navigator; } ////// URI of the markup page being navigated to. /// public Uri Uri { get { return _uri; } } ////// Root of the element tree being navigated to. /// Note: Only one of the Content or Uri property will be set, depending on whether /// the navigation was to a Uri or an existing element tree. /// public Object Content { get { return _content; } } ///Target custom content state or view state public CustomContentState TargetContentState { get { return _targetContentState; } } ////// An event handler can set this property to the current content state or view state, to be /// saved in a journal entry. If not provided here, the framework will call /// IProvideCustomContentState.GetContentState() on the current Content object. /// public CustomContentState ContentStateToSave { set { _contentStateToSave = value; } get { return _contentStateToSave; } } ////// Exposes extra data object which was optionally passed as a parameter to Navigate. /// public Object ExtraData { //Though we are handing out an object that may potentially contain //sensitive information, no one can use it except the app developer //unless they have type information for this object. One cannot de-serialize //this without Serialization permissions which are not granted by default //in partial trust scenarios. get { return _extraData; } } ////// NavigationMode Enum {New, Back, Forward, Refresh} - where New means a new navigation, /// Forward, Back, and Refresh mean the navigation was initiated from the GoForward, GoBack, /// or Refresh method (or corresponding UI button). /// public NavigationMode NavigationMode { get { return _navigationMode; } } ////// Exposes the WebRequest used to retrieve content. This enables access to HTTP headers. /// public WebRequest WebRequest { get { return _webRequest; } } ////// Indicates whether this navigator is initiating the navigation or whether a parent /// navigator is being navigated (e.g., the current navigator is a frame /// inside a page thats being navigated to inside a parent navigator). A developer /// can use this property to determine whether to spin the globe on a LoadStarted event or /// to stop spinning the globe on a LoadCompleted event. /// If this property is False, the navigators parent navigator is also navigating and /// the globe is already spinning. /// If this property is True, the navigation was initiated inside the current frame and /// the developer should spin the globe (or stop spinning the globe, depending on /// which event is being handled.) /// public bool IsNavigationInitiator { get { return _isNavInitiator; } } ////// The navigator that raised this event /// public object Navigator { get { return _navigator; } } private Uri _uri; private Object _content; private CustomContentState _targetContentState, _contentStateToSave; private Object _extraData; private NavigationMode _navigationMode; private WebRequest _webRequest; private bool _isNavInitiator; object _navigator; } } // 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
- StylusTouchDevice.cs
- XmlQueryCardinality.cs
- GeneralTransform3DCollection.cs
- AuthenticodeSignatureInformation.cs
- SQLBytesStorage.cs
- FloaterBaseParagraph.cs
- DesignTimeDataBinding.cs
- PathGeometry.cs
- ZipIORawDataFileBlock.cs
- ForceCopyBuildProvider.cs
- DataBoundControlAdapter.cs
- ObjectQuery_EntitySqlExtensions.cs
- StringWriter.cs
- TargetPerspective.cs
- SendMailErrorEventArgs.cs
- AdPostCacheSubstitution.cs
- EditCommandColumn.cs
- GridViewPageEventArgs.cs
- ThrowOnMultipleAssignment.cs
- PrintDialogDesigner.cs
- KeyboardDevice.cs
- DefaultSection.cs
- HttpPostedFileWrapper.cs
- RepeaterItemCollection.cs
- InkCanvasAutomationPeer.cs
- LedgerEntry.cs
- NgenServicingAttributes.cs
- XPathItem.cs
- DataRecordObjectView.cs
- WebException.cs
- ToolstripProfessionalRenderer.cs
- UserMapPath.cs
- TdsParser.cs
- CmsInterop.cs
- PeerEndPoint.cs
- ImageAutomationPeer.cs
- XmlMemberMapping.cs
- CurrentChangingEventArgs.cs
- WebScriptMetadataInstanceContextProvider.cs
- StateRuntime.cs
- SevenBitStream.cs
- OrderedDictionary.cs
- Behavior.cs
- HttpPostedFile.cs
- OperationFormatStyle.cs
- ColorConvertedBitmap.cs
- DbProviderFactory.cs
- StickyNoteAnnotations.cs
- CustomSignedXml.cs
- COM2PropertyDescriptor.cs
- WorkflowEventArgs.cs
- ProfileSettingsCollection.cs
- ConditionalExpression.cs
- TextDecorationCollection.cs
- ZipIOLocalFileDataDescriptor.cs
- AspProxy.cs
- FormsAuthenticationCredentials.cs
- ErrorRuntimeConfig.cs
- HttpListenerException.cs
- Container.cs
- RIPEMD160.cs
- RelationshipWrapper.cs
- IxmlLineInfo.cs
- ExceptionHandlers.cs
- Dump.cs
- ToolbarAUtomationPeer.cs
- SoapIgnoreAttribute.cs
- ProbeRequestResponseAsyncResult.cs
- EnumBuilder.cs
- ExternalDataExchangeClient.cs
- recordstate.cs
- MulticastNotSupportedException.cs
- CustomValidator.cs
- ExceptQueryOperator.cs
- ExpressionDumper.cs
- GenericParameterDataContract.cs
- BlobPersonalizationState.cs
- OdbcRowUpdatingEvent.cs
- DataGridViewSelectedColumnCollection.cs
- XmlBaseReader.cs
- _AcceptOverlappedAsyncResult.cs
- CodeCommentStatementCollection.cs
- SystemUdpStatistics.cs
- SearchForVirtualItemEventArgs.cs
- TrackingServices.cs
- CompoundFileIOPermission.cs
- ContactManager.cs
- CheckBoxFlatAdapter.cs
- Native.cs
- StyleSelector.cs
- CacheOutputQuery.cs
- ProgressChangedEventArgs.cs
- FusionWrap.cs
- InteropExecutor.cs
- GrammarBuilderBase.cs
- PolicyLevel.cs
- TakeOrSkipWhileQueryOperator.cs
- DataGridHyperlinkColumn.cs
- SafeNativeMethods.cs
- IndependentlyAnimatedPropertyMetadata.cs