コード例 #1
0
        /// <summary>
        /// Save contextual information about the current section state.
        /// </summary>
        public override void SaveContext(object sender, SectionSaveContextEventArgs e)
        {
            base.SaveContext(sender, e);

            ChangesSectionContext context = new ChangesSectionContext
            {
                Changesets    = Changesets,
                SelectedIndex = View.SelectedIndex
            };

            e.Context = context;
        }
コード例 #2
0
        /// <summary>
        /// Save contextual information about the current section state.
        /// </summary>
        public override void SaveContext(object sender, SectionSaveContextEventArgs e)
        {
            base.SaveContext(sender, e);

            // Save our current changeset list, selected item, and topmost item
            // so they can be quickly restored when the user navigates back to
            // the page
            ChangesSectionContext context = new ChangesSectionContext();

            context.Changesets    = this.Changesets;
            context.SelectedIndex = this.View.SelectedIndex;

            e.Context = context;
        }
コード例 #3
0
        /// <summary>
        /// Initialize override.
        /// </summary>
        public async override void Initialize(object sender, IServiceProvider provider, object context)
        {
            base.Initialize(sender, provider, context);
            TeamExplorer.PropertyChanged -= TeamExplorerOnPropertyChanged;
            TeamExplorer.PropertyChanged += TeamExplorerOnPropertyChanged;

            BaseTitle = Title;

            if (context is ChangesSectionContext)
            {
                ChangesSectionContext ctx = (ChangesSectionContext)context;
                Changesets         = ctx.Changesets;
                View.SelectedIndex = ctx.SelectedIndex;
            }
            else
            {
                // Kick off the initial refresh
                await RefreshAsync();
            }
        }
コード例 #4
0
        /// <summary>
        /// Initialize override.
        /// </summary>
        public async override void Initialize(object sender, SectionInitializeEventArgs e)
        {
            base.Initialize(sender, e);

            // Save off the base title that was set during the ctor
            this.BaseTitle = this.Title;

            // If the user navigated back to this page, there could be saved context
            // info that is passed in
            if (e.Context != null && e.Context is ChangesSectionContext)
            {
                // Restore the context instead of refreshing
                ChangesSectionContext context = (ChangesSectionContext)e.Context;
                this.Changesets         = context.Changesets;
                this.View.SelectedIndex = context.SelectedIndex;
            }
            else
            {
                // Kick off the initial refresh
                await RefreshAsync();
            }
        }
コード例 #5
0
        /// <summary>
        /// Save contextual information about the current section state.
        /// </summary>
        public override void SaveContext(object sender, SectionSaveContextEventArgs e)
        {
            base.SaveContext(sender, e);

            // Save our current so when the user navigates back to the page the content is restored rather than requeried
            ChangesSectionContext context = new ChangesSectionContext { Shelvesets = this.Shelvesets };
            e.Context = context;
        }