Browse Source

互动 个人空间数据

ZhangXueYang
zhangxueyang 3 years ago
parent
commit
e1edb4e27c

+ 1
- 0
Common/Common.csproj View File

139
     <Compile Include="system\LogHelper.cs" />
139
     <Compile Include="system\LogHelper.cs" />
140
     <Compile Include="system\PrimaryScreen.cs" />
140
     <Compile Include="system\PrimaryScreen.cs" />
141
     <Compile Include="Properties\AssemblyInfo.cs" />
141
     <Compile Include="Properties\AssemblyInfo.cs" />
142
+    <Compile Include="system\RegistryHelper.cs" />
142
     <Compile Include="system\SplashScreen.cs" />
143
     <Compile Include="system\SplashScreen.cs" />
143
     <Compile Include="system\XmlUtilHelper.cs" />
144
     <Compile Include="system\XmlUtilHelper.cs" />
144
     <Compile Include="system\ZJClippingBorder.cs" />
145
     <Compile Include="system\ZJClippingBorder.cs" />

+ 1
- 1
XHZB.Desktop/AttendanceWindow.xaml View File

174
             <Grid x:Name="gridImg" Grid.Row="2" Visibility="Collapsed">
174
             <Grid x:Name="gridImg" Grid.Row="2" Visibility="Collapsed">
175
                 <Image x:Name="img"/>
175
                 <Image x:Name="img"/>
176
             </Grid>
176
             </Grid>
177
-            <Viewbox Grid.Row="3">
177
+            <Viewbox Grid.Row="3" Visibility="Hidden">
178
                 <Border
178
                 <Border
179
                     Grid.Row="3"
179
                     Grid.Row="3"
180
                     Margin="25,0,25,0"
180
                     Margin="25,0,25,0"

+ 1
- 1
XHZB.Desktop/AttendanceWindow.xaml.cs View File

56
             DragMove();
56
             DragMove();
57
         }
57
         }
58
 
58
 
59
-        public void receiveWsMsg(ZWsMsgVo msg)
59
+        public void receiveWsMsg(SocketModel msg)
60
         {
60
         {
61
         }
61
         }
62
 
62
 

BIN
XHZB.Desktop/Images/Resource/CLASS.png View File


BIN
XHZB.Desktop/Images/Resource/DOC.png View File


BIN
XHZB.Desktop/Images/Resource/DSC.png View File


BIN
XHZB.Desktop/Images/Resource/EXCEL.png View File


BIN
XHZB.Desktop/Images/Resource/FLV.png View File


BIN
XHZB.Desktop/Images/Resource/MP3.png View File


BIN
XHZB.Desktop/Images/Resource/MP4.png View File


BIN
XHZB.Desktop/Images/Resource/PDF.png View File


BIN
XHZB.Desktop/Images/Resource/PNG.png View File


BIN
XHZB.Desktop/Images/Resource/PPT.png View File


BIN
XHZB.Desktop/Images/Resource/TXT.png View File


BIN
XHZB.Desktop/Images/Resource/WAV.png View File


BIN
XHZB.Desktop/Images/Resource/resource_0.png View File


BIN
XHZB.Desktop/Images/Resource/resource_1.png View File


BIN
XHZB.Desktop/Images/Resource/resource_2.png View File


+ 1
- 1
XHZB.Desktop/LoginWindow.xaml View File

459
                 Foreground="White"
459
                 Foreground="White"
460
                 Text="测试版" />
460
                 Text="测试版" />
461
             </StackPanel>
461
             </StackPanel>
462
-            <Button x:Name="btnSetUp" Height="25" Width="66" HorizontalAlignment="Right" Cursor="Hand"  Margin="0,0,5,6" VerticalAlignment="Bottom" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="btnSetUp_Click">
462
+            <Button x:Name="btnSetUp" Height="25" Width="66" HorizontalAlignment="Right" Cursor="Hand"  Margin="0,0,5,6" VerticalAlignment="Bottom" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Click="btnSetUp_Click" Visibility="Hidden">
463
                 <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
