protected override void OnStartup(StartupEventArgs e) { if (e.Args.Length > 0) { var videoPath = e.Args[0]; var argsIndex = 1; while (!Path.HasExtension(videoPath)) { if (e.Args.Length >= argsIndex) { videoPath += " " + e.Args[argsIndex++]; } else { break; } } StartupArgsHelper.VideoFilePath = videoPath; if (e.Args.Length >= argsIndex) { StartupArgsHelper.IsRepeat = e.Args[argsIndex++].ToBoolean(); } _log.Info(StartupArgsHelper.VideoFilePath); _log.Info(StartupArgsHelper.IsRepeat ? "循环" : "一次"); } base.OnStartup(e); }
internal void WriteMsgWithLog(string msg, StatusNotificationType statusType) { Messenger.Default.Send(new StatusNotificationMessage(msg, statusType), LogMsgId); var logMsg = $"舞台灯光_{HeaderName}_{msg}"; switch (statusType) { case StatusNotificationType.RInfo: _logWraper.Info(logMsg); break; case StatusNotificationType.NInfo: _logWraper.Info(logMsg); break; case StatusNotificationType.Error: _logWraper.Error(logMsg); break; default: throw new ArgumentOutOfRangeException(nameof(statusType), statusType, null); } }