private void activate_Click(object sender, RoutedEventArgs e) { Button b = sender as Button; if (b != null) { DisplayRequestInfo info = App.ActivateDisplayRequest(); switch (info.ActivationResult) { case ActivationResult.Activated: status.Log(string.Format(CultureInfo.CurrentCulture, LocalizableStrings.DISPLAY_REQUEST_ACTIVATED, info.ActivationTime.ToString("HH:mm:ss", CultureInfo.CurrentCulture))); break; case ActivationResult.PreviouslyActivated: status.Log(string.Format(CultureInfo.CurrentCulture, LocalizableStrings.DISPLAY_REQUEST_ALREADY_ACTIVATED, info.ActivationTime.ToString("HH:mm:ss", CultureInfo.CurrentCulture))); break; default: status.Log(LocalizableStrings.DISPLAY_REQUEST_NOT_ACTIVATED); break; } } }