463
                 <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
464
                     <Image Source=".\Images\Login\设置@2x.png"/>
464
                     <Image Source=".\Images\Login\设置@2x.png"/>
465
                     <TextBlock Text="设置" Foreground="White" FontSize="16"   HorizontalAlignment="Right"    
465
                     <TextBlock Text="设置" Foreground="White" FontSize="16"   HorizontalAlignment="Right"    

+ 44
- 7
XHZB.Desktop/LoginWindow.xaml.cs View File

503
             APP.myloading.Hide();
503
             APP.myloading.Hide();
504
             if (serverReturnCode == APP.ServerScuessCode)
504
             if (serverReturnCode == APP.ServerScuessCode)
505
             {
505
             {
506
-                string imagepath = APP.classRoomImagePath();
507
-                if (!Directory.Exists(imagepath))
506
+                new Thread(o =>
508
                 {
507
                 {
509
-                    Directory.CreateDirectory(imagepath);
510
-                }
511
-                ToolbarWindow win = new ToolbarWindow();
508
+                    InvokeLiveBroadcastServering();
509
+                    Dispatcher.Invoke(new Action(() =>
510
+                    {
511
+                        InvokeServerLiveBroadcastCompate();
512
+                    }));
513
+
514
+                }).Start();
515
+
512
 
516
 
513
-                Close();
514
-                win.ShowDialog();
517
+
518
+
519
+           
515
 
520
 
516
 
521
 
517
 
522
 
555
             }
560
             }
556
         }
561
         }
557
         /// <summary>
562
         /// <summary>
563
+        /// 开始直播服务-调用
564
+        /// </summary>
565
+        /// <returns></returns>
566
+        private object InvokeLiveBroadcastServering()  
567
+        {
568
+            serverReturnCode = registerController.ClassList();
569
+            return APP.ErrorMessage;
570
+        }
571
+        /// <summary>
572
+        /// 开始直播服务-返回结果
573
+        /// </summary>
574
+        /// <returns></returns>
575
+        public void InvokeServerLiveBroadcastCompate()
576
+        {
577
+            if (serverReturnCode == APP.ServerScuessCode)
578
+            {
579
+                string imagepath = APP.classRoomImagePath();
580
+                if (!Directory.Exists(imagepath))
581
+                {
582
+                    Directory.CreateDirectory(imagepath);
583
+                }
584
+                ToolbarWindow win = new ToolbarWindow();
585
+
586
+                Close();
587
+                win.ShowDialog();
588
+            }
589
+            else
590
+            {
591
+                MessageWindow.Show(APP.ErrorMessage);
592
+            }
593
+        }
594
+        /// <summary>
558
         /// 教师任教班级服务-调用
595
         /// 教师任教班级服务-调用
559
         /// </summary>
596
         /// </summary>
560
         /// <returns></returns>
597
         /// <returns></returns>

+ 1
- 1
XHZB.Desktop/RollCallWindow.xaml View File

283
                     <TextBlock FontSize="30" Text="人抢答" />
283
                     <TextBlock FontSize="30" Text="人抢答" />
284
                 </StackPanel>
284
                 </StackPanel>
285
             </Grid>
285
             </Grid>
286
-            <Viewbox Grid.Row="3">
286
+            <Viewbox Grid.Row="3" Visibility="Hidden">
287
                 <Border
287
                 <Border
288
                     Grid.Row="3"
288
                     Grid.Row="3"
289
                     Margin="33,0,33,0"
289
                     Margin="33,0,33,0"

+ 23
- 23
XHZB.Desktop/RollCallWindow.xaml.cs View File

19
     /// <summary>
19
     /// <summary>
20
     /// 点名抢答
20
     /// 点名抢答
21
     /// </summary>
21
     /// </summary>
