|
Dieser Artikel wurde maschinell übersetzt. Bewegen Sie den Mauszeiger über die Sätze im Artikel, um den Originaltext anzuzeigen. Weitere Informationen
|
Übersetzung
Original
|
Application.SessionEnding-Ereignis
Namespace: System.Windows
Assembly: PresentationFramework (in PresentationFramework.dll)
XMLNS für XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="SDKSample.App" StartupUri="MainWindow.xaml" SessionEnding="App_SessionEnding" />
Imports Microsoft.VisualBasic Imports System.Windows ' Application, SessionEndingCancelEventArgs, MessageBox, MessageBoxResult, MessageBoxButton Namespace SDKSample Partial Public Class App Inherits Application Private Sub App_SessionEnding(ByVal sender As Object, ByVal e As SessionEndingCancelEventArgs) ' Ask the user if they want to allow the session to end Dim msg As String = String.Format("{0}. End session?", e.ReasonSessionEnding) Dim result As MessageBoxResult = MessageBox.Show(msg, "Session Ending", MessageBoxButton.YesNo) ' End session, if specified If result = MessageBoxResult.No Then e.Cancel = True End If End Sub End Class End Namespace
using System.Windows; // Application, SessionEndingCancelEventArgs, MessageBox, MessageBoxResult, MessageBoxButton namespace SDKSample { public partial class App : Application { void App_SessionEnding(object sender, SessionEndingCancelEventArgs e) { // Ask the user if they want to allow the session to end string msg = string.Format("{0}. End session?", e.ReasonSessionEnding); MessageBoxResult result = MessageBox.Show(msg, "Session Ending", MessageBoxButton.YesNo); // End session, if specified if (result == MessageBoxResult.No) { e.Cancel = true; } } } }
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core-Rolle wird nicht unterstützt), Windows Server 2008 R2 (Server Core-Rolle wird mit SP1 oder höher unterstützt; Itanium wird nicht unterstützt)
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen für .NET Framework.