Exemplo n.º 1
0
        public JournalDetails(User user, int journalID)
            : base(user, "Journal:" + journalID)
        {
            InitializeComponent();
            Journal model = null;

            if (journalID >= 0) {
                var service = new SupportService(user);
                model = service.GetJournal(journalID);
            } else {
                model = new Journal();
                model.JournalID = -1;
                model.FullName = "<New Journal>";
            }

            _viewModel = new JournalViewModel(model);

            _traits = tabJournal.AddTabItem("Traits", new TraitControl(user, TraitCategoryType.Journal, _viewModel));
            _notes = tabJournal.AddTabItem("Notes", new NotesControl(user, TraitCategoryType.Journal, _viewModel));
            tabJournal.AddTabItem("Ownership", new OwnershipDetails(model));

            if (_viewModel.JournalID >= 0) {
                _viewModel.DataChanged += new DataChangedHandler(viewModel_DataChanged);
            } else {
                Loaded += new RoutedEventHandler(JournalDetails_Loaded);
                _traits.IsEnabled = false;
                _notes.IsEnabled = false;
            }

            ChangesCommitted += new PendingChangesCommittedHandler(JournalDetails_ChangesCommitted);

            this.DataContext = _viewModel;
        }
        internal void InitializeJournal()
        {
            Journal originalJournal = this._journal;

            //Find the outer frame (if there is one)
            Frame outerFrame = null;
            DependencyObject walker = VisualTreeHelper.GetParent(this.Host);

            // Walk up tree to find a parent navigator.
            while (walker != null)
            {
                outerFrame = walker as Frame;
                if (outerFrame != null)
                {
                    break;
                }

                walker = VisualTreeHelper.GetParent(walker);
            }

            // Whenever we're in design mode, we should avoid using NavigationState as it's intended to interact with the
            // browser, which is not available at design-time.  Thus, we should always be in OwnsJournal mode when in a designer.
            if (this.Host.JournalOwnership == JournalOwnership.OwnsJournal ||
                Frame.IsInDesignMode())
            {
                this._journal = new Journal(false /* useNavigationState */);
            }
            // If we're set to use the parent journal, one of the following is true:
            // 1) We're a top-level Frame (i.e. not nested within another Frame) - in this case, integrate with the browser, as it is logically our "parent"
            // 2) We're not a top-level Frame, in which case browser integration is not supported, so throw an exception.  If graceful fall-back is desired, they can use JournalOwnership.Automatic instead.
            else if (this.Host.JournalOwnership == JournalOwnership.UsesParentJournal &&
                outerFrame != null)
            {
                throw new InvalidOperationException(
                    string.Format(CultureInfo.InvariantCulture,
                                  Resource.NavigationService_JournalOwnership_UsesParentJournal_OnlyTopLevel,
                                  "JournalOwnership",
                                  "UsesParentJournal",
                                  "Frame"));
            }
            // If we're set to automatic (the default), then one of the following is true:
            // 1) We're a top-level Frame (i.e. not nested within another Frame) - in this case, integrate with the browser, as it is logically our "parent"
            // 2) We're not a top-level Frame, in which case browser integration is not supported, so fall-back to an internal journal silently.
            else if (this.Host.JournalOwnership == JournalOwnership.Automatic &&
                outerFrame != null)
            {
                this._journal = new Journal(false /* useNavigationState */);
            }
            else
            {
                // If we get this far, then we must be integrating with the browser:
                this._journal = new Journal(true /* useNavigationState */);
            }

            if (this._journal != originalJournal)
            {
                if (originalJournal != null)
                {
                    originalJournal.Navigated -= this.Journal_Navigated;
                }
                this._journal.Navigated += this.Journal_Navigated;
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// When being reloaded from history in the browser, we need to
 /// set up the journal again 
 /// </summary>
 /// <param name="journal"></param> 
 internal void SetJournalForBrowserInterop(Journal journal) 
 {
     Invariant.Assert(journal != null, "Failed to get Journal for browser integration"); 
     base.JournalNavigationScope.Journal = journal;
 }
Exemplo n.º 4
0
        //
        // 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;
        }
 public JournalEntryForwardStack(Journal journal)
     : base(journal)
 {
 }
 public JournalEntryBackStack(Journal journal)
     : base(journal)
 {
 }
 internal JournalEntryStack(Journal journal)
 {
     _journal = journal;
 }
 internal BrowserJournal(Journal journal, Uri baseUri) 
 {
     _journal = journal; 
     _baseUri = baseUri; 
 }
        internal void InitializeJournal()
        {
            Journal originalJournal = this._journal;

            //Find the outer frame (if there is one)
            Frame            outerFrame = null;
            DependencyObject walker     = VisualTreeHelper.GetParent(this.Host);

            // Walk up tree to find a parent navigator.
            while (walker != null)
            {
                outerFrame = walker as Frame;
                if (outerFrame != null)
                {
                    break;
                }

                walker = VisualTreeHelper.GetParent(walker);
            }

            // Whenever we're in design mode, we should avoid using NavigationState as it's intended to interact with the
            // browser, which is not available at design-time.  Thus, we should always be in OwnsJournal mode when in a designer.
            if (this.Host.JournalOwnership == JournalOwnership.OwnsJournal ||
                Frame.IsInDesignMode())
            {
                this._journal = new Journal(false /* useNavigationState */);
            }
            // If we're set to use the parent journal, one of the following is true:
            // 1) We're a top-level Frame (i.e. not nested within another Frame) - in this case, integrate with the browser, as it is logically our "parent"
            // 2) We're not a top-level Frame, in which case browser integration is not supported, so throw an exception.  If graceful fall-back is desired, they can use JournalOwnership.Automatic instead.
            else if (this.Host.JournalOwnership == JournalOwnership.UsesParentJournal &&
                     outerFrame != null)
            {
                throw new InvalidOperationException(
                          string.Format(CultureInfo.InvariantCulture,
                                        Resource.NavigationService_JournalOwnership_UsesParentJournal_OnlyTopLevel,
                                        "JournalOwnership",
                                        "UsesParentJournal",
                                        "Frame"));
            }
            // If we're set to automatic (the default), then one of the following is true:
            // 1) We're a top-level Frame (i.e. not nested within another Frame) - in this case, integrate with the browser, as it is logically our "parent"
            // 2) We're not a top-level Frame, in which case browser integration is not supported, so fall-back to an internal journal silently.
            else if (this.Host.JournalOwnership == JournalOwnership.Automatic &&
                     outerFrame != null)
            {
                this._journal = new Journal(false /* useNavigationState */);
            }
            else
            {
                // If we get this far, then we must be integrating with the browser:
                this._journal = new Journal(true /* useNavigationState */);
            }

            if (this._journal != originalJournal)
            {
                if (originalJournal != null)
                {
                    originalJournal.Navigated -= this.Journal_Navigated;
                }
                this._journal.Navigated += this.Journal_Navigated;
            }
        }
Exemplo n.º 10
0
 public JournalEntryForwardStack(Journal journal)
     : base(journal)
 {
 }
Exemplo n.º 11
0
 public JournalEntryStackEnumerator(Journal journal, int start, int delta, JournalEntryFilter filter)
 {
     _journal = journal;
     _version = journal.Version;
     _start = start;
     _delta = delta;
     _filter = filter;
     this.Reset();
 }
Exemplo n.º 12
0
 public JournalEntryBackStack(Journal journal)
     : base(journal)
 {
 }
Exemplo n.º 13
0
 internal JournalEntryStack(Journal journal)
 {
     _journal = journal;
 }
Exemplo n.º 14
0
 // Token: 0x060028A6 RID: 10406 RVA: 0x000BCF80 File Offset: 0x000BB180
 internal JournalEntryStack(Journal journal)
 {
     this._journal = journal;
 }
Exemplo n.º 15
0
 public void showJourProfile()
 {
     Journal j = new Journal();
     j = (Journal)resultList.type;
     mw.AddTabHtmlView(j);
 }
Exemplo n.º 16
0
 public JournalSelectionResult(Journal data)
 {
     this.DataObject = data;
     this.Description = data.FullName;
     this.ObjectID = data.JournalID;
 }