22
-    public partial class RollCallWindow : Window/*, ZSocketCallback*/
22
+    public partial class RollCallWindow : Window, SocketCallback
23
     {
23
     {
24
         #region 值初始化
24
         #region 值初始化
25
 
25
 
86
             }
86
             }
87
             Initialize();
87
             Initialize();
88
 
88
 
89
-            //ZSocketServer.getInstance().addWin(this);
89
+            WSocketClient.getInstance().addWin(this);
90
         }
90
         }
91
 
91
 
92
         /// <summary>
92
         /// <summary>
123
                    receiveWsMsg(null);
123
                    receiveWsMsg(null);
124
                }));
124
                }));
125
         }
125
         }
126
-        public void receiveWsMsg(ZWsMsgVo msg)
126
+        public void receiveWsMsg(SocketModel msg)
127
         {
127
         {
128
             if (!isRollCall && !isRushToAnswer)
128
             if (!isRollCall && !isRushToAnswer)
129
             {
129
             {
130
                 initPageData();
130
                 initPageData();
131
             }
131
             }
132
-            if (msg != null && msg.type == 402 && isRushToAnswer && msg.body.asktid == APP.askid)
132
+            if (msg != null && msg.c == 2021)
133
             {
133
             {
134
                 Console.WriteLine(msg);
134
                 Console.WriteLine(msg);
135
 
135
 
137
                 #region 去重
137
                 #region 去重
138
                 for (int i = 0; i < pageData.userList.Count; i++)
138
                 for (int i = 0; i < pageData.userList.Count; i++)
139
                 {
139
                 {
140
-                    if (msg.body.userid.ToString().Equals(pageData.userList[i].ID))
140
+                    if (msg.b.stid.ToString().Equals(pageData.userList[i].ID))
141
                     {
141
                     {
142
                         return;
142
                         return;
143
                     }
143
                     }
197
                 Dispatcher.Invoke(DispatcherPriority.Normal,
197
                 Dispatcher.Invoke(DispatcherPriority.Normal,
198
                     new Action(() =>
198
                     new Action(() =>
199
                     {
199
                     {
200
-                        try
201
-                        {
202
-                            if (pageData.userList.Count > 0)
203
-                            {
204
-                                if (pageData.userList[pageData.userList.Count - 1].askid != msg.body.asktid)
205
-                                {
206
-                                    pageData.userList.Clear();
207
-                                }
208
-                            }
209
-                        }
210
-                        catch (Exception ex)
211
-                        {
212
-                            LogHelper.WriteErrLog("【抢答】(receiveWsMsg)socket移除askid不一致用户," + ex.Message, ex);
213
-                        }
200
+                        //try
201
+                        //{
202
+                        //    if (pageData.userList.Count > 0)
203
+                        //    {
204
+                        //        if (pageData.userList[pageData.userList.Count - 1].askid != msg.body.asktid)
205
+                        //        {
206
+                        //            pageData.userList.Clear();
207
+                        //        }
208
+                        //    }
209
+                        //}
210
+                        //catch (Exception ex)
211
+                        //{
212
+                        //    LogHelper.WriteErrLog("【抢答】(receiveWsMsg)socket移除askid不一致用户," + ex.Message, ex);
213
+                        //}
214
 
214
 
215
                         //renderView();
215
                         //renderView();
216
                         returnNum++;
216
                         returnNum++;
233
                                 medal = "../Images/RollCall/rollCall_6.png";
233
                                 medal = "../Images/RollCall/rollCall_6.png";
234
                                 attendance = "../Images/RollCall/attendance_33.png";
234
                                 attendance = "../Images/RollCall/attendance_33.png";
235
                             }
235
                             }
236
-                            string userpic = msg.body.userpic;
236
+                            string userpic = msg.b.stpic;
237
                             if (ZCache.headDic.ContainsKey(userpic.Replace("/", "")))
237
                             if (ZCache.headDic.ContainsKey(userpic.Replace("/", "")))
238
                             {
238
                             {
239
                                 userpic = ZCache.headDic[userpic.Replace("/", "")];
239
                                 userpic = ZCache.headDic[userpic.Replace("/", "")];
244
                             }
244
                             }
245
                             pageData.userList.Add(new RollCallPageData()
245
                             pageData.userList.Add(new RollCallPageData()
246
                             {
246
                             {
247
-                                Name = msg.body.username,
247
+                                Name = msg.b.stname,
248
                                 Attendance_33 = "Collapsed",
248
                                 Attendance_33 = "Collapsed",
249
                                 Attendance_3 = "Visible",
249
                                 Attendance_3 = "Visible",
250
                                 Pic = userpic,
250
                                 Pic = userpic,
251
-                                ID = msg.body.userid.ToString(),
251
+                                ID = msg.b.stid.ToString(),
252
                                 Attendance = attendance,
252
                                 Attendance = attendance,
253
                                 Medal = medal,
253
                                 Medal = medal,
254
-                                askid = msg.body.asktid
254
+                              
255
 
255
 
256
                             });
256
                             });
257
                             stpAnswer.Visibility = Visibility.Visible;
257
                             stpAnswer.Visibility = Visibility.Visible;

+ 5
- 3
XHZB.Desktop/ToolbarWindow.xaml.cs View File

611
                 //    {
611
                 //    {
612
                 //        MyApp.ZipFile();
612
                 //        MyApp.ZipFile();
613
                 //    }
613
                 //    }
614
-
614
+                //else
615
+                //{
616
+                EndLive();
617
+                //}
615
                 WSocketClient.getInstance().SendMessage(SocketMsgManger.NolineMsg());
618
                 WSocketClient.getInstance().SendMessage(SocketMsgManger.NolineMsg());
616
                 Dispatcher.Invoke(new Action(() =>
619
                 Dispatcher.Invoke(new Action(() =>
617
                 {
620
                 {
618
                     System.Environment.Exit(0);
621
                     System.Environment.Exit(0);
619
                 }));
622
                 }));
620
-                //}).Start();
621
             }
623
             }
622
             catch (Exception ex)
624
             catch (Exception ex)
623
             {
625
             {
831
                 WSocketClient.getInstance().SendMessage(SocketMsgManger.GetIntoMsg());
833
                 WSocketClient.getInstance().SendMessage(SocketMsgManger.GetIntoMsg());
832
 
834
 
833
 
835
 
834
-                NodeKey = "1";
836
+                NodeKey = "live/1";
835
                 System.Drawing.Size DesktopSize = PrimaryScreen.DESKTOP;
837
                 System.Drawing.Size DesktopSize = PrimaryScreen.DESKTOP;
836
                 //开始直播
838
                 //开始直播
837
                 if(APP.FFmpeg.StartLiveRecordingVideo(APP.RTMPServerPath, NodeKey, DesktopSize,out ErrMessage))
839
                 if(APP.FFmpeg.StartLiveRecordingVideo(APP.RTMPServerPath, NodeKey, DesktopSize,out ErrMessage))

+ 29
- 12
XHZB.Desktop/UserCenterWindow.xaml.cs View File

74
             btnVideo.Foreground = new SolidColorBrush(Colors.Black);
74
             btnVideo.Foreground = new SolidColorBrush(Colors.Black);
75
             btnImage.Foreground = new SolidColorBrush(Colors.Black);
75
             btnImage.Foreground = new SolidColorBrush(Colors.Black);
76
             btnDoc.Foreground = new SolidColorBrush(Colors.Black);
76
             btnDoc.Foreground = new SolidColorBrush(Colors.Black);
77
-            initJiaocai();
77
+            new Thread(o =>
78
+            {
79
+                InvokeTsubjectbookListServering();
80
+                Dispatcher.Invoke(new Action(() =>
81
+                {
82
+                    InvokeServerTsubjectbookListCompate();
83
+                }));
84
+
85
+            }).Start();
86
+        }
87
+        /// <summary>
88
+        /// 教师教材列表服务-调用
89
+        /// </summary>
90
+        /// <returns></returns>
91
+        private object InvokeTsubjectbookListServering()
92
+        {
93
+            serverReturnCode = registerController.TsubjectbookList();
94
+            return APP.ErrorMessage;
78
         }
95
         }
79
         /// <summary>
96
         /// <summary>
80
         /// 教师教材列表服务-返回结果
97
         /// 教师教材列表服务-返回结果
273
                         if ("doc".Equals(APP.ResourceMyList.obj[i].suffix)
290
                         if ("doc".Equals(APP.ResourceMyList.obj[i].suffix)
274
                             || "docx".Equals(APP.ResourceMyList.obj[i].suffix))
291
                             || "docx".Equals(APP.ResourceMyList.obj[i].suffix))
275
                         {
292
                         {
276
-                            imgSuffix = "../Images/Resource/DOC.png";
293
+                            imgSuffix = "./Images/Resource/DOC.png";
277
                         }
294
                         }
278
                         else if ("ppt".Equals(APP.ResourceMyList.obj[i].suffix)
295
                         else if ("ppt".Equals(APP.ResourceMyList.obj[i].suffix)
279
                             || "pptx".Equals(APP.ResourceMyList.obj[i].suffix))
296
                             || "pptx".Equals(APP.ResourceMyList.obj[i].suffix))
280
                         {
297
                         {
281
-                            imgSuffix = "../Images/Resource/PPT.png";
298
+                            imgSuffix = "./Images/Resource/PPT.png";
282
                         }
299
                         }
283
                         else if ("pdf".Equals(APP.ResourceMyList.obj[i].suffix))
300
                         else if ("pdf".Equals(APP.ResourceMyList.obj[i].suffix))
284
                         {
301
                         {
285
-                            imgSuffix = "../Images/Resource/PDF.png";
302
+                            imgSuffix = "./Images/Resource/PDF.png";
286
                         }
303
                         }
287
                         else if ("excel".Equals(APP.ResourceMyList.obj[i].suffix)
304
                         else if ("excel".Equals(APP.ResourceMyList.obj[i].suffix)
288
                             || "xls".Equals(APP.ResourceMyList.obj[i].suffix) || "xlsx".Equals(APP.ResourceMyList.obj[i].suffix))
305
                             || "xls".Equals(APP.ResourceMyList.obj[i].suffix) || "xlsx".Equals(APP.ResourceMyList.obj[i].suffix))
289
                         {
306
                         {
290
-                            imgSuffix = "../Images/Resource/EXCEL.png";
307
+                            imgSuffix = "./Images/Resource/EXCEL.png";
291
                         }
308
                         }
292
                         else if ("class".Equals(APP.ResourceMyList.obj[i].suffix))
309
                         else if ("class".Equals(APP.ResourceMyList.obj[i].suffix))
293
                         {
310
                         {
295
                         }
312
                         }
296
                         else if ("dsc".Equals(APP.ResourceMyList.obj[i].suffix))
313
                         else if ("dsc".Equals(APP.ResourceMyList.obj[i].suffix))
297
                         {
314
                         {
298
-                            imgSuffix = "../Images/Resource/DSC.png";
315
+                            imgSuffix = "./Images/Resource/DSC.png";
299
                         }
316
                         }
300
                         else if ("mp3".Equals(APP.ResourceMyList.obj[i].suffix))
317
                         else if ("mp3".Equals(APP.ResourceMyList.obj[i].suffix))
301
                         {
318
                         {
302
                             visDuration = "Visible";
319
                             visDuration = "Visible";
303
-                            imgSuffix = "../Images/Resource/MP3.png";
320
+                            imgSuffix = "./Images/Resource/MP3.png";
304
                         }
321
                         }
305
                         else if ("mp4".Equals(APP.ResourceMyList.obj[i].suffix)
322
                         else if ("mp4".Equals(APP.ResourceMyList.obj[i].suffix)
306
                             || "flv".Equals(APP.ResourceMyList.obj[i].suffix))
323
                             || "flv".Equals(APP.ResourceMyList.obj[i].suffix))
312
                             }
329
                             }
313
                             else
330
                             else
314
                             {
331
                             {
315
-                                imgSuffix = "../Images/Resource/MP4.png";
332
+                                imgSuffix = "./Images/Resource/MP4.png";
316
                             }
333
                             }
317
                         }
334
                         }
318
                         else if ("png".Equals(APP.ResourceMyList.obj[i].suffix)
335
                         else if ("png".Equals(APP.ResourceMyList.obj[i].suffix)
319
                             || "jpg".Equals(APP.ResourceMyList.obj[i].suffix)
336
                             || "jpg".Equals(APP.ResourceMyList.obj[i].suffix)
320
                             || "jpeg".Equals(APP.ResourceMyList.obj[i].suffix))
337
                             || "jpeg".Equals(APP.ResourceMyList.obj[i].suffix))
321
                         {
338
                         {
322
-                            imgSuffix = "../Images/Resource/PNG.png";
339
+                            imgSuffix = "./Images/Resource/PNG.png";
323
                         }
340
                         }
324
                         else if ("txt".Equals(APP.ResourceMyList.obj[i].suffix))
341
                         else if ("txt".Equals(APP.ResourceMyList.obj[i].suffix))
325
                         {
342
                         {
326
-                            imgSuffix = "../Images/Resource/TXT.png";
343
+                            imgSuffix = "./Images/Resource/TXT.png";
327
                         }
344
                         }
328
                         else if ("txt".Equals(APP.ResourceMyList.obj[i].suffix))
345
                         else if ("txt".Equals(APP.ResourceMyList.obj[i].suffix))
329
                         {
346
                         {
330
-                            imgSuffix = "../Images/Resource/FLV.png";
347
+                            imgSuffix = "./Images/Resource/FLV.png";
331
                         }
348
                         }
332
                         else if ("wav".Equals(APP.ResourceMyList.obj[i].suffix))
349
                         else if ("wav".Equals(APP.ResourceMyList.obj[i].suffix))
333
                         {
350
                         {
334
-                            imgSuffix = "../Images/Resource/WAV.png";
351
+                            imgSuffix = "./Images/Resource/WAV.png";
335
                         }
352
                         }
336
                         string resourcesSuffix = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\" + APP.LoginUser.username + "\\" + APP.ResourceMyList.obj[i].resourcename + "." + APP.ResourceMyList.obj[i].suffix;
353
                         string resourcesSuffix = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\" + APP.LoginUser.username + "\\" + APP.ResourceMyList.obj[i].resourcename + "." + APP.ResourceMyList.obj[i].suffix;
337
                         if (!string.IsNullOrWhiteSpace(APP.fileStorageAddress))
354
                         if (!string.IsNullOrWhiteSpace(APP.fileStorageAddress))

+ 26
- 0
XHZB.Desktop/Utils/RegisterController.cs View File

40
             }
40
             }
41
         }
41
         }
