// Token: 0x0600796C RID: 31084 RVA: 0x002271DC File Offset: 0x002253DC internal override void SaveState(object contentObject) { PageFunctionBase pageFunctionBase = (PageFunctionBase)contentObject; this._returnEventSaver = pageFunctionBase._Saver; base.SaveState(contentObject); }
internal override PageFunctionBase ResumePageFunction() { PageFunctionBase pageFunction = this.KeepAlivePageFunction; pageFunction._Resume = true; return(pageFunction); }
internal void _Attach(object caller, PageFunctionBase child) { ReturnEventSaverInfo[] array = null; array = this._returnList; if (array != null) { for (int i = 0; i < array.Length; i++) { if (string.Compare(this._returnList[i]._targetTypeName, caller.GetType().AssemblyQualifiedName, StringComparison.Ordinal) != 0) { throw new NotSupportedException(SR.Get("ReturnEventHandlerMustBeOnParentPage")); } Delegate d; try { new ReflectionPermission(ReflectionPermissionFlag.MemberAccess).Assert(); d = Delegate.CreateDelegate(Type.GetType(this._returnList[i]._delegateTypeName), caller, this._returnList[i]._delegateMethodName); } catch (Exception innerException) { throw new NotSupportedException(SR.Get("ReturnEventHandlerMustBeOnParentPage"), innerException); } finally { CodeAccessPermission.RevertAssert(); } child._AddEventHandler(d); } } }
// Internal methods ///////////////////////////////////////////////////////////////////// #region Internal methods internal override void SaveState(object contentObject) { PageFunctionBase pageFunction = (PageFunctionBase)contentObject; _returnEventSaver = pageFunction._Saver; base.SaveState(contentObject); // Save controls state (JournalDataStreams). }
// Token: 0x06007978 RID: 31096 RVA: 0x0022746C File Offset: 0x0022566C internal override PageFunctionBase ResumePageFunction() { PageFunctionBase pageFunctionBase = Application.LoadComponent(this._markupUri, true) as PageFunctionBase; this.RestoreState(pageFunctionBase); return(pageFunctionBase); }
// Ctors ///////////////////////////////////////////////////////////////////// #region Ctors internal JournalEntryPageFunctionType(JournalEntryGroupState jeGroupState, PageFunctionBase pageFunction) : base(jeGroupState, pageFunction) { string typeName = pageFunction.GetType().AssemblyQualifiedName; this._typeName = new SecurityCriticalDataForSet <string>(typeName); }
// Token: 0x0600796E RID: 31086 RVA: 0x0022727C File Offset: 0x0022547C internal override bool Navigate(INavigator navigator, NavigationMode navMode) { IDownloader downloader = navigator as IDownloader; NavigationService navigationService = (downloader != null) ? downloader.Downloader : null; PageFunctionBase content = (navigationService != null && navigationService.ContentId == base.ContentId) ? ((PageFunctionBase)navigationService.Content) : this.ResumePageFunction(); return(navigator.Navigate(content, new NavigateInfo(base.Source, navMode, this))); }
// Token: 0x06007974 RID: 31092 RVA: 0x002273F8 File Offset: 0x002255F8 private void InitializeComponent(PageFunctionBase pageFunction) { IComponentConnector componentConnector = pageFunction as IComponentConnector; if (componentConnector != null) { componentConnector.InitializeComponent(); } }
private void InitializeComponent(PageFunctionBase pageFunction) { // Need to explicitly add a call to InitializeComponent() for Page IComponentConnector iComponentConnector = pageFunction as IComponentConnector; if (iComponentConnector != null) { iComponentConnector.InitializeComponent(); } }
/// <summary> /// This override is used when doing journal navigation to a PF, not when it is resumed after /// a child PF finishes. /// </summary> internal override bool Navigate(INavigator navigator, NavigationMode navMode) { Debug.Assert(navMode == NavigationMode.Back || navMode == NavigationMode.Forward); // When doing fragment navigation within the PF, it should not be marked as Resumed; // otherwise, its Start() override may not be called. PageFunctionBase pf = (navigator.Content == _keepAlivePageFunction) ? _keepAlivePageFunction : ResumePageFunction(); Debug.Assert(pf != null); return(navigator.Navigate(pf, new NavigateInfo(this.Source, navMode, this))); }
internal void _Attach(Object caller, PageFunctionBase child) { ReturnEventSaverInfo[] list = null; list = _returnList; if (list != null) { Debug.Assert(caller != null, "Caller should not be null"); for (int i = 0; i < list.Length; i++) { // // Future notes: how do we handle listeners that were not on the calling pagefunction ? // E.g. - if we had a listener to OnFinish from a Button on the calling page. // "Return event never fired from PageFunction hosted in its own window" // if (string.Compare(_returnList[i]._targetTypeName, caller.GetType().AssemblyQualifiedName, StringComparison.Ordinal) != 0) { throw new NotSupportedException(SR.Get(SRID.ReturnEventHandlerMustBeOnParentPage)); } Delegate d; try { new ReflectionPermission(ReflectionPermissionFlag.MemberAccess).Assert(); // BlessedAssert d = Delegate.CreateDelegate( Type.GetType(_returnList[i]._delegateTypeName), caller, _returnList[i]._delegateMethodName); } catch (Exception ex) { throw new NotSupportedException(SR.Get(SRID.ReturnEventHandlerMustBeOnParentPage), ex); } finally { ReflectionPermission.RevertAssert(); } child._AddEventHandler(d); } } }
internal void _Attach(Object caller, PageFunctionBase child) { ReturnEventSaverInfo[] list = null; list = _returnList; if (list != null) { Debug.Assert(caller != null, "Caller should not be null"); for (int i = 0; i < list.Length; i++) { // // if (string.Compare(_returnList[i]._targetTypeName, caller.GetType().AssemblyQualifiedName, StringComparison.Ordinal) != 0) { throw new NotSupportedException(SR.Get(SRID.ReturnEventHandlerMustBeOnParentPage)); } Delegate d; try { new ReflectionPermission(ReflectionPermissionFlag.MemberAccess).Assert(); // BlessedAssert d = Delegate.CreateDelegate( Type.GetType(_returnList[i]._delegateTypeName), caller, _returnList[i]._delegateMethodName); } catch (Exception ex) { throw new NotSupportedException(SR.Get(SRID.ReturnEventHandlerMustBeOnParentPage), ex); } finally { ReflectionPermission.RevertAssert(); } child._AddEventHandler(d); } } }
internal void _Detach(PageFunctionBase pf) { if (pf._Return != null && pf._Saver == null) { ReturnEventSaverInfo[] list = null; Delegate[] delegates = null; delegates = (pf._Return).GetInvocationList(); list = _returnList = new ReturnEventSaverInfo[delegates.Length]; for (int i = 0; i < delegates.Length; i++) { Delegate returnDelegate = delegates[i]; bool bSamePf = false; if (returnDelegate.Target == pf) { // This is the Event Handler implemented by the same PF, use for NonGeneric handling. bSamePf = true; } MethodInfo m = returnDelegate.Method; ReturnEventSaverInfo info = new ReturnEventSaverInfo( returnDelegate.GetType().AssemblyQualifiedName, returnDelegate.Target.GetType().AssemblyQualifiedName, m.Name, bSamePf); list[i] = info; } // // only save if there were delegates already attached. // note that there will be cases where the Saver has already been pre-populated from a Load // but no delegates have been created yet ( as the PF hasn`t called finish as yet) // // By only storing the saver once there are delegates - we avoid the problem of // wiping out any newly restored saver pf._Saver = this; } pf._DetachEvents(); }
/// <summary> /// This override is used when doing journal navigation to a PF, not when it is resumed after /// a child PF finishes. /// </summary> internal override bool Navigate(INavigator navigator, NavigationMode navMode) { Debug.Assert(navMode == NavigationMode.Back || navMode == NavigationMode.Forward); // Resume the PF and navigate to it. // Special case: doing fragment navigation or CustomContentState navigation // within a PF. Then don't create a new PF object! IDownloader idl = navigator as IDownloader; NavigationService ns = idl != null ? idl.Downloader : null; Debug.Assert(ns != null, "Fragment navigation won't work when the INavigator doesn't have a NavigationService."); PageFunctionBase pageFunction = (ns != null && ns.ContentId == this.ContentId) ? (PageFunctionBase)ns.Content : ResumePageFunction(); Debug.Assert(pageFunction != null); return(navigator.Navigate(pageFunction, new NavigateInfo(this.Source, navMode, this))); }
// // Take the PageFunction specific setting, then call the RestoreState in base class // to store previous state in a journal navigation. // internal override void RestoreState(object contentObject) { if (contentObject == null) { throw new ArgumentNullException("contentObject"); } PageFunctionBase pageFunction = (PageFunctionBase)contentObject; if (pageFunction == null) { throw new Exception(SR.Get(SRID.InvalidPageFunctionType, contentObject.GetType())); } pageFunction.ParentPageFunctionId = ParentPageFunctionId; pageFunction.PageFunctionId = PageFunctionId; pageFunction._Saver = _returnEventSaver; // saved Return event delegate from the *parent* of this PF pageFunction._Resume = true; base.RestoreState(pageFunction); }
// Token: 0x0600796D RID: 31085 RVA: 0x00227204 File Offset: 0x00225404 internal override void RestoreState(object contentObject) { if (contentObject == null) { throw new ArgumentNullException("contentObject"); } PageFunctionBase pageFunctionBase = (PageFunctionBase)contentObject; if (pageFunctionBase == null) { throw new Exception(SR.Get("InvalidPageFunctionType", new object[] { contentObject.GetType() })); } pageFunctionBase.ParentPageFunctionId = base.ParentPageFunctionId; pageFunctionBase.PageFunctionId = base.PageFunctionId; pageFunctionBase._Saver = this._returnEventSaver; pageFunctionBase._Resume = true; base.RestoreState(pageFunctionBase); }
internal void _Detach(PageFunctionBase pf) { if (pf._Return != null && pf._Saver == null) { Delegate[] invocationList = pf._Return.GetInvocationList(); ReturnEventSaverInfo[] array = this._returnList = new ReturnEventSaverInfo[invocationList.Length]; for (int i = 0; i < invocationList.Length; i++) { Delegate @delegate = invocationList[i]; bool fSamePf = false; if (@delegate.Target == pf) { fSamePf = true; } MethodInfo method = @delegate.Method; ReturnEventSaverInfo returnEventSaverInfo = new ReturnEventSaverInfo(@delegate.GetType().AssemblyQualifiedName, @delegate.Target.GetType().AssemblyQualifiedName, method.Name, fSamePf); array[i] = returnEventSaverInfo; } pf._Saver = this; } pf._DetachEvents(); }
// Token: 0x06007968 RID: 31080 RVA: 0x0022714C File Offset: 0x0022534C internal override bool Navigate(INavigator navigator, NavigationMode navMode) { PageFunctionBase content = (navigator.Content == this._keepAlivePageFunction) ? this._keepAlivePageFunction : this.ResumePageFunction(); return(navigator.Navigate(content, new NavigateInfo(base.Source, navMode, this))); }
// Ctors ///////////////////////////////////////////////////////////////////// #region Ctors // // Ctor of JournalEntryPageFunctionSaver // internal JournalEntryPageFunctionSaver(JournalEntryGroupState jeGroupState, PageFunctionBase pageFunction) : base(jeGroupState, pageFunction) { Debug.Assert(!pageFunction.KeepAlive); }
public static IObservable <EventPattern <ManipulationBoundaryFeedbackEventArgs> > ManipulationBoundaryFeedbackObserver(this PageFunctionBase This) { return(Observable.FromEventPattern <EventHandler <ManipulationBoundaryFeedbackEventArgs>, ManipulationBoundaryFeedbackEventArgs>(h => This.ManipulationBoundaryFeedback += h, h => This.ManipulationBoundaryFeedback -= h)); }
public static IObservable <EventPattern <ManipulationCompletedEventArgs> > ManipulationCompletedObserver(this PageFunctionBase This) { return(Observable.FromEventPattern <EventHandler <ManipulationCompletedEventArgs>, ManipulationCompletedEventArgs>(h => This.ManipulationCompleted += h, h => This.ManipulationCompleted -= h)); }
// Ctors ///////////////////////////////////////////////////////////////////// #region Ctors internal JournalEntryPageFunctionKeepAlive(JournalEntryGroupState jeGroupState, PageFunctionBase pageFunction) : base(jeGroupState, pageFunction) { Debug.Assert(pageFunction != null && pageFunction.KeepAlive); this._keepAlivePageFunction = pageFunction; }
// // This method is to get the journal entry index in the Journal List for the parent page // of this PageFunction. // // The parent page could be a PageFunction or a Non-PageFunction. // For the non PageFunction case, it could have a Uri or could not have a Uri. // // Case 1: The ParentPageFunction has been set, so just go back and look for it. // Case 2: The ParentPageFunction has NOT been set, so the parent must be most recent non-PF entry. // internal static int GetParentPageJournalIndex(NavigationService NavigationService, Journal journal, PageFunctionBase endingPF) { JournalEntryPageFunction pageFunctionEntry; JournalEntry journalEntry; for (int index = journal.CurrentIndex - 1; index >= 0; --index) { journalEntry = journal[index]; // Be sure that the navigation containers match if (journalEntry.NavigationServiceId != NavigationService.GuidId) { continue; } pageFunctionEntry = journalEntry as JournalEntryPageFunction; if (endingPF.ParentPageFunctionId == Guid.Empty) { // We are looking for a non-PageFunction if (pageFunctionEntry == null) { return(index); // found! } } else { // we are looking for a PageFunction if ((pageFunctionEntry != null) && (pageFunctionEntry.PageFunctionId == endingPF.ParentPageFunctionId)) { return(index); // found! } } } Debug.Assert(endingPF.ParentPageFunctionId == Guid.Empty, "Should have been able to find the parent if the ParentPageFunctionId was set. Are they in different NavigationServices? They shouldn't be."); return(_NoParentPage); }
// Ctors ///////////////////////////////////////////////////////////////////// #region Ctors internal JournalEntryPageFunction(JournalEntryGroupState jeGroupState, PageFunctionBase pageFunction) : base(jeGroupState, null) { PageFunctionId = pageFunction.PageFunctionId; ParentPageFunctionId = pageFunction.ParentPageFunctionId; }
public static IObservable <EventPattern <ToolTipEventArgs> > ToolTipClosingObserver(this PageFunctionBase This) { return(Observable.FromEventPattern <ToolTipEventHandler, ToolTipEventArgs>(h => This.ToolTipClosing += h, h => This.ToolTipClosing -= h)); }
public static IObservable <EventPattern <ContextMenuEventArgs> > ContextMenuClosingObserver(this PageFunctionBase This) { return(Observable.FromEventPattern <ContextMenuEventHandler, ContextMenuEventArgs>(h => This.ContextMenuClosing += h, h => This.ContextMenuClosing -= h)); }
public static IObservable <EventPattern <MouseButtonEventArgs> > PreviewMouseUpObserver(this PageFunctionBase This) { return(Observable.FromEventPattern <MouseButtonEventHandler, MouseButtonEventArgs>(h => This.PreviewMouseUp += h, h => This.PreviewMouseUp -= h)); }
public static IObservable <EventPattern <MouseButtonEventArgs> > MouseLeftButtonDownObserver(this PageFunctionBase This) { return(Observable.FromEventPattern <MouseButtonEventHandler, MouseButtonEventArgs>(h => This.MouseLeftButtonDown += h, h => This.MouseLeftButtonDown -= h)); }
// Ctors ///////////////////////////////////////////////////////////////////// #region Ctors internal JournalEntryPageFunctionUri(JournalEntryGroupState jeGroupState, PageFunctionBase pageFunction, Uri markupUri) : base(jeGroupState, pageFunction) { _markupUri = markupUri; }
// Token: 0x06007962 RID: 31074 RVA: 0x002270FA File Offset: 0x002252FA internal JournalEntryPageFunctionKeepAlive(JournalEntryGroupState jeGroupState, PageFunctionBase pageFunction) : base(jeGroupState, pageFunction) { this._keepAlivePageFunction = pageFunction; }