프로젝트

일반

사용자정보

통계
| 브랜치(Branch): | 개정판:

markus / ConvertService / ServiceBase / ConnectionStringBuild / MainWindow.xaml.cs @ d91efe5c

이력 | 보기 | 이력해설 | 다운로드 (2.15 KB)

1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
6
using System.Windows;
7
using System.Windows.Controls;
8
using System.Windows.Data;
9
using System.Windows.Documents;
10
using System.Windows.Input;
11
using System.Windows.Media;
12
using System.Windows.Media.Imaging;
13
using System.Windows.Navigation;
14
using System.Windows.Shapes;
15
using Markus.Service;
16
using Markus.Service.Extensions;
17
using Markus.Service.Helper;
18
using static Markus.Service.Extensions.Encrypt;
19

    
20
namespace ConnectionStringBuild
21
{
22
    /// <summary>
23
    /// MainWindow.xaml에 대한 상호 작용 논리
24
    /// </summary>
25
    public partial class MainWindow : Window
26
    {
27
        public MainWindow()
28
        {
29
            InitializeComponent();
30
        }
31

    
32
        private void Button_Click(object sender, RoutedEventArgs e)
33
        {
34
            if(!string.IsNullOrWhiteSpace(txtDecrypt.Text) && string.IsNullOrWhiteSpace(txtEncrypt.Text))
35
            {
36
                txtEncrypt.Text = Encrypt.AESEncrypter.Encrypt(txtDecrypt.Text);
37
            }
38
            else if (string.IsNullOrWhiteSpace(txtDecrypt.Text) && !string.IsNullOrWhiteSpace(txtEncrypt.Text))
39
            {
40
                txtDecrypt.Text = Encrypt.AESEncrypter.Decrypt(txtEncrypt.Text);
41
            }
42

    
43
        }
44

    
45
        private void ButtonTest_Click(object sender, RoutedEventArgs e)
46
        {
47
            try
48
            {
49
                using (Markus.Service.DataBase.ConvertDatabase database = new Markus.Service.DataBase.ConvertDatabase(txtDecrypt.Text))
50
                {
51
                    var result = database.GetWaitConvertItems(new List<string>(),30).ToList();
52

    
53
                    txtLog.Text += "Test Ok" + result.Count().ToString();
54
                }
55
            }
56
            catch (Exception ex)
57
            {
58
                txtLog.Text += ex.ToString();
59
            }
60
        }
61

    
62
        private void ButtonTest2_Click(object sender, RoutedEventArgs e)
63
        {
64
           var  convetContext = ObjectToBytesStringConvert.BytesStringToObject<ProcessContext>(AESEncrypter.Decrypt(txtEncrypt.Text));
65
            System.Diagnostics.Debug.WriteLine(convetContext.OriginFilePath);
66
        }
67
    }
68
}
클립보드 이미지 추가 (최대 크기: 500 MB)