42
         /// <summary>
42
         /// <summary>
43
+        /// 开始直播
44
+        /// </summary>
45
+        /// <param name="request"></param>
46
+        /// <returns></returns>
47
+        public int UpdateState()  
48
+        {
49
+            string url = APP.apiUrl + "/course/update_state";//地址
50
+            Dictionary<string, int> dic = new Dictionary<string, int>
51
+            {
52
+                { "courseid", 1},
53
+                { "loginpwd", 2}
54
+            };
55
+            string body = JsonHelper.ToJson(dic);
56
+            ResultVo<CisectionidModel> result = HttpHelper.PostAndRespSignle<ResultVo<CisectionidModel>>(url, postData: body);
57
+            if (result != null)
58
+            {
59
+                APP.ErrorMessage = result.msg;
60
+                return result.code;
61
+            }
62
+            else
63
+            {
64
+                APP.ErrorMessage = "网络异常!";
65
+                return 1;
66
+            }
67
+        }
68
+        /// <summary>
43
         /// 教师任教班级
69
         /// 教师任教班级
44
         /// </summary>
70
         /// </summary>
45
         /// <param name="request"></param>
71
         /// <param name="request"></param>

+ 1
- 1
XHZB.Desktop/WebSocket/SocketCallback.cs View File

4
 {
4
 {
5
     public interface SocketCallback
5
     public interface SocketCallback
6
     {
6
     {
7
-        void receiveWsMsg(ZWsMsgVo msg);
7
+        void receiveWsMsg(SocketModel msg);
8
         void userListChange();
8
         void userListChange();
9
     }
9
     }
10
 }
10
 }

