프로젝트

일반

사용자정보

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

markus / KCOM / MainWindow.xaml.cs.bak @ b3c2d962

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

1
using KCOM.Common;
2
using KCOMDataModel.DataModel;
3
using System;
4
using System.Collections.Generic;
5
using System.Linq;
6
using System.Text;
7
using System.Windows;
8
using System.Windows.Controls;
9
using System.Windows.Data;
10
using System.Windows.Documents;
11
using System.Windows.Input;
12
using System.Windows.Media;
13
using System.Windows.Media.Imaging;
14
using System.Windows.Navigation;
15
using System.Windows.Shapes;
16

    
17
namespace KCOM
18
{
19
    /// <summary>
20
    /// MainWindow.xaml에 대한 상호 작용 논리
21
    /// </summary>
22
    public partial class MainWindow : Window
23
    {
24
        
25
        public MainWindow()
26
        {
27
            InitializeComponent();
28
            this.Loaded += MainWindow_Loaded;
29
            this.KeyDown += new KeyEventHandler(KeyEventDownAction);
30
            this.KeyUp += new KeyEventHandler(KeyEventUpAction);
31
        }
32
        public void DialogMessage_Alert(string content, string header)
33
        {
34
            var box = new TextBlock();
35
            box.MinWidth = 400;
36
            box.FontSize = 12;
37
            box.Text = content;
38
            box.TextWrapping = System.Windows.TextWrapping.Wrap;
39

    
40
            Telerik.Windows.Controls.DialogParameters parameters = new Telerik.Windows.Controls.DialogParameters()
41
            {
42
                Content = box,
43
                Header = header,
44
                Theme = new Telerik.Windows.Controls.VisualStudio2013Theme(),
45
                ModalBackground = new SolidColorBrush { Color = Colors.Black, Opacity = 0.6 },
46
            };
47
            Telerik.Windows.Controls.RadWindow.Alert(parameters);
48
        }
49

    
50
        public void test()
51
        {
52
            using (KCOMDataModel.DataModel.CIEntities Entity = new KCOMDataModel.DataModel.CIEntities(KCOMDataModel.Common.ConnectStringBuilder.ProjectCIConnectString("000000").ToString()))
53
            {
54
                string key = "NXVjTcWcku8d54537cb3ed95a";
55

    
56
                MARKUP_INFO instance = Entity.MARKUP_INFO.Where(root => root.ID == key).FirstOrDefault();
57

    
58
                if (instance == null)
59
                {
60
                    return;
61
                }
62
                MARKUP_INFO_VERSION version = instance.MARKUP_INFO_VERSION.FirstOrDefault();
63

    
64

    
65
                version.MARKUP_DATA.ToList().ForEach(data =>
66
                {
67
                    Entity.MARKUP_DATA.DeleteObject(data);
68
                    Entity.SaveChanges();
69
                });
70

    
71
                Entity.MARKUP_INFO_VERSION.DeleteObject(version);
72
                Entity.SaveChanges();
73

    
74
                Entity.MARKUP_INFO.DeleteObject(instance);
75
                Entity.SaveChanges();
76

    
77
            }
78
        }
79
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
80
        {
81

    
82
            test();
83

    
84

    
85
            //this.InitilizeSystem();
86
            //if (this.Check_DocConvert("000000", "11111111"))
87
            //{   
88
            //    var docItem = this.Check_DocItem("000000", "11111111");
89
            //    var docInfo = this.Check_DocInfo("000000", "11111111");
90

    
91
            //    CurrentDoc = new DocumentSet
92
            //    {
93
            //        docInfo = docInfo,
94
            //        Document_Id = docItem.DOCUMENT_ID,
95
            //        Document_Name = docItem.DOCUMENT_NAME,
96
            //        Document_NO = docItem.DOCUMENT_NO,
97
            //        File_Original = docItem.ORIGINAL_FILE,
98
            //        File_Result = docItem.RESULT_FILE,
99
            //        Group_No = docItem.GROUP_NO,
100
            //        ProjectNo = docItem.PROJECT_NO,
101
            //        Revision = docItem.REVISION,
102
            //    };
103

    
104
            //    var MainUrl = DeepZoomUrl.Replace("{baseUrl}", App.SystemInfo.HostName);
105
            //    MainUrl = MainUrl.Replace("{TileSourcePath}", "000000");
106
            //    MainUrl = MainUrl.Replace("{ItemsPath}", (Convert.ToInt64("11111111") / 100).ToString());
107
            //    MainUrl = MainUrl.Replace("{SharepointItemID}", "11111111");
108
            //    MainUrl = MainUrl.Replace(@"http://http://", @"http://");
109

    
110
            //    this.dzMainMenu.pageNavigator2.SetPageNavi(CurrentDoc.docInfo.DOCPAGE.ToList(), MainUrl);
111
            //    //this.dzMainMenu.pageNavigator.ItemsSource = CurrentDoc.docInfo.DOCPAGE.ToList();
112
            //}
113

    
114
            App.ViewInfo = new IKCOM.ViewInfo
115
            {
116
                DocumentItemID = "11111111",
117
                bPartner = false,
118
                CreateFinalPDFPermission = true,
119
                NewCommentPermission = true,
120
                ProjectNO = "000000",
121
                UserID = "tester",
122
            };
123

    
124
            this.dzMainMenu.ServiceOn();
125
            this.dzMainMenu.SetView(App.ViewInfo);
126

    
127
        }
128
        private void WindowDragEvent(object sender, MouseButtonEventArgs e)
129
        {
130
            if (e.ClickCount >= 2)
131
            {
132
                switch (this.WindowState)
133
                {
134
                    case WindowState.Normal:
135
                        this.WindowState = WindowState.Maximized;
136
                        break;
137
                    case WindowState.Minimized:
138
                        break;
139
                    case WindowState.Maximized:
140
                        this.WindowState = WindowState.Normal;
141
                        break;
142
                    default:
143
                        break;
144
                }
145
            }
146
            else
147
            {
148
                this.DragMove();
149
            }
150
        }
151

    
152
        //  RasterSupport.SetLicense(
153
        //    @"C:\LEADTOOLS 19\Common\License\LEADTOOLS.LIC",
154
        //    File.ReadAllText(@"C:\LEADTOOLS 19\Common\License\LEADTOOLS.LIC.KEY")
155
        //);
156

    
157
        //  codec = new RasterCodecs();
158
        //  string filePath = @"F:\Dummy\demo.cmp";
159
        //  //BitmapImage bitmap = new BitmapImage();
160
        //  //bitmap.BeginInit();
161
        //  //bitmap.UriSource = new Uri(filePath);
162
        //  //bitmap.EndInit();
163

    
164
        //  //viewer.Source = bitmap;
165
        //  //viewer.ScrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Hidden;
166
        //  //viewer.ScrollViewer.VerticalScrollBarVisibility = ScrollBarVisibility.Hidden;
167
        //  //viewer.ScrollViewer.Visibility = Visibility.Hidden;
168
        //  viewer.Image = codec.Load(filePath, 0, CodecsLoadByteOrder.RgbOrGray, 1, 1);
169
        //  viewer.SizeMode = Leadtools.Windows.Controls.SizeMode.FitAlways;
170
    }
171
}
클립보드 이미지 추가 (최대 크기: 500 MB)