Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / TrustUi / MS / Internal / documents / Application / NavigationHelper.cs / 1 / NavigationHelper.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: // NavigationHelper is an internal utility class for Mongoose to deal // with Uri navigations. // // History: // 11/10/05 - [....] created // //--------------------------------------------------------------------------- using System; using System.Security; using System.Windows.Interop; using System.Windows.TrustUI; using MS.Internal; using MS.Internal.PresentationUI; namespace MS.Internal.Documents.Application { ////// Helper class for handling browser navigations. /// internal static class NavigationHelper { ////////// Invokes a navigation to a new document ///// ////// Critical: /// - uses delegate from framework /// - uses Document.Uri /// [SecurityCritical] internal static void NavigateToDocument(Document document) { Trace.SafeWrite( Trace.File, "Attempting to navigate to new document {0}.", document.Uri); Invariant.Assert( _navigate != null, "Navigation object has not been instantiated."); Invariant.Assert( _navigate.Value != null, "Navigation delegate has not been assigned."); Invariant.Assert( document != null, "Target document has not been assigned."); _navigate.Value(new SecurityCriticalData(document.Uri)); } ///// ///// Invokes a top-level browserNavigation action to the specified Uri. ///// ////////// Critical: ///// - causes a navigation action to occur to an external uri ///// - passes the Uri to another method ///// [SecurityCritical] internal static void NavigateToExternalUri(Uri uri) { Trace.SafeWrite( Trace.File, "Attempting to navigate to external Uri {0}.", uri); Invariant.Assert( _navigate != null, "Navigation object has not been instantiated."); Invariant.Assert( _navigate.Value != null, "Navigation delegate has not been assigned."); Invariant.Assert( uri != null, "Target uri has not been assigned."); _navigate.Value(new SecurityCriticalData(uri)); } /// /// A delegate that will navigate the root browser window. /// ////// Critical: /// - sets _navigate which should only be BrowserInteropHelper.Navigate /// ////// If we are going to add more functionality a IBrowserService interface /// of some type should be defined and set vs many delegates. /// [FriendAccessAllowed] internal static NavigateDelegate Navigate { [SecurityCritical] get { if (_navigate != null) { return _navigate.Value; } return null; } [SecurityCritical] set { _navigate = new SecurityCriticalDataClass(value); } } internal delegate void NavigateDelegate(SecurityCriticalData uri); private static SecurityCriticalDataClass _navigate; } } // 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
- Speller.cs
- localization.cs
- ObjectHelper.cs
- SubMenuStyle.cs
- OptimizerPatterns.cs
- StoreAnnotationsMap.cs
- BaseUriHelper.cs
- EntityDesignerDataSourceView.cs
- PathData.cs
- ErrorInfoXmlDocument.cs
- ToolStripMenuItemDesigner.cs
- DataBindingHandlerAttribute.cs
- RTTrackingProfile.cs
- DBCommand.cs
- DataGridState.cs
- CodeDelegateInvokeExpression.cs
- WebPartConnectionCollection.cs
- ToolStripDropDownItem.cs
- SchemaMerger.cs
- VectorAnimation.cs
- Object.cs
- HelpEvent.cs
- CryptoProvider.cs
- Automation.cs
- RoutedEventValueSerializer.cs
- UIElementPropertyUndoUnit.cs
- WebUtil.cs
- PersonalizationAdministration.cs
- InputLangChangeEvent.cs
- SchemaTypeEmitter.cs
- RoleService.cs
- Options.cs
- IsolatedStorageException.cs
- TrackBarRenderer.cs
- FunctionParameter.cs
- GridViewUpdatedEventArgs.cs
- OdbcConnectionHandle.cs
- CodeMemberField.cs
- XmlStreamStore.cs
- TextParentUndoUnit.cs
- EncryptedPackageFilter.cs
- WindowsFormsSynchronizationContext.cs
- StringResourceManager.cs
- XmlReader.cs
- ProfileModule.cs
- querybuilder.cs
- Popup.cs
- AppSecurityManager.cs
- CommandField.cs
- FieldBuilder.cs
- AttributeQuery.cs
- CompositeCollection.cs
- LogLogRecord.cs
- ColorPalette.cs
- EventProviderWriter.cs
- ForceCopyBuildProvider.cs
- FindResponse.cs
- Configuration.cs
- WebConfigurationHost.cs
- WebPartDisplayModeCollection.cs
- InlinedAggregationOperatorEnumerator.cs
- ipaddressinformationcollection.cs
- LassoHelper.cs
- Symbol.cs
- SQLMembershipProvider.cs
- LOSFormatter.cs
- TCEAdapterGenerator.cs
- ISessionStateStore.cs
- XamlFigureLengthSerializer.cs
- Ipv6Element.cs
- Size3DConverter.cs
- TrackingMemoryStreamFactory.cs
- Gdiplus.cs
- PerformanceCounterPermissionEntryCollection.cs
- httpserverutility.cs
- TrustSection.cs
- MailWebEventProvider.cs
- PermissionToken.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- WorkflowTimerService.cs
- StringFormat.cs
- Calendar.cs
- TextChange.cs
- OleDbInfoMessageEvent.cs
- Point3DAnimation.cs
- SafeEventHandle.cs
- Win32Interop.cs
- HtmlContainerControl.cs
- Base64Encoding.cs
- CodeNamespace.cs
- ErrorWebPart.cs
- PropertyGridEditorPart.cs
- PostBackOptions.cs
- EditBehavior.cs
- StylusEventArgs.cs
- ResourceExpressionBuilder.cs
- MetabaseServerConfig.cs
- ActivationServices.cs
- UnsafeNativeMethods.cs
- Single.cs