+ 1
- 0
XHZB.Desktop/WebSocket/SocketClient.cs View File

75
                 WinDic.Add(win.GetType(), win);
75
                 WinDic.Add(win.GetType(), win);
76
             }
76
             }
77
         }
77
         }
78
+     
78
         /// <summary>
79
         /// <summary>
79
         /// 发送给需要接收的窗口
80
         /// 发送给需要接收的窗口
80
         /// </summary>
81
         /// </summary>

+ 60
- 2
XHZB.Desktop/WebSocket/WSocketClient.cs View File

135
                             userpic = msgBean.b.stpic
135
                             userpic = msgBean.b.stpic
136
                         };
136
                         };
137
                         APP.OnlineUserList.Add(item);
137
                         APP.OnlineUserList.Add(item);
138
+                        sendUserChangeToWin();
138
                     }
139
                     }
139
                     else if(msgBean.c == 2002)//下线
140
                     else if(msgBean.c == 2002)//下线
140
                     {
141
                     {
145
                                 if (msgBean.b.stid == APP.OnlineUserList[i].userid)
146
                                 if (msgBean.b.stid == APP.OnlineUserList[i].userid)
146
                                 {
147
                                 {
147
                                     APP.OnlineUserList.RemoveAt(i);
148
                                     APP.OnlineUserList.RemoveAt(i);
149
+                                  
148
                                     break;
150
                                     break;
149
                                 }
151
                                 }
150
                             }
152
                             }
