Blame view

3rdparty/opencv-4.5.4/samples/winrt/ImageManipulations/common/suspensionmanager.h 2.02 KB
f4334277   Hu Chunming   提交3rdparty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
  //*********************************************************
  //
  // Copyright (c) Microsoft. All rights reserved.
  // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
  // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
  // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
  // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
  //
  //*********************************************************
  
  //
  // SuspensionManager.h
  // Declaration of the SuspensionManager class
  //
  
  #pragma once
  
  #include <ppltasks.h>
  
  namespace SDKSample
  {
      namespace Common
      {
          /// <summary>
          /// SuspensionManager captures global session state to simplify process lifetime management
          /// for an application.  Note that session state will be automatically cleared under a variety
          /// of conditions and should only be used to store information that would be convenient to
          /// carry across sessions, but that should be disacarded when an application crashes or is
          /// upgraded.
          /// </summary>
          ref class SuspensionManager sealed
          {
          internal:
              static void RegisterFrame(Windows::UI::Xaml::Controls::Frame^ frame, Platform::String^ sessionStateKey);
              static void UnregisterFrame(Windows::UI::Xaml::Controls::Frame^ frame);
              static Concurrency::task<void> SaveAsync(void);
              static Concurrency::task<void> RestoreAsync(void);
              static property Windows::Foundation::Collections::IMap<Platform::String^, Platform::Object^>^ SessionState
              {
                  Windows::Foundation::Collections::IMap<Platform::String^, Platform::Object^>^ get(void);
              };
              static Windows::Foundation::Collections::IMap<Platform::String^, Platform::Object^>^ SessionStateForFrame(
                  Windows::UI::Xaml::Controls::Frame^ frame);
  
          private:
              static void RestoreFrameNavigationState(Windows::UI::Xaml::Controls::Frame^ frame);
              static void SaveFrameNavigationState(Windows::UI::Xaml::Controls::Frame^ frame);
          };
      }
  }