Path: blob/master/samples/winrt/ImageManipulations/common/suspensionmanager.h
16349 views
//*********************************************************1//2// Copyright (c) Microsoft. All rights reserved.3// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF4// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY5// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR6// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.7//8//*********************************************************910//11// SuspensionManager.h12// Declaration of the SuspensionManager class13//1415#pragma once1617#include <ppltasks.h>1819namespace SDKSample20{21namespace Common22{23/// <summary>24/// SuspensionManager captures global session state to simplify process lifetime management25/// for an application. Note that session state will be automatically cleared under a variety26/// of conditions and should only be used to store information that would be convenient to27/// carry across sessions, but that should be disacarded when an application crashes or is28/// upgraded.29/// </summary>30ref class SuspensionManager sealed31{32internal:33static void RegisterFrame(Windows::UI::Xaml::Controls::Frame^ frame, Platform::String^ sessionStateKey);34static void UnregisterFrame(Windows::UI::Xaml::Controls::Frame^ frame);35static Concurrency::task<void> SaveAsync(void);36static Concurrency::task<void> RestoreAsync(void);37static property Windows::Foundation::Collections::IMap<Platform::String^, Platform::Object^>^ SessionState38{39Windows::Foundation::Collections::IMap<Platform::String^, Platform::Object^>^ get(void);40};41static Windows::Foundation::Collections::IMap<Platform::String^, Platform::Object^>^ SessionStateForFrame(42Windows::UI::Xaml::Controls::Frame^ frame);4344private:45static void RestoreFrameNavigationState(Windows::UI::Xaml::Controls::Frame^ frame);46static void SaveFrameNavigationState(Windows::UI::Xaml::Controls::Frame^ frame);47};48}49}505152