153
                         {
155
                         {
154
                             LogHelper.WriteErrLog("(移除)" + ex.Message, ex);
156
                             LogHelper.WriteErrLog("(移除)" + ex.Message, ex);
155
                         }
157
                         }
158
+                        sendUserChangeToWin();
156
                     }
159
                     }
157
-                  
160
+                    sendMsgToWin(msgBean);
158
                 }
161
                 }
159
             }
162
             }
160
-
163
+        }
164
+        private static void sendMsgToWin(SocketModel msg)
165
+        {
166
+            foreach (KeyValuePair<Type, object> kvp in WinDic)
167
+            {
168
+                if (kvp.Value is SocketCallback callback)
169
+                {
170
+                    callback.receiveWsMsg(msg);
171
+                }
172
+            }
173
+        }
174
+        /// <summary>
175
+        /// 添加要推送消息的窗口
176
+        /// </summary>
177
+        /// <param name="win"></param>
178
+        public void addWin(object win)
179
+        {
180
+            if (WinDic.ContainsKey(win.GetType()))
181
+            {
182
+                WinDic[win.GetType()] = win;
183
+            }
184
+            else
185
+            {
186
+                WinDic.Add(win.GetType(), win);
187
+            }
161
         }
188
         }
189
+        /// <summary>
190
+        /// 发送给需要接收的窗口
191
+        /// </summary>
192
+        private static void sendUserChangeToWin()
193
+        {
194
+            foreach (KeyValuePair<Type, object> kvp in WinDic)
195
+            {
196
+                if (kvp.Value is SocketCallback callback)
197
+                {
198
+                    callback.userListChange();
199
+                }
200
+            }
201
+        }
202
+        /// <summary>
203
+        /// 移除窗口
204
+        /// </summary>
205
+        /// <param name="win"></param>
206
+        public void removedWin(object win)
207
+        {
208
+            if (WinDic.ContainsKey(win.GetType()))
209
+            {
210
+                WinDic.Remove(win.GetType());
211
+            }
212
+        }
213
+
214
+
215
+
216
+
162
         /// <summary>
