Last active
December 13, 2015 07:13
-
-
Save ToshihiroGoto/9adaa5682be25272cb6b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
"use strict"; | |
// WinJS を使えるように設定 | |
var app = WinJS.Application; | |
// Windows Runtime を使えるように設定 | |
var activation = Windows.ApplicationModel.Activation; | |
// アプリ起動時に呼び出される | |
app.onactivated = function (args) { | |
// 起動状態を調べる | |
if (args.detail.kind === activation.ActivationKind.launch) { | |
// アプリケーション起動時の処理、または復帰後のアプリの復元 | |
if (args.detail.previousExecutionState !== activation.ApplicationExecutionState.terminated) { | |
// TODO: This application has been newly launched. Initialize your application here. | |
} else { | |
// TODO: This application was suspended and then terminated. | |
// To create a smooth user experience, restore application state here so that it looks like the app never stopped running. | |
} | |
args.setPromise(WinJS.UI.processAll()); | |
} | |
}; | |
// アプリ中断時に情報を保存したりする | |
app.oncheckpoint = function (args) { | |
// TODO: This application is about to be suspended. Save any state that needs to persist across suspensions here. | |
// You might use the WinJS.Application.sessionState object, which is automatically saved and restored across suspension. | |
// If you need to complete an asynchronous operation before your application is suspended, call args.setPromise(). | |
}; | |
app.start(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment