启动参数
This commit is contained in:
parent
28cd604acc
commit
df03186995
|
@ -2,6 +2,7 @@
|
||||||
"profiles": {
|
"profiles": {
|
||||||
"JianGongYun": {
|
"JianGongYun": {
|
||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
|
"commandLineArgs": "--classhead 测试课程1 --classsubhead 测试章节1 --teacherid 12345678 --teachername 王大锤",
|
||||||
"nativeDebugging": false
|
"nativeDebugging": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -592,7 +592,6 @@ namespace JianGongYun.TRTC
|
||||||
prc.WaitForExit();
|
prc.WaitForExit();
|
||||||
CurrentLiveWindow.Dispatcher.Invoke(new Action(() =>
|
CurrentLiveWindow.Dispatcher.Invoke(new Action(() =>
|
||||||
{
|
{
|
||||||
CurrentLiveWindow.Close();
|
|
||||||
NoticeManager.NotifiactionShow.AddNotifiaction(new NotifiactionModel()
|
NoticeManager.NotifiactionShow.AddNotifiaction(new NotifiactionModel()
|
||||||
{
|
{
|
||||||
Title = "提醒",
|
Title = "提醒",
|
||||||
|
@ -620,6 +619,7 @@ namespace JianGongYun.TRTC
|
||||||
File.Delete(AudioTempPath);
|
File.Delete(AudioTempPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CurrentLiveWindow.Close();
|
||||||
}));
|
}));
|
||||||
Debug.Print("结束写入视频线程");
|
Debug.Print("结束写入视频线程");
|
||||||
}, TaskCreationOptions.LongRunning);
|
}, TaskCreationOptions.LongRunning);
|
||||||
|
@ -727,7 +727,8 @@ namespace JianGongYun.TRTC
|
||||||
Application.Current.Shutdown();
|
Application.Current.Shutdown();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CallerWindow.Show();//还原调用者窗口
|
CallerWindow.Close();//直接关闭
|
||||||
|
Application.Current.Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace JianGongYun.Views
|
namespace JianGongYun.Views
|
||||||
{
|
{
|
||||||
|
@ -21,25 +22,62 @@ namespace JianGongYun.Views
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class Login : MetroWindow
|
public partial class Login : MetroWindow
|
||||||
{
|
{
|
||||||
|
const string CLASS_HEAD = "--classhead";
|
||||||
|
const string CLASS_SUB_HEAD = "--classsubhead";
|
||||||
|
const string TEACHER_ID = "--teacherid";
|
||||||
|
const string TEACHER_NAME = "--teachername";
|
||||||
public Login()
|
public Login()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
BorderBrush = new SolidColorBrush(color: Color.FromRgb(42, 43, 48));
|
var args = Environment.GetCommandLineArgs();
|
||||||
var roomId = ConfigurationManager.AppSettings["RoomId"];
|
string errMsg = "", classHead = default, classSubHead = default, teacherId = default, teacherName = default;
|
||||||
if (string.IsNullOrWhiteSpace(roomId))
|
int indexTemp = Array.IndexOf(args, CLASS_HEAD);
|
||||||
|
if (indexTemp < 0)
|
||||||
{
|
{
|
||||||
MessageBox.Show("未配置房间号!","警告", MessageBoxButton.OKCancel,MessageBoxImage.Error);
|
errMsg = $"{nameof(classHead)} NULL";
|
||||||
Application.Current.Shutdown();
|
goto Skip;
|
||||||
}
|
}
|
||||||
LiveClassroom.EnterTheClassroom(null,
|
classHead = args[indexTemp + 1];
|
||||||
|
|
||||||
|
indexTemp = Array.IndexOf(args, CLASS_SUB_HEAD);
|
||||||
|
if (indexTemp < 0)
|
||||||
|
{
|
||||||
|
errMsg = $"{nameof(CLASS_SUB_HEAD)} NULL";
|
||||||
|
goto Skip;
|
||||||
|
}
|
||||||
|
classSubHead = args[indexTemp + 1];
|
||||||
|
|
||||||
|
indexTemp = Array.IndexOf(args, TEACHER_ID);
|
||||||
|
if (indexTemp < 0)
|
||||||
|
{
|
||||||
|
errMsg = $"{nameof(TEACHER_ID)} NULL";
|
||||||
|
goto Skip;
|
||||||
|
}
|
||||||
|
teacherId = args[indexTemp + 1];
|
||||||
|
|
||||||
|
indexTemp = Array.IndexOf(args, TEACHER_NAME);
|
||||||
|
if (indexTemp < 0)
|
||||||
|
{
|
||||||
|
errMsg = $"{nameof(TEACHER_NAME)} NULL";
|
||||||
|
goto Skip;
|
||||||
|
}
|
||||||
|
teacherName = args[indexTemp + 1];
|
||||||
|
|
||||||
|
Skip:
|
||||||
|
if (!string.IsNullOrWhiteSpace(errMsg))
|
||||||
|
{
|
||||||
|
MessageBox.Show(errMsg, "错误", MessageBoxButton.OKCancel, MessageBoxImage.Error);
|
||||||
|
Application.Current.Shutdown();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
LiveClassroom.EnterTheClassroom(Window.GetWindow(this),
|
||||||
new TRTC.Models.ClassroomEntity
|
new TRTC.Models.ClassroomEntity
|
||||||
{
|
{
|
||||||
ClassHead = "课程1",
|
ClassHead = classHead,
|
||||||
ClassSubHead = "章节1",
|
ClassSubHead = classSubHead,
|
||||||
TeacherId = roomId,
|
TeacherId = teacherId,
|
||||||
TeacherName = "王大锤"
|
TeacherName = teacherName
|
||||||
});
|
});
|
||||||
this.Close();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue