From 295be45a3a6688c18b78f0247562708e50520ef3 Mon Sep 17 00:00:00 2001 From: wbin <737436093@qq.com> Date: Sun, 14 Feb 2021 10:20:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=92=8C=E4=BF=AE=E6=94=B9=E5=90=AF=E5=8A=A8=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JianGongYun/App.xaml | 3 - JianGongYun/JianGongYun.csproj | 12 --- JianGongYun/MainWindow.xaml | 38 -------- JianGongYun/MainWindow.xaml.cs | 52 ----------- JianGongYun/Properties/launchSettings.json | 2 +- JianGongYun/ViewModel/MainViewModel.cs | 28 ------ .../ModuleViewModel/PracticalCaseViewModel.cs | 91 ------------------- JianGongYun/ViewModel/ViewModelLocator.cs | 50 ---------- JianGongYun/Views/Login.xaml.cs | 15 ++- JianGongYun/Views/TeachingInfo.xaml | 76 ---------------- JianGongYun/Views/TeachingInfo.xaml.cs | 52 ----------- JianGongYun/Views/TeachingPlan.xaml | 12 --- JianGongYun/Views/TeachingPlan.xaml.cs | 26 ------ JianGongYun/Views/Window1.xaml | 14 --- JianGongYun/Views/Window1.xaml.cs | 25 ----- JianGongYun/Views/Window2.xaml | 12 --- JianGongYun/Views/Window2.xaml.cs | 25 ----- 17 files changed, 15 insertions(+), 518 deletions(-) delete mode 100644 JianGongYun/MainWindow.xaml delete mode 100644 JianGongYun/MainWindow.xaml.cs delete mode 100644 JianGongYun/ViewModel/MainViewModel.cs delete mode 100644 JianGongYun/ViewModel/ModuleViewModel/PracticalCaseViewModel.cs delete mode 100644 JianGongYun/ViewModel/ViewModelLocator.cs delete mode 100644 JianGongYun/Views/TeachingInfo.xaml delete mode 100644 JianGongYun/Views/TeachingInfo.xaml.cs delete mode 100644 JianGongYun/Views/TeachingPlan.xaml delete mode 100644 JianGongYun/Views/TeachingPlan.xaml.cs delete mode 100644 JianGongYun/Views/Window1.xaml delete mode 100644 JianGongYun/Views/Window1.xaml.cs delete mode 100644 JianGongYun/Views/Window2.xaml delete mode 100644 JianGongYun/Views/Window2.xaml.cs diff --git a/JianGongYun/App.xaml b/JianGongYun/App.xaml index 22464e1..b3a9ebb 100644 --- a/JianGongYun/App.xaml +++ b/JianGongYun/App.xaml @@ -3,13 +3,10 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" d1p1:Ignorable="d" - xmlns:local="clr-namespace:JianGongYun" - xmlns:vm="clr-namespace:JianGongYun.ViewModel" xmlns:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006" StartupUri="/Views/Login.xaml"> - diff --git a/JianGongYun/JianGongYun.csproj b/JianGongYun/JianGongYun.csproj index b17d70b..b8d1d5c 100644 --- a/JianGongYun/JianGongYun.csproj +++ b/JianGongYun/JianGongYun.csproj @@ -15,7 +15,6 @@ - @@ -24,11 +23,6 @@ - - - Code - - Always @@ -37,12 +31,6 @@ Always - - - $(DefaultXamlRuntime) - Designer - - TRTC_SDK\Win64\lib\ManageLiteAV.dll diff --git a/JianGongYun/MainWindow.xaml b/JianGongYun/MainWindow.xaml deleted file mode 100644 index 5ede3f5..0000000 --- a/JianGongYun/MainWindow.xaml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/JianGongYun/MainWindow.xaml.cs b/JianGongYun/MainWindow.xaml.cs deleted file mode 100644 index c4555b5..0000000 --- a/JianGongYun/MainWindow.xaml.cs +++ /dev/null @@ -1,52 +0,0 @@ -using AduSkin.Controls.Metro; -using AduSkin.Themes; -using JianGongYun.TRTC; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -namespace JianGongYun -{ - /// - /// Interaction logic for MainWindow.xaml - /// - public partial class MainWindow : MetroWindow - { - public MainWindow() - { - InitializeComponent(); - this.Closed += delegate { Environment.Exit(0); }; - Theme.ColorChange += delegate - { - // 不要通过XAML来绑定颜色,无法获取到通知 - 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()); - //ManageLiteAV.ITRTCCloud.destroyTRTCShareInstance(); - } - } -} diff --git a/JianGongYun/Properties/launchSettings.json b/JianGongYun/Properties/launchSettings.json index 0b73c15..a4c6ce9 100644 --- a/JianGongYun/Properties/launchSettings.json +++ b/JianGongYun/Properties/launchSettings.json @@ -2,7 +2,7 @@ "profiles": { "JianGongYun": { "commandName": "Project", - "commandLineArgs": "--classhead 测试课程1 --classsubhead 测试章节1 --teacherid 12345678 --teachername 王大锤", + "commandLineArgs": "sznykt://--classhead|测试课程1|--classsubhead|测试章节1|--teacherid|12345678|--teachername|王大锤", "nativeDebugging": false } } diff --git a/JianGongYun/ViewModel/MainViewModel.cs b/JianGongYun/ViewModel/MainViewModel.cs deleted file mode 100644 index 9272af9..0000000 --- a/JianGongYun/ViewModel/MainViewModel.cs +++ /dev/null @@ -1,28 +0,0 @@ -using GalaSoft.MvvmLight; -using JianGongYun.Views; -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Controls; - -namespace JianGongYun.ViewModel -{ - public class MainViewModel : ViewModelBase - { - public MainViewModel() - { - - } - - /// - /// 实用案例 - /// - private UserControl _TeachingInfo = new TeachingInfo(); - public UserControl TeachingInfo - { - get { return _TeachingInfo; } - set { Set(ref _TeachingInfo, value); } - } - - } -} diff --git a/JianGongYun/ViewModel/ModuleViewModel/PracticalCaseViewModel.cs b/JianGongYun/ViewModel/ModuleViewModel/PracticalCaseViewModel.cs deleted file mode 100644 index ff916c5..0000000 --- a/JianGongYun/ViewModel/ModuleViewModel/PracticalCaseViewModel.cs +++ /dev/null @@ -1,91 +0,0 @@ -using GalaSoft.MvvmLight; -using JianGongYun.Models; -using JianGongYun.Views; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Windows.Controls; -using System.Windows.Data; - -namespace JianGongYun.ViewModel.ModuleViewModel -{ - public class PracticalCaseViewModel : ViewModelBase - { - public PracticalCaseViewModel() - { - - #region 控件 - _ControlList = new List() - { - new ControlModel("Win10菜单", typeof(Window1)), - new ControlModel("Win10菜单cccc", typeof(Window2)), - new ControlModel("教学计划", typeof(TeachingPlan)) - }; - _AllControl.Source = _ControlList; - _AllControl.View.Culture = new System.Globalization.CultureInfo("zh-CN"); - #endregion - } - - #region 控件 - private IEnumerable _ControlList; - /// - /// 所有控件 - /// - public IEnumerable AllControl - { - get { return _ControlList; } - set { Set(ref _ControlList, value); } - } - - private CollectionViewSource _AllControl=new CollectionViewSource(); - /// - /// 所有控件 - /// - public CollectionViewSource AllControlViewSource - { - get { return _AllControl; } - set - { - Set(ref _AllControl, value); - } - } - #endregion - - private ControlModel _CurrentShowControl = null; - /// - /// 当前显示控件 - /// - public ControlModel CurrentShowControl - { - get - { - return _CurrentShowControl; - } - set - { - Set(ref _CurrentShowControl, value); - RaisePropertyChanged("Content"); - } - } - /// - /// 控件显示 - /// - private UserControl _content; - public UserControl Content - { - get - { - if (CurrentShowControl == null) - return null; - return (UserControl)Activator.CreateInstance(CurrentShowControl.Content); - - } - set - { - Set(ref _content, value); - } - } - } -} diff --git a/JianGongYun/ViewModel/ViewModelLocator.cs b/JianGongYun/ViewModel/ViewModelLocator.cs deleted file mode 100644 index 1563bcf..0000000 --- a/JianGongYun/ViewModel/ViewModelLocator.cs +++ /dev/null @@ -1,50 +0,0 @@ -using CommonServiceLocator; -using GalaSoft.MvvmLight.Ioc; -using System; -using System.Collections.Generic; -using System.Text; - -namespace JianGongYun.ViewModel -{ - /// - /// This class contains static references to all the view models in the - /// application and provides an entry point for the bindings. - /// - public class ViewModelLocator - { - /// - /// Initializes a new instance of the ViewModelLocator class. - /// - public ViewModelLocator() - { - ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); - - ////if (ViewModelBase.IsInDesignModeStatic) - ////{ - //// // Create design time view services and models - //// SimpleIoc.Default.Register(); - ////} - ////else - ////{ - //// // Create run time view services and models - //// SimpleIoc.Default.Register(); - ////} - - SimpleIoc.Default.Register(); - } - - public MainViewModel Main - { - get - { - return ServiceLocator.Current.GetInstance(); - } - } - - - public static void Cleanup() - { - // TODO Clear the ViewModels - } - } -} diff --git a/JianGongYun/Views/Login.xaml.cs b/JianGongYun/Views/Login.xaml.cs index 8e43ce1..a9f6f9b 100644 --- a/JianGongYun/Views/Login.xaml.cs +++ b/JianGongYun/Views/Login.xaml.cs @@ -14,6 +14,7 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; using System.Linq; +using System.Web; namespace JianGongYun.Views { @@ -29,8 +30,20 @@ namespace JianGongYun.Views public Login() { InitializeComponent(); - var args = Environment.GetCommandLineArgs(); string errMsg = "", classHead = default, classSubHead = default, teacherId = default, teacherName = default; + var urltemps = Environment.GetCommandLineArgs(); + if (urltemps.Length < 2) + { + errMsg = $"Startup Parameter Null"; + goto Skip; + } + var first = urltemps[1]; + if (!first.StartsWith("sznykt")) + { + errMsg = "Startup Parameter Error"; + goto Skip; + } + var args= HttpUtility.UrlDecode(first, Encoding.UTF8).Replace("://","|").Split("|"); int indexTemp = Array.IndexOf(args, CLASS_HEAD); if (indexTemp < 0) { diff --git a/JianGongYun/Views/TeachingInfo.xaml b/JianGongYun/Views/TeachingInfo.xaml deleted file mode 100644 index b638fb9..0000000 --- a/JianGongYun/Views/TeachingInfo.xaml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/JianGongYun/Views/TeachingInfo.xaml.cs b/JianGongYun/Views/TeachingInfo.xaml.cs deleted file mode 100644 index af97247..0000000 --- a/JianGongYun/Views/TeachingInfo.xaml.cs +++ /dev/null @@ -1,52 +0,0 @@ -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; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; - -namespace JianGongYun.Views -{ - /// - /// TeachingInfo.xaml 的交互逻辑 - /// - public partial class TeachingInfo : UserControl - { - public TeachingInfo() - { - InitializeComponent(); - } - - 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 = roomId, - TeacherName = "王大锤" - }); - } - } -} \ No newline at end of file diff --git a/JianGongYun/Views/TeachingPlan.xaml b/JianGongYun/Views/TeachingPlan.xaml deleted file mode 100644 index f5340cd..0000000 --- a/JianGongYun/Views/TeachingPlan.xaml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - diff --git a/JianGongYun/Views/TeachingPlan.xaml.cs b/JianGongYun/Views/TeachingPlan.xaml.cs deleted file mode 100644 index f9746a3..0000000 --- a/JianGongYun/Views/TeachingPlan.xaml.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -namespace JianGongYun.Views -{ - /// - /// TeachingPlan.xaml 的交互逻辑 - /// - public partial class TeachingPlan : UserControl - { - public TeachingPlan() - { - InitializeComponent(); - } - } -} diff --git a/JianGongYun/Views/Window1.xaml b/JianGongYun/Views/Window1.xaml deleted file mode 100644 index e0767a6..0000000 --- a/JianGongYun/Views/Window1.xaml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - diff --git a/JianGongYun/Views/Window1.xaml.cs b/JianGongYun/Views/Window1.xaml.cs deleted file mode 100644 index d4658ee..0000000 --- a/JianGongYun/Views/Window1.xaml.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; - -namespace JianGongYun.Views -{ - /// - /// Window1.xaml 的交互逻辑 - /// - public partial class Window1 : UserControl - { - public Window1() - { - InitializeComponent(); - } - } -} diff --git a/JianGongYun/Views/Window2.xaml b/JianGongYun/Views/Window2.xaml deleted file mode 100644 index 4544cc5..0000000 --- a/JianGongYun/Views/Window2.xaml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - diff --git a/JianGongYun/Views/Window2.xaml.cs b/JianGongYun/Views/Window2.xaml.cs deleted file mode 100644 index 289ef25..0000000 --- a/JianGongYun/Views/Window2.xaml.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Shapes; - -namespace JianGongYun.Views -{ - /// - /// Window1.xaml 的交互逻辑 - /// - public partial class Window2 : UserControl - { - public Window2() - { - InitializeComponent(); - } - } -}