217
         /// <summary>
163
         /// Socket关闭事件
218
         /// Socket关闭事件
164
         /// </summary>
219
         /// </summary>
184
         /// <param name="e"></param>
239
         /// <param name="e"></param>
185
         void WebSocket_Opened(object sender, EventArgs e)
240
         void WebSocket_Opened(object sender, EventArgs e)
186
         {
241
         {
242
+            SendMessage(SocketMsgManger.AddMsg());
187
             _Logger.Info(" websocket_Opened");
243
             _Logger.Info(" websocket_Opened");
188
 
244
 
245
+
246
+
189
             SendMessage(SocketMsgManger.offlineMsg());
247
             SendMessage(SocketMsgManger.offlineMsg());
190
 
248
 
191
         }
249
         }

+ 17
- 1
XHZB.Desktop/XHZB.Desktop.csproj View File

340
   <ItemGroup>
340
   <ItemGroup>
341
     <Resource Include="Images\RollCall\rollCall_2_1.png" />
341
     <Resource Include="Images\RollCall\rollCall_2_1.png" />
342
   </ItemGroup>
342
   </ItemGroup>
343
-  <ItemGroup />
343
+  <ItemGroup>
344
+    <Resource Include="Images\Resource\CLASS.png" />
345
+    <Resource Include="Images\Resource\DOC.png" />
346
+    <Resource Include="Images\Resource\DSC.png" />
347
+    <Resource Include="Images\Resource\EXCEL.png" />
348
+    <Resource Include="Images\Resource\FLV.png" />
349
+    <Resource Include="Images\Resource\MP3.png" />
350
+    <Resource Include="Images\Resource\MP4.png" />
351
+    <Resource Include="Images\Resource\PDF.png" />
352
+    <Resource Include="Images\Resource\PNG.png" />
353
+    <Resource Include="Images\Resource\PPT.png" />
354
+    <Resource Include="Images\Resource\resource_0.png" />
355
+    <Resource Include="Images\Resource\resource_1.png" />
356
+    <Resource Include="Images\Resource\resource_2.png" />
357
+    <Resource Include="Images\Resource\TXT.png" />
358
+    <Resource Include="Images\Resource\WAV.png" />
359
+  </ItemGroup>
344
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
360
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
345
 </Project>
361
 </Project>

+ 13
- 0
XHZB.Model/CisectionidModel.cs View File

1
+using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
4
+using System.Text;
5
+using System.Threading.Tasks;
6
+
7
+namespace XHZB.Model
8
+{
9
+    public class CisectionidModel
10
+    {
11
+        public int cisectionid { get; set; }
12
+    }
13
+}

+ 1
- 0
XHZB.Model/XHZB.Model.csproj View File

43
   <ItemGroup>
43
   <ItemGroup>
44
     <Compile Include="AddSocketMsgModel.cs" />
44
     <Compile Include="AddSocketMsgModel.cs" />
45
     <Compile Include="BodyModel.cs" />
45
     <Compile Include="BodyModel.cs" />
46
+    <Compile Include="CisectionidModel.cs" />
46
     <Compile Include="Class1.cs" />
47
     <Compile Include="Class1.cs" />
47
     <Compile Include="ClassListModel.cs" />
48
     <Compile Include="ClassListModel.cs" />
48
     <Compile Include="ClassStudentListModel.cs" />
49
     <Compile Include="ClassStudentListModel.cs" />

Loading…
Cancel
Save