瀏覽代碼

优化

tags/录制修改前
zhangxueyang 4 年之前
父節點
當前提交
d78f122a61
共有 3 個文件被更改,包括 48 次插入31 次删除
  1. 13
    6
      Common/system/BlackboardNew.cs
  2. 34
    14
      XHWK.WKTool/LoginWindow.xaml.cs
  3. 1
    11
      XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs

+ 13
- 6
Common/system/BlackboardNew.cs 查看文件

@@ -332,14 +332,14 @@ namespace Common.system
332 332
         StylusPointCollection stylusPoints = new StylusPointCollection();
333 333
         StylusPoint stylusPoint = new StylusPoint();
334 334
         Stroke stroke;
335
-        //bool isFirst = true;
335
+        bool isFirst = true;
336 336
         //public void changepages(double _x, double _y, bool _new, Color _color, int _size)
337 337
         //{
338 338
         //    if (_new)
339 339
         //    {
340 340
         //        if (stroke != null && stroke.StylusPoints.Count > 1)
341 341
         //        {
342
-        //             drawingAttributes = new DrawingAttributes();
342
+        //            drawingAttributes = new DrawingAttributes();
343 343
         //            //m_canvas.DefaultDrawingAttributes = drawingAttributes;
344 344
         //            drawingAttributes.Color = _color;
345 345
         //            drawingAttributes.Width = _size;
@@ -358,12 +358,12 @@ namespace Common.system
358 358
         //    }
359 359
         //    else
360 360
         //    {
361
-        //        if(isFirst)
361
+        //        if (isFirst)
362 362
         //        {
363 363
         //            stylusPoint.X = _x;
364 364
         //            stylusPoint.Y = _y;
365 365
         //            stylusPoints.Add(stylusPoint);
366
-        //            if (stylusPoints.Count>1)
366
+        //            if (stylusPoints.Count > 1)
367 367
         //            {
368 368
         //                stroke = new Stroke(stylusPoints);
369 369
         //                m_canvas.Strokes.Add(stroke);
@@ -372,6 +372,7 @@ namespace Common.system
372 372
         //        }
373 373
         //        else
374 374
         //        {
375
+        //            if(m_canvas.Strokes.Count)
375 376
         //            stylusPoint.X = _x;
376 377
         //            stylusPoint.Y = _y;
377 378
         //            stylusPoints.Add(stylusPoint);
@@ -405,8 +406,8 @@ namespace Common.system
405 406
                     drawingAttributes = new DrawingAttributes();
406 407
                     //m_canvas.DefaultDrawingAttributes = drawingAttributes;
407 408
                     drawingAttributes.Color = _color;
408
-                    drawingAttributes.Width = _size*5;
409
-                    drawingAttributes.Height = _size*5;
409
+                    drawingAttributes.Width = _size * 5;
410
+                    drawingAttributes.Height = _size * 5;
410 411
                     drawingAttributes.FitToCurve = true;
411 412
                     drawingAttributes.IgnorePressure = false;
412 413
 
@@ -430,6 +431,12 @@ namespace Common.system
430 431
                 stroke = new Stroke(stylusPoints);
431 432
             }
432 433
         }
434
+
435
+
436
+
437
+
438
+
439
+
433 440
         ////声明一个 DrawingAttributes 类型的变量  
434 441
         //DrawingAttributes drawingAttributes;
435 442
         //public void changepaget(double _x, double _y, bool _new,InkCanvas canvas) 

+ 34
- 14
XHWK.WKTool/LoginWindow.xaml.cs 查看文件

@@ -1,6 +1,7 @@
1 1
 using Common.system;
2 2
 using System;
3 3
 using System.Configuration;
4
+using System.IO;
4 5
 using System.Text;
5 6
 using System.Windows;
6 7
 using XHWK.WKTool.DAL;
@@ -23,11 +24,21 @@ namespace XHWK.WKTool
23 24
         }
24 25
         public void Initialize() 
