示例#1
0
        /// <summary>
        /// Invoked when application execution is being suspended. Application state is saved
        /// without knowing whether the application will be terminated or resumed with the contents
        /// of memory still intact.
        /// </summary>
        /// <param name="sender">The source of the suspend request.</param>
        /// <param name="e">Details about the suspend request.</param>
        private async void OnSuspending(object sender, SuspendingEventArgs e)
        {
            var deferral = e.SuspendingOperation.GetDeferral();

            Log.Information("App suspended.");

            await EM300LRHub.Disconnect();

            await ETAPU11Hub.Disconnect();

            await FroniusHub.Disconnect();

            await HomeDataHub.Disconnect();

            await KWLEC200Hub.Disconnect();

            await NetatmoHub.Disconnect();

            await WallboxHub.Disconnect();

            await ZipatoHub.Disconnect();

            Log.CloseAndFlush();
            deferral.Complete();
        }
示例#2
0
        /// <summary>
        /// Invoked when application execution is being resumed.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void OnResuming(object sender, object e)
        {
            Log.Information("App resumed.");

            await EM300LRHub.Connect();

            await ETAPU11Hub.Connect();

            await FroniusHub.Connect();

            await HomeDataHub.Connect();

            await KWLEC200Hub.Connect();

            await NetatmoHub.Connect();

            await WallboxHub.Connect();

            await ZipatoHub.Connect();
        }