|
@@ -38,35 +38,12 @@ namespace XHWK.WKTool
|
38
|
38
|
/// 微课视频列表
|
39
|
39
|
/// </summary>
|
40
|
40
|
public static List<Model_Video> VideoList = null;
|
41
|
|
- /// <summary>
|
42
|
|
- /// 主页面
|
43
|
|
- /// </summary>
|
44
|
|
- public static XHMicroLessonSystemWindow W_XHMicroLessonSystemWindow = null;
|
|
41
|
+ public static List<Model_DrawData> PageDrawList = null;
|
45
|
42
|
/// <summary>
|
46
|
43
|
/// 录屏工具
|
47
|
44
|
/// </summary>
|
48
|
45
|
public static FFMpeg FFmpeg = new FFMpeg();
|
49
|
46
|
/// <summary>
|
50
|
|
- /// 开始录像
|
51
|
|
- /// </summary>
|
52
|
|
- public static CountdownWindow W_CountdownWindow = null;
|
53
|
|
- /// <summary>
|
54
|
|
- /// 录像工具栏
|
55
|
|
- /// </summary>
|
56
|
|
- public static ScreenRecordingToolbarWindow W_ScreenRecordingToolbarWindow = null;
|
57
|
|
- /// <summary>
|
58
|
|
- /// 登陆
|
59
|
|
- /// </summary>
|
60
|
|
- public static LoginWindow W_LoginWindow = null;
|
61
|
|
- /// <summary>
|
62
|
|
- /// 截图
|
63
|
|
- /// </summary>
|
64
|
|
- public static JieTuWindow W_JieTuWindow = null;
|
65
|
|
- /// <summary>
|
66
|
|
- /// 批注
|
67
|
|
- /// </summary>
|
68
|
|
- public static PracticeWindow W_PracticeWindow = null;
|
69
|
|
- /// <summary>
|
70
|
47
|
/// 登陆状态 false 未登录 true已登陆
|
71
|
48
|
/// </summary>
|
72
|
49
|
public static bool IsLoginType = false;
|
|
@@ -87,8 +64,8 @@ namespace XHWK.WKTool
|
87
|
64
|
/// <summary>
|
88
|
65
|
/// 页码IP
|
89
|
66
|
/// </summary>
|
90
|
|
- public static string[] OutPut = new string[] { };
|
91
|
|
-
|
|
67
|
+ public static string[] OutPut = new string[] { };
|
|
68
|
+ #region 点阵笔
|
92
|
69
|
/// <summary>
|
93
|
70
|
/// 点阵笔
|
94
|
71
|
/// </summary>
|
|
@@ -102,6 +79,37 @@ namespace XHWK.WKTool
|
102
|
79
|
/// </summary>
|
103
|
80
|
public static bool PenStatus;
|
104
|
81
|
#endregion
|
|
82
|
+ #region 页面
|
|
83
|
+ /// <summary>
|
|
84
|
+ /// 主页面
|
|
85
|
+ /// </summary>
|
|
86
|
+ public static XHMicroLessonSystemWindow W_XHMicroLessonSystemWindow = null;
|
|
87
|
+ /// <summary>
|
|
88
|
+ /// 创建微课页面
|
|
89
|
+ /// </summary>
|
|
90
|
+ public static CreateAMicroLessonWindow W_CreateAMicroLessonWindow = null;
|
|
91
|
+ /// <summary>
|
|
92
|
+ /// 开始录像
|
|
93
|
+ /// </summary>
|
|
94
|
+ public static CountdownWindow W_CountdownWindow = null;
|
|
95
|
+ /// <summary>
|
|
96
|
+ /// 录像工具栏
|
|
97
|
+ /// </summary>
|
|
98
|
+ public static ScreenRecordingToolbarWindow W_ScreenRecordingToolbarWindow = null;
|
|
99
|
+ /// <summary>
|
|
100
|
+ /// 登陆
|
|
101
|
+ /// </summary>
|
|
102
|
+ public static LoginWindow W_LoginWindow = null;
|
|
103
|
+ /// <summary>
|
|
104
|
+ /// 截图
|
|
105
|
+ /// </summary>
|
|
106
|
+ public static JieTuWindow W_JieTuWindow = null;
|
|
107
|
+ /// <summary>
|
|
108
|
+ /// 批注
|
|
109
|
+ /// </summary>
|
|
110
|
+ public static PracticeWindow W_PracticeWindow = null;
|
|
111
|
+ #endregion
|
|
112
|
+ #endregion
|
105
|
113
|
|
106
|
114
|
[STAThread]
|
107
|
115
|
private static void Main()
|
|
@@ -113,10 +121,11 @@ namespace XHWK.WKTool
|
113
|
121
|
WKData = new Model_WKData();
|
114
|
122
|
VideoList = new List<Model_Video>();
|
115
|
123
|
//app.DispatcherUnhandledException += MyApp_DispatcherUnhandledException;
|
116
|
|
- CreateAMicroLessonWindow win = new CreateAMicroLessonWindow();
|
117
|
|
- app.Run(win);
|
|
124
|
+ W_CreateAMicroLessonWindow = new CreateAMicroLessonWindow();
|
|
125
|
+ app.Run(W_CreateAMicroLessonWindow);
|
118
|
126
|
//LogHelper.WriteInfoLog("启动项目");
|
119
|
127
|
StopSameProcess();
|
|
128
|
+ Killffmpeg();
|
120
|
129
|
LatticeFileHelper.RunPrintConfig();
|
121
|
130
|
}
|
122
|
131
|
/// <summary>
|
|
@@ -156,63 +165,132 @@ namespace XHWK.WKTool
|
156
|
165
|
e.Handled = true;
|
157
|
166
|
}
|
158
|
167
|
|
|
168
|
+ #region 数据保存和读取
|
159
|
169
|
/// <summary>
|
160
|
170
|
/// 保存微课信息
|
161
|
171
|
/// </summary>
|
162
|
172
|
public static void SaveWkData()
|
163
|
173
|
{
|
164
|
|
- if(UserInfo == null)
|
|
174
|
+ try
|
165
|
175
|
{
|
166
|
|
- return;
|
|
176
|
+ if (UserInfo == null)
|
|
177
|
+ {
|
|
178
|
+ return;
|
|
179
|
+ }
|
|
180
|
+ if (!string.IsNullOrWhiteSpace(APP.UserInfo.Username))
|
|
181
|
+ {
|
|
182
|
+ WKData.VideoList = VideoList;
|
|
183
|
+ if (WKDataList != null)
|
|
184
|
+ {
|
|
185
|
+ WKDataList.RemoveAll(x => x.WkName == WKData.WkName);
|
|
186
|
+ }
|
|
187
|
+ else
|
|
188
|
+ {
|
|
189
|
+ WKDataList = new List<Model_WKData>();
|
|
190
|
+ }
|
|
191
|
+ WKDataList.Add(WKData);
|
|
192
|
+ //string WkDateXmlStr = XmlUtilHelper.Serializer(typeof(Model_WKData), WKData);
|
|
193
|
+ string WkDateXmlStr = XmlUtilHelper.XmlSerialize(WKDataList);
|
|
194
|
+ string SavePath = FileToolsCommon.GetFileAbsolutePath("/Data/" + APP.UserInfo.Username + "/");
|
|
195
|
+ FileToolsCommon.CreateDirectory(SavePath);
|
|
196
|
+ string SaveName = SavePath + "UserWkDate.d";
|
|
197
|
+ FileToolsCommon.DeleteFile(SaveName);
|
|
198
|
+ FileToolsCommon.WriteText(SaveName, WkDateXmlStr);
|
|
199
|
+ }
|
167
|
200
|
}
|
168
|
|
- if (!string.IsNullOrWhiteSpace(APP.UserInfo.Username))
|
|
201
|
+ catch (Exception ex)
|
169
|
202
|
{
|
170
|
|
- WKData.VideoList = VideoList;
|
171
|
|
- if (WKDataList != null)
|
|
203
|
+ LogHelper.WriteErrLog("【微课数据保存】(SaveWkData)保存失败:" + ex.Message, ex);
|
|
204
|
+ }
|
|
205
|
+ }
|
|
206
|
+ /// <summary>
|
|
207
|
+ /// 读取微课信息
|
|
208
|
+ /// </summary>
|
|
209
|
+ public static void ReadWkData()
|
|
210
|
+ {
|
|
211
|
+ try
|
|
212
|
+ {
|
|
213
|
+ if (UserInfo == null)
|
172
|
214
|
{
|
173
|
|
- WKDataList.RemoveAll(x => x.WkName == WKData.WkName);
|
|
215
|
+ return;
|
174
|
216
|
}
|
175
|
|
- else
|
|
217
|
+ if (!string.IsNullOrWhiteSpace(APP.UserInfo.Username))
|
176
|
218
|
{
|
177
|
|
- WKDataList = new List<Model_WKData>();
|
|
219
|
+ string SavePath = FileToolsCommon.GetFileAbsolutePath("/Data/" + APP.UserInfo.Username + "/");
|
|
220
|
+ FileToolsCommon.CreateDirectory(SavePath);
|
|
221
|
+ string SaveName = SavePath + "UserWkDate.d";
|
|
222
|
+ //文件若存在则读取
|
|
223
|
+ if (FileToolsCommon.IsExistFile(SaveName))
|
|
224
|
+ {
|
|
225
|
+ string WkDateXmlStr = FileToolsCommon.FileToString(SaveName);
|
|
226
|
+ WKDataList = XmlUtilHelper.DESerializer<List<Model_WKData>>(WkDateXmlStr);
|
|
227
|
+ }
|
178
|
228
|
}
|
179
|
|
- WKDataList.Add(WKData);
|
180
|
|
- //string WkDateXmlStr = XmlUtilHelper.Serializer(typeof(Model_WKData), WKData);
|
181
|
|
- string WkDateXmlStr = XmlUtilHelper.XmlSerialize(WKDataList);
|
182
|
|
- string SavePath = FileToolsCommon.GetFileAbsolutePath("/Data/" + APP.UserInfo.Username + "/");
|
183
|
|
- FileToolsCommon.CreateDirectory(SavePath);
|
184
|
|
- string SaveName = SavePath + "UserWkDate.d";
|
185
|
|
- FileToolsCommon.DeleteFile(SaveName);
|
186
|
|
- FileToolsCommon.WriteText(SaveName, WkDateXmlStr);
|
|
229
|
+ }
|
|
230
|
+ catch (Exception ex)
|
|
231
|
+ {
|
|
232
|
+ LogHelper.WriteErrLog("【微课数据读取】(ReadWkData)读取失败:" + ex.Message, ex);
|
187
|
233
|
}
|
188
|
234
|
}
|
189
|
|
-
|
190
|
235
|
/// <summary>
|
191
|
|
- /// 读取微课信息
|
|
236
|
+ /// 保存画板数据
|
192
|
237
|
/// </summary>
|
193
|
|
- public static void ReadWkData()
|
|
238
|
+ public static void SaveDraw()
|
194
|
239
|
{
|
195
|
|
- if (UserInfo == null)
|
|
240
|
+ try
|
196
|
241
|
{
|
197
|
|
- return;
|
|
242
|
+ if (PageDrawList == null)
|
|
243
|
+ {
|
|
244
|
+ return;
|
|
245
|
+ }
|
|
246
|
+ if (PageDrawList.Count < 1)
|
|
247
|
+ {
|
|
248
|
+ return;
|
|
249
|
+ }
|
|
250
|
+ FileToolsCommon.CreateDirectory(WKData.WkPath);
|
|
251
|
+ string SavePath = WKData.WkPath + "PageData.d";
|
|
252
|
+ FileToolsCommon.DeleteFile(SavePath);
|
|
253
|
+ string PageDataXmlStr = XmlUtilHelper.XmlSerialize(PageDrawList);
|
|
254
|
+ FileToolsCommon.WriteText(SavePath, PageDataXmlStr);
|
198
|
255
|
}
|
199
|
|
- if (!string.IsNullOrWhiteSpace(APP.UserInfo.Username))
|
|
256
|
+ catch (Exception ex)
|
200
|
257
|
{
|
201
|
|
- string SavePath = FileToolsCommon.GetFileAbsolutePath("/Data/" + APP.UserInfo.Username + "/");
|
202
|
|
- FileToolsCommon.CreateDirectory(SavePath);
|
203
|
|
- string SaveName = SavePath + "UserWkDate.d";
|
204
|
|
- if (FileToolsCommon.IsExistFile(SaveName))
|
|
258
|
+ LogHelper.WriteErrLog("【画板数据保存】(SaveDraw)保存失败:" + ex.Message, ex);
|
|
259
|
+ }
|
|
260
|
+ }
|
|
261
|
+ /// <summary>
|
|
262
|
+ /// 读取文件
|
|
263
|
+ /// </summary>
|
|
264
|
+ public static void ReadDrawData()
|
|
265
|
+ {
|
|
266
|
+ try
|
|
267
|
+ {
|
|
268
|
+ PageDrawList = new List<Model_DrawData>();
|
|
269
|
+ FileToolsCommon.CreateDirectory(WKData.WkPath);
|
|
270
|
+ string SavePath = WKData.WkPath + "PageData.d";
|
|
271
|
+ if (FileToolsCommon.IsExistFile(SavePath))
|
205
|
272
|
{
|
206
|
|
- string WkDateXmlStr=FileToolsCommon.FileToString(SaveName);
|
207
|
|
- WKDataList = XmlUtilHelper.DESerializer<List<Model_WKData>>(WkDateXmlStr);
|
208
|
|
- if (WKDataList != null)
|
209
|
|
- {
|
210
|
|
- WKDataList.RemoveAll(x => x.WkName == WKData.WkName);
|
211
|
|
- }
|
|
273
|
+ string PageDataXmlStr = FileToolsCommon.FileToString(SavePath);
|
|
274
|
+ PageDrawList = XmlUtilHelper.DESerializer<List<Model_DrawData>>(PageDataXmlStr);
|
212
|
275
|
}
|
213
|
276
|
}
|
|
277
|
+ catch (Exception ex)
|
|
278
|
+ {
|
|
279
|
+ LogHelper.WriteErrLog("【画板数据读取】(ReadDraw)读取失败:" + ex.Message, ex);
|
|
280
|
+ }
|
|
281
|
+ }
|
|
282
|
+ #endregion
|
|
283
|
+ /// <summary>
|
|
284
|
+ /// 杀死正在运行的ffmpeg
|
|
285
|
+ /// </summary>
|
|
286
|
+ public static void Killffmpeg()
|
|
287
|
+ {
|
|
288
|
+ Process[] KillProcessArray = Process.GetProcessesByName("ffmpeg");
|
|
289
|
+ foreach (var KillProcess in KillProcessArray)
|
|
290
|
+ {
|
|
291
|
+ KillProcess.Kill();
|
|
292
|
+ }
|
214
|
293
|
}
|
215
|
|
-
|
216
|
294
|
#region 内存处理 -创建人:赵耀 -创建时间:2020年8月12日
|
217
|
295
|
|
218
|
296
|
/// <summary>
|