25 26
         {
26
-            if (GetSettingString("isRemind").Equals("True"))
27
+
28
+            if (FileToolsCommon.IsExistFile(APP.DataPath + "accountNumber.txt"))
27 29
             {
28
-                ckSaveName.IsChecked = true;
29
-                txbAccountNumber.Text = GetSettingString("userName");
30
+                string accountNumber = System.IO.File.ReadAllText(APP.DataPath + "accountNumber.txt", Encoding.Default);
31
+                if(!string.IsNullOrWhiteSpace(accountNumber))
32
+                {
33
+                    txbAccountNumber.Text = accountNumber;
34
+                    ckSaveName.IsChecked = true;
35
+                }
30 36
             }
37
+            //if (GetSettingString("isRemind").Equals("True"))
38
+            //{
39
+            //    ckSaveName.IsChecked = true;
40
+            //    txbAccountNumber.Text = GetSettingString("userName");
41
+            //}
31 42
         }
32 43
         /// <summary>
33 44
         /// 关闭事件
@@ -76,11 +87,20 @@ namespace XHWK.WKTool
76 87
             {
77 88
                 FileToolsCommon.CreateDirectory(APP.DataPath);
78 89
                 string applicationData = APP.DataPath + "accountNumber.txt";
79
-                string accountNumbers = DateTime.Now.ToLongDateString().ToString();//当前时间 
80
-                System.IO.File.WriteAllText(applicationData, accountNumbers, Encoding.Default);//存放签名验证日期
90
+                if (ckSaveName.IsChecked==true)
91
+                {
92
+                    
93
+                    string accountNumbers = txbAccountNumber.Text;
94
+                    System.IO.File.WriteAllText(applicationData, accountNumbers, Encoding.Default);//存放账号
95
+                }
96
+                else
97
+                {
98
+                    string accountNumbers = "";
99
+                    System.IO.File.WriteAllText(applicationData, accountNumbers, Encoding.Default);//存放账号
100
+                }
81 101
 
82 102
 
83
-                UpdateSettingString("userName", txbAccountNumber.Text);
103
+                //UpdateSettingString("userName", txbAccountNumber.Text);
84 104
                 APP.IsLoginType = true;
85 105
                 txbAccountNumber.Text = string.Empty;
86 106
                 pobPassword.Password = string.Empty;
@@ -122,14 +142,14 @@ namespace XHWK.WKTool
122 142
         /// <param name="e"></param>
123 143
         private void CkSaveName_Click(object sender, RoutedEventArgs e)
124 144
         {
125
-            if (ckSaveName.IsChecked == false)
126
-            {
127
-                UpdateSettingString("isRemind", ckSaveName.IsChecked.ToString());
128
-            }
129
-            else
130
-            {
131
-                UpdateSettingString("isRemind", ckSaveName.IsChecked.ToString());
132
-            }
145
+            //if (ckSaveName.IsChecked == false)
146
+            //{
147
+            //    UpdateSettingString("isRemind", ckSaveName.IsChecked.ToString());
148
+            //}
149
+            //else
150
+            //{
151
+            //    UpdateSettingString("isRemind", ckSaveName.IsChecked.ToString());
152
+            //}
133 153
         }
134 154
         /// <summary>
135 155
         /// 读取客户设置

+ 1
- 11
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs 查看文件

@@ -1379,16 +1379,6 @@ namespace XHWK.WKTool
1379 1379
                 Login();
1380 1380
                 return;
1381 1381
             }
1382
-
1383
-            //for(int i=0;i< APP.pageData.pagenum; i++)
1384
-            //{
1385
-
1386
-            //}
1387
-
1388
-
1389
-
1390
-            ////string[] files = { @"C:\101\1.jpg", @"C:\101\2.jpg" };
1391
-
1392 1382
             try
1393 1383
             {
1394 1384
                 iTextSharp.text.Document document = new iTextSharp.text.Document(iTextSharp.text.PageSize.A4, 25, 25, 25, 25);
@@ -1438,7 +1428,7 @@ namespace XHWK.WKTool
1438 1428
             if (APP.W_PrintWindow == null)
1439 1429
             {
1440 1430
                 APP.W_PrintWindow = new PrintWindow();
1441
-                APP.W_PrintWindow.Topmost = true;
1431
+                //APP.W_PrintWindow.Topmost = true;
1442 1432
                 APP.W_PrintWindow.Owner = this;
1443 1433
             }
1444 1434
             if (APP.PageDrawList.Count > 0 && !string.IsNullOrWhiteSpace(APP.PageDrawList[0].PdfImagePath))

Loading…
取消
儲存