Browse Source

优化

tags/录制修改前
zhangxueyang 4 years ago
parent
commit
d78f122a61

+ 13
- 6
Common/system/BlackboardNew.cs View File

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

+ 34
- 14
XHWK.WKTool/LoginWindow.xaml.cs View File

1
 using Common.system;
1
 using Common.system;
2
 using System;
2
 using System;
3
 using System.Configuration;
3
 using System.Configuration;
4
+using System.IO;
4
 using System.Text;
5
 using System.Text;
5
 using System.Windows;
6
 using System.Windows;
6
 using XHWK.WKTool.DAL;
7
 using XHWK.WKTool.DAL;
23
         }
24
         }
24
         public void Initialize() 
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
         /// <summary>
43
         /// <summary>
33
         /// 关闭事件
44
         /// 关闭事件
76
             {
87
             {
77
                 FileToolsCommon.CreateDirectory(APP.DataPath);
88
                 FileToolsCommon.CreateDirectory(APP.DataPath);
78
                 string applicationData = APP.DataPath + "accountNumber.txt";
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
                 APP.IsLoginType = true;
104
                 APP.IsLoginType = true;
85
                 txbAccountNumber.Text = string.Empty;
105
                 txbAccountNumber.Text = string.Empty;
86
                 pobPassword.Password = string.Empty;
106
                 pobPassword.Password = string.Empty;
122
         /// <param name="e"></param>
142
         /// <param name="e"></param>
123
         private void CkSaveName_Click(object sender, RoutedEventArgs e)
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
         /// <summary>
154
         /// <summary>
135
         /// 读取客户设置
155
         /// 读取客户设置

+ 1
- 11
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs View File

1379
                 Login();
1379
                 Login();
1380
                 return;
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
             try
1382
             try
1393
             {
1383
             {
1394
                 iTextSharp.text.Document document = new iTextSharp.text.Document(iTextSharp.text.PageSize.A4, 25, 25, 25, 25);
1384
                 iTextSharp.text.Document document = new iTextSharp.text.Document(iTextSharp.text.PageSize.A4, 25, 25, 25, 25);
1438
             if (APP.W_PrintWindow == null)
1428
             if (APP.W_PrintWindow == null)
1439
             {
1429
             {
1440
                 APP.W_PrintWindow = new PrintWindow();
1430
                 APP.W_PrintWindow = new PrintWindow();
1441
-                APP.W_PrintWindow.Topmost = true;
1431
+                //APP.W_PrintWindow.Topmost = true;
1442
                 APP.W_PrintWindow.Owner = this;
1432
                 APP.W_PrintWindow.Owner = this;
1443
             }
1433
             }
1444
             if (APP.PageDrawList.Count > 0 && !string.IsNullOrWhiteSpace(APP.PageDrawList[0].PdfImagePath))
1434
             if (APP.PageDrawList.Count > 0 && !string.IsNullOrWhiteSpace(APP.PageDrawList[0].PdfImagePath))

Loading…
Cancel
Save