From 9cd65104b0c96ca668b69bb9698b49d822cb6b1a Mon Sep 17 00:00:00 2001
From: wbin <737436093@qq.com>
Date: Mon, 8 Feb 2021 15:56:31 +0800
Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E9=85=8D=E7=BD=AE=E4=BF=AE=E6=94=B9?=
=?UTF-8?q?=E5=88=B0web.config?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
JianGongYun/App.config | 10 ++++++++++
JianGongYun/App.xaml.cs | 1 +
JianGongYun/JianGongYun.csproj | 3 +++
JianGongYun/MainWindow.xaml.cs | 13 +++++++++++--
JianGongYun/TRTC/LiveClassroom.cs | 14 ++++++++++----
JianGongYun/Views/TeachingInfo.xaml.cs | 18 ++++++++++++++++--
6 files changed, 51 insertions(+), 8 deletions(-)
create mode 100644 JianGongYun/App.config
diff --git a/JianGongYun/App.config b/JianGongYun/App.config
new file mode 100644
index 0000000..f7d7887
--- /dev/null
+++ b/JianGongYun/App.config
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/JianGongYun/App.xaml.cs b/JianGongYun/App.xaml.cs
index c44ffeb..33aa09c 100644
--- a/JianGongYun/App.xaml.cs
+++ b/JianGongYun/App.xaml.cs
@@ -13,5 +13,6 @@ namespace JianGongYun
///
public partial class App : Application
{
+
}
}
diff --git a/JianGongYun/JianGongYun.csproj b/JianGongYun/JianGongYun.csproj
index f189d0c..1babd1e 100644
--- a/JianGongYun/JianGongYun.csproj
+++ b/JianGongYun/JianGongYun.csproj
@@ -29,6 +29,9 @@
+
+ Always
+
Always
diff --git a/JianGongYun/MainWindow.xaml.cs b/JianGongYun/MainWindow.xaml.cs
index e5a8535..c63c8df 100644
--- a/JianGongYun/MainWindow.xaml.cs
+++ b/JianGongYun/MainWindow.xaml.cs
@@ -1,5 +1,6 @@
using AduSkin.Controls.Metro;
using AduSkin.Themes;
+using JianGongYun.TRTC;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -32,8 +33,16 @@ namespace JianGongYun
BorderBrush = Theme.CurrentColor.OpaqueSolidColorBrush;
};
BorderBrush = new SolidColorBrush(color: Color.FromRgb(42, 43, 48));
-
-
+ this.Hide();
+ //LiveClassroom.EnterTheClassroom(Window.GetWindow(this),
+ // new TRTC.Models.ClassroomEntity
+ // {
+ // ClassHead = "课程1",
+ // ClassSubHead = "章节1",
+ // TeacherId = "53245345",
+ // TeacherName = "王大锤"
+ // });
+
//TRTC集成测试
//ManageLiteAV.ITRTCCloud lTRTCCloud = ManageLiteAV.ITRTCCloud.getTRTCShareInstance();
//MessageBox.Show(lTRTCCloud.getSDKVersion());
diff --git a/JianGongYun/TRTC/LiveClassroom.cs b/JianGongYun/TRTC/LiveClassroom.cs
index dbbafec..9092bc2 100644
--- a/JianGongYun/TRTC/LiveClassroom.cs
+++ b/JianGongYun/TRTC/LiveClassroom.cs
@@ -20,6 +20,7 @@ using System.Drawing;
using System.Diagnostics;
using System.Runtime.InteropServices;
using AduSkin.Controls.Metro;
+using System.Configuration;
namespace JianGongYun.TRTC
{
@@ -28,10 +29,15 @@ namespace JianGongYun.TRTC
///
public static class LiveClassroom
{
- const uint SDKAppID = 1400463444;
- const string SDKAppKEY = "6ee2586282eb8ab5bff3f917b44500c4ffd9bbd3d820258b1fa8cdd470cfd1ee";
- const uint LIVEAppID = 1252883401;
- const uint LIVEBizid = 126866;
+ //const uint SDKAppID = 1400463444;
+ //const string SDKAppKEY = "6ee2586282eb8ab5bff3f917b44500c4ffd9bbd3d820258b1fa8cdd470cfd1ee";
+ //const uint LIVEAppID = 1252883401;
+ //const uint LIVEBizid = 126866;
+ static uint SDKAppID { get { return uint.Parse(ConfigurationManager.AppSettings[nameof(SDKAppID)]); } }
+ static string SDKAppKEY { get { return ConfigurationManager.AppSettings[nameof(SDKAppKEY)]; } }
+ static uint LIVEAppID { get { return uint.Parse(ConfigurationManager.AppSettings[nameof(LIVEAppID)]); } }
+ static uint LIVEBizid { get { return uint.Parse(ConfigurationManager.AppSettings[nameof(LIVEBizid)]); } }
+
///
/// TRTC实例
///
diff --git a/JianGongYun/Views/TeachingInfo.xaml.cs b/JianGongYun/Views/TeachingInfo.xaml.cs
index 52828ed..af97247 100644
--- a/JianGongYun/Views/TeachingInfo.xaml.cs
+++ b/JianGongYun/Views/TeachingInfo.xaml.cs
@@ -1,6 +1,9 @@
-using JianGongYun.TRTC;
+using AduSkin.Controls;
+using AduSkin.Controls.Metro;
+using JianGongYun.TRTC;
using System;
using System.Collections.Generic;
+using System.Configuration;
using System.Text;
using System.Windows;
using System.Windows.Controls;
@@ -25,12 +28,23 @@ namespace JianGongYun.Views
private void LiveTest_Click(object sender, RoutedEventArgs e)
{
+ var roomId = ConfigurationManager.AppSettings["RoomId"];
+ if (string.IsNullOrWhiteSpace(roomId))
+ {
+ NoticeManager.NotifiactionShow.AddNotifiaction(new NotifiactionModel()
+ {
+ Title = "提醒",
+ Content = $"未配置房间号",
+ NotifiactionType= EnumPromptType.Error
+ });
+ return;
+ }
LiveClassroom.EnterTheClassroom(Window.GetWindow(this),
new TRTC.Models.ClassroomEntity
{
ClassHead = "课程1",
ClassSubHead = "章节1",
- TeacherId = "53245345",
+ TeacherId = roomId,
TeacherName = "王大锤"
});
}