프로젝트

일반

사용자정보

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

markus / KCOM / Controls / Symbol.xaml.cs @ 6472f348

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

1 787a4489 KangIngu
using KCOM.Common;
2
using KCOM.Events;
3 5ce56a3a KangIngu
using KCOMDataModel.Common;
4
using KCOMDataModel.DataModel;
5 34c8d43a ljiyeon
using MarkupToPDF.Common;
6 787a4489 KangIngu
using System;
7
using System.Collections.Generic;
8
using System.Linq;
9
using System.Text;
10
using System.Windows;
11
using System.Windows.Controls;
12
using System.Windows.Data;
13
using System.Windows.Documents;
14
using System.Windows.Input;
15
using System.Windows.Media;
16
using System.Windows.Media.Imaging;
17
using System.Windows.Navigation;
18
using System.Windows.Shapes;
19
using Telerik.Windows.Controls;
20 5ce56a3a KangIngu
using Telerik.Windows.Controls.DragDrop;
21 787a4489 KangIngu
22
namespace KCOM.Controls
23
{
24
    public class Symbol_Custom
25
    {
26 5ce56a3a KangIngu
        public string ID { get; set; }
27 787a4489 KangIngu
        public string Name { get; set; }
28
        public string ImageUri { get; set; }
29
    }
30
31
    /// <summary>
32
    /// Symbol.xaml에 대한 상호 작용 논리
33
    /// </summary>
34
    public partial class Symbol : UserControl
35
    {
36
        AdornerFinal finalItem;
37 5ce56a3a KangIngu
        bool IsMouseDown = false;
38
        string moveItem_id = "";
39 787a4489 KangIngu
        public string filename { get; set; }
40
        MarkupToPDF.Controls.Parsing.LayerControl layer = new MarkupToPDF.Controls.Parsing.LayerControl();
41
42
        public Symbol()
43
        {
44
            InitializeComponent();
45 089566c0 humkyung
            
46
            RadDragAndDropManager.AddDragInfoHandler(lstSymbolPrivate, OnDragPrivateInfo);
47
            RadDragAndDropManager.AddDragQueryHandler(lstSymbolPrivate, OnDragPrivateQuery);
48
            RadDragAndDropManager.SetAllowDrag(lstSymbolPrivate, true);
49 787a4489 KangIngu
50
            DataBind();
51
        }
52
53 5ce56a3a KangIngu
        private void OnDragPrivateInfo(object sender, DragDropEventArgs e)
54
        {
55
        }
56
57
        private void OnDragPrivateQuery(object sender, DragDropQueryEventArgs e)
58
        {
59
            if (e.Options.Status == DragStatus.DragQuery)
60
            {
61
                //var draggedListBoxItem = (e.Options.Source as System.Windows.Controls.ListBox).SelectedItem;
62
                //BitmapImage im = new BitmapImage(new Uri((draggedListBoxItem as DeepView.ServiceDeepView_Symbol.SymbolPrivate).ImageUri));
63
                //ImageSource _source = im;
64
                //Image img = new Image();
65
                //img.Source = _source;
66
67
                //e.Options.Payload = im;
68
                //var dragCue = new Image();
69
                //dragCue.Source = img.Source;
70
                //dragCue.Width = 0;
71
                //dragCue.Height = 0;
72
                //e.Options.DragCue = dragCue;
73
74
75
                //PayLoadAdorner = new AdornerFinal();
76
                //DeepView.ServiceDeepView_Symbol.SymbolPrivate tempDragableControl = (e.Options.Source as System.Windows.Controls.ListBox).SelectedItem as DeepView.ServiceDeepView_Symbol.SymbolPrivate;
77
                //var xamldata = tempDragableControl.Data;
78
                ////this.DeepLayer.markupParse(xamldata, this.DeepLayer._TempLayer, "복사된 데이터_이름으로 수정해야함");
79
                //PayLoadAdorner = this.DeepLayer.markupParseToAdorner(xamldata, this.DeepLayer._SelectLayer, "");
80
                //this.DeepLayer._SelectLayer.Children.Add(PayLoadAdorner);
81
            }
82
83
            e.QueryResult = true;
84
            e.Handled = true;
85
        }
86
87 787a4489 KangIngu
        private void DataBind()
88
        {
89 5ce56a3a KangIngu
            //lstSymbolPrivate.ItemsSource = null;
90
            //lstSymbolPublic.ItemsSource = null;
91 787a4489 KangIngu
92
            Symbol_Custom Custom = new Symbol_Custom();
93
            List<Symbol_Custom> Custom_List = new List<Symbol_Custom>();
94 6c781c0c djkim
            ServiceDeepView.ServiceDeepViewClient client = new ServiceDeepView.ServiceDeepViewClient(App._binding, App._EndPoint);
95
            var symbol_Private = client.GetSymbolList(App.ViewInfo.UserID);
96
            foreach (var item in symbol_Private)
97 5ce56a3a KangIngu
            {
98 6c781c0c djkim
                Custom.Name = item.NAME;
99
                Custom.ImageUri = item.IMAGE_URL;
100
                Custom.ID = item.ID;
101
                Custom_List.Add(Custom);
102 5ce56a3a KangIngu
                Custom = new Symbol_Custom();
103 6c781c0c djkim
            }
104
            lstSymbolPrivate.ItemsSource = Custom_List;
105 5ce56a3a KangIngu
106 6c781c0c djkim
            Custom = new Symbol_Custom();
107
            Custom_List = new List<Symbol_Custom>();
108 5ce56a3a KangIngu
109 6c781c0c djkim
            deptlist.ItemsSource = client.GetPublicSymbolDeptList();
110 5ce56a3a KangIngu
111 6c781c0c djkim
            List<SYMBOL_PUBLIC> symbol_Public;
112 5ce56a3a KangIngu
113 6c781c0c djkim
            
114
            if (deptlist.SelectedValue != null)
115
            {
116
                symbol_Public = client.GetPublicSymbolList(deptlist.SelectedValue.ToString());
117
            }
118
            else
119
            {
120
                symbol_Public = client.GetPublicSymbolList(null);
121 5ce56a3a KangIngu
            }
122 6c781c0c djkim
            foreach (var item in symbol_Public)
123
            {
124
                Custom.Name = item.NAME;
125
                Custom.ImageUri = item.IMAGE_URL;
126
                Custom.ID = item.ID;
127
                Custom_List.Add(Custom);
128
                Custom = new Symbol_Custom();
129
            }
130
            lstSymbolPublic.ItemsSource = Custom_List;
131
            client.Close();
132 5ce56a3a KangIngu
        }
133
134
        public PngBitmapEncoder symImage(string data)
135
        {
136
137
            Canvas _canvas = new Canvas();
138
            _canvas.Background = Brushes.White;
139
            _canvas.Width = finalItem.BorderSize.Width;
140
            _canvas.Height = finalItem.BorderSize.Height;
141
            layer.markupParse(data, _canvas, "#FFFF0000", "");
142
143
            BitmapEncoder encoder = new PngBitmapEncoder();
144
145
146
            RenderTargetBitmap renderBitmap = new RenderTargetBitmap((int)_canvas.Width + 50, (int)_canvas.Height + 50, 96d, 96d, PixelFormats.Pbgra32);
147
148
            DrawingVisual dv = new DrawingVisual();
149
150
            _canvas.Measure(new System.Windows.Size(finalItem.BorderSize.Width + 50, finalItem.BorderSize.Height + 50));
151
            //_canvas.Arrange(new Rect(new System.Windows.Point { X = -finalItem.BorderSize.X - 50, Y = -finalItem.BorderSize.Y - 50 }, new Point(finalItem.BorderSize.Width + 20, finalItem.BorderSize.Height + 20)));
152
            _canvas.Arrange(new Rect(new System.Windows.Point { X = -finalItem.BorderSize.X - 20, Y = -finalItem.BorderSize.Y - 20 }, new Point(finalItem.BorderSize.Width + 20, finalItem.BorderSize.Height + 20)));
153
154
            using (DrawingContext ctx = dv.RenderOpen())
155
            {
156
                VisualBrush vb = new VisualBrush(_canvas);
157
                //ctx.DrawRectangle(vb, null, new Rect(new System.Windows.Point { X = -finalItem.BorderSize.X - 20, Y = -finalItem.BorderSize.Y - 20 }, new Point(finalItem.BorderSize.Width + 20, finalItem.BorderSize.Height + 20)));
158
                ctx.DrawRectangle(vb, null, new Rect(new System.Windows.Point { X = -finalItem.BorderSize.X, Y = -finalItem.BorderSize.Y }, new Point(finalItem.BorderSize.Width + 20, finalItem.BorderSize.Height + 20)));
159
            }
160
161
            try
162
            {
163
                renderBitmap.Render(dv);
164
165
                GC.Collect();
166
                GC.WaitForPendingFinalizers();
167
                GC.Collect();
168
                //bitmap.Render(controlToConvert);
169
                // encode png data
170
                PngBitmapEncoder pngEncoder = new PngBitmapEncoder();
171
                // puch rendered bitmap into it
172
                pngEncoder.Interlace = PngInterlaceOption.Off;
173
                pngEncoder.Frames.Add(BitmapFrame.Create(renderBitmap));
174
                return pngEncoder;
175
176
            }
177
            catch (Exception ex)
178
            {
179
                return null;
180
            }
181 787a4489 KangIngu
182
        }
183
184 5ce56a3a KangIngu
        public void DialogMessage_Alert(string content, string header)
185
        {
186
            var box = new TextBlock();
187
            box.MinWidth = 400;
188
            box.FontSize = 11;
189
            //box.FontSize = 12;
190
            box.Text = content;
191
            box.TextWrapping = System.Windows.TextWrapping.Wrap;
192
193
            DialogParameters parameters = new DialogParameters()
194
            {
195 b9b01f8e ljiyeon
                Owner = Application.Current.MainWindow,
196 5ce56a3a KangIngu
                Content = box,
197
                Header = header,
198
                Theme = new VisualStudio2013Theme(),
199
                ModalBackground = new SolidColorBrush { Color = Colors.Black, Opacity = 0.6 },
200
            };
201
            RadWindow.Alert(parameters);
202
        }
203
204
        #region Event
205
206 498f0fc9 ljiyeon
        #region Private Symbol Add Event
207 787a4489 KangIngu
        private void Create_Symbol(object sender, RoutedEventArgs e)
208
        {
209
            MarkupToPDF.Controls.Parsing.LayerControl.MarkupReturn markupReturn = new MarkupToPDF.Controls.Parsing.LayerControl.MarkupReturn();
210
211
            if (Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Count < 1) //선택된 것이 없으면
212
            {
213
                DialogMessage_Alert("Please Select Controls", "Alert");
214
            }
215
            else //선택된 것이 있으면
216
            {
217
                string MarkupData = "";
218
                finalItem = new AdornerFinal();
219
220
                foreach (var item in Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children)
221
                {
222
                    if (item.GetType().Name == "AdornerFinal")
223
                    {
224
                        finalItem = (item as Controls.AdornerFinal);
225
                        foreach (var InnerItem in (item as Controls.AdornerFinal).MemberSet.Cast<Controls.AdornerMember>())
226
                        {
227
                            if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData))
228
                            {
229
                                markupReturn = layer.MarkupToString(InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo, App.ViewInfo.UserID);
230
                                MarkupData += markupReturn.ConvertData;
231
                            }
232
                        }
233
                    }
234
                }
235
                DialogParameters parameters = new DialogParameters()
236
                {
237 b9b01f8e ljiyeon
                    Owner = Application.Current.MainWindow,
238 498f0fc9 ljiyeon
                    Closed = (obj, args) => this.MarkupNamePromptClose(MarkupData, args), 
239 787a4489 KangIngu
                    DefaultPromptResultValue = "Custom State",
240
                    Content = "Name :",
241
                    Header = "Insert Custom Symbol Name",
242
                    Theme = new VisualStudio2013Theme(),
243
                    ModalBackground = new SolidColorBrush { Color = Colors.Black, Opacity = 0.6 },
244
                };
245
                RadWindow.Prompt(parameters);
246
            }
247
248
        }
249 5ce56a3a KangIngu
        #endregion
250 787a4489 KangIngu
251 5ce56a3a KangIngu
        #region Symbol Add Close Event 
252 787a4489 KangIngu
        private void MarkupNamePromptClose(string data, WindowClosedEventArgs args)
253
        {
254
            Save save = new Save();
255
256
            if (args.DialogResult.Value)
257
            {
258
                PngBitmapEncoder _Encoder = symImage(data);
259
260
                System.IO.MemoryStream fs = new System.IO.MemoryStream();
261
                _Encoder.Save(fs);
262
                System.Drawing.Image ImgOut = System.Drawing.Image.FromStream(fs);
263
264
                byte[] Img_byte = fs.ToArray();
265
266
                kr.co.devdoftech.cloud.FileUpload fileUploader = new kr.co.devdoftech.cloud.FileUpload();
267
                filename = fileUploader.Run(App.ViewInfo.ProjectNO, Common.ViewerDataModel.Instance.SystemMain.dzMainMenu._DocItem.DOCUMENT_NO, App.ViewInfo.UserID, Save.shortGuid() + ".png", Img_byte);
268 498f0fc9 ljiyeon
                
269
                if(RadTab.SelectedIndex == 0)
270
                {
271
                    save.SymbolSave(args.PromptResult, filename, data);
272
                }
273
                else
274
                {
275
                    save.SymbolSave_Public(args.PromptResult, filename, data, Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.userData.DEPARTMENT);
276
                }                
277 5ce56a3a KangIngu
278
                DataBind();
279 787a4489 KangIngu
            }
280
        }
281 5ce56a3a KangIngu
        #endregion
282 787a4489 KangIngu
283 498f0fc9 ljiyeon
        #region Private Symbol Delete Event
284 5ce56a3a KangIngu
        private void Remove_Symbol(object sender, RoutedEventArgs e)
285 787a4489 KangIngu
        {
286 5ce56a3a KangIngu
            if (lstSymbolPrivate.SelectedItem == null)
287
            {
288
                DialogMessage_Alert("Please Select Symbol", "Alert");
289
                return;
290
            }
291 6c781c0c djkim
            string delItem_ID = (lstSymbolPrivate.SelectedItem as Symbol_Custom).ID;
292 0f065e57 ljiyeon
293
            Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.DeleteSymbolCompleted += BaseClient_DeleteSymbolCompleted;           
294
            Logger.sendReqLog("DeleteSymbolAsync: ", delItem_ID, 1);
295 498f0fc9 ljiyeon
            Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.DeleteSymbolAsync(delItem_ID, RadTab.SelectedIndex);            
296
        }
297
        #endregion
298
        #region Public Symbol Delete Event
299
        private void Remove_Symbol_Public(object sender, RoutedEventArgs e)
300
        {
301
            if (lstSymbolPublic.SelectedItem == null)
302
            {
303
                DialogMessage_Alert("Please Select Symbol", "Alert");
304
                return;
305
            }
306
            string delItem_ID = (lstSymbolPublic.SelectedItem as Symbol_Custom).ID;
307
308
            Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.DeleteSymbolCompleted += BaseClient_DeleteSymbolCompleted;
309
            Logger.sendReqLog("DeleteSymbolAsync: ", delItem_ID, 1);
310
            Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.DeleteSymbolAsync(delItem_ID, RadTab.SelectedIndex);
311 6c781c0c djkim
        }
312 787a4489 KangIngu
313 6c781c0c djkim
        private void BaseClient_DeleteSymbolCompleted(object sender, ServiceDeepView.DeleteSymbolCompletedEventArgs e)
314
        {
315 0f065e57 ljiyeon
            Logger.sendResLog("DeleteSymbolCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1);
316 6c781c0c djkim
            DataBind();
317 5ce56a3a KangIngu
        }
318
        #endregion
319 787a4489 KangIngu
320 34c8d43a ljiyeon
        public Undo_data UndoData { get; set; }
321 702abd98 humkyung
        /// <summary>
322
        /// place symbol which has given id to original position which is created
323
        /// </summary>
324
        /// <date>2018.06.14</date>
325
        /// <param name="id"></param>
326
        private void PlaceSymbol(string id)
327 5ce56a3a KangIngu
        {
328 702abd98 humkyung
            string Data_ = "";
329 787a4489 KangIngu
330 702abd98 humkyung
            try
331 5ce56a3a KangIngu
            {
332 0f065e57 ljiyeon
                Logger.sendReqLog("GetSymbolData: ", id + "," + RadTab.SelectedIndex, 1);
333 6c781c0c djkim
                Data_ = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetSymbolData(id, RadTab.SelectedIndex);
334 0f065e57 ljiyeon
                if (Data_ != null || Data_ != "")
335
                {
336
                    Logger.sendResLog("GetSymbolData", "TRUE", 1);
337
                }
338
                else
339
                {
340
                    Logger.sendResLog("GetSymbolData", "FALSE", 1);
341
                }
342 787a4489 KangIngu
343 5ce56a3a KangIngu
                if (Data_.Contains("|DZ|"))
344
                {
345
                    List<MarkupToPDF.Common.CommentUserInfo> adornerSet = new List<MarkupToPDF.Common.CommentUserInfo>();
346
347
                    string[] delimiterChars = { "|DZ|" };
348
                    string[] data = Data_.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
349
350 34c8d43a ljiyeon
                    Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
351
                    UndoData = new Undo_data()
352
                    {
353
                        IsUndo = false,
354
                        Event = Event_Type.Create,
355
                        EventTime = DateTime.Now,
356
                        Markup_List = new List<Multi_Undo_data>()
357
                    };
358
                    ViewerDataModel.Instance.UndoDataList.Where(data1 => data1.IsUndo == true).ToList().ForEach(i =>
359
                    {
360
                        ViewerDataModel.Instance.UndoDataList.Remove(i);
361
                    });
362
363
                    foreach (string parse in data)
364 5ce56a3a KangIngu
                    {
365
                        if (parse != "")
366
                        {
367
                            System.Windows.Controls.Control item = layer.markupParse_Paste(parse, ViewerDataModel.Instance.MarkupControls_USER);
368
                            (item as MarkupToPDF.Common.CommentUserInfo).CommentID = Events.Save.shortGuid();
369 c8e9b3e4 ljiyeon
                            (item as MarkupToPDF.Common.CommentUserInfo).SymbolID = id;
370 5ce56a3a KangIngu
                            ViewerDataModel.Instance.MarkupControls.Remove(item as MarkupToPDF.Common.CommentUserInfo);
371
                            ViewerDataModel.Instance.MarkupControls_USER.Remove(item as MarkupToPDF.Common.CommentUserInfo);
372 c8e9b3e4 ljiyeon
                            
373 5ce56a3a KangIngu
                            adornerSet.Add(item as MarkupToPDF.Common.CommentUserInfo);
374 34c8d43a ljiyeon
375
                            multi_Undo_Data = this.ParentOfType<MainWindow>().dzMainMenu.Control_Style(item as MarkupToPDF.Common.CommentUserInfo);
376
377
                            UndoData.Markup_List.Add(multi_Undo_Data);
378
                            ViewerDataModel.Instance.UndoDataList.Add(UndoData);
379 5ce56a3a KangIngu
                        }
380
                    }
381
                    Controls.AdornerFinal final = new Controls.AdornerFinal(adornerSet);
382
383
                    ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Add(final);
384
                }
385
            }
386 702abd98 humkyung
            catch(Exception ex)
387
            {
388
                this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert(ex.Message,  "Error");
389
            }
390
        }
391
392
        #region Symbol DoubleClick Event
393
        private void Move_Symbol(object sender, MouseButtonEventArgs e)
394
        {
395 16d13764 djkim
            try
396 702abd98 humkyung
            {
397 16d13764 djkim
                Type type = e.OriginalSource.GetType();
398
                string id = string.Empty;
399 be31927d djkim
                Logger.sendResLog("Move_Symbol", type.Name, 0);
400 16d13764 djkim
                if (type.Name == "Image")
401
                {
402
                    id = ((e.OriginalSource as Image).DataContext as Symbol_Custom).ID;
403
                }
404
                else if (type.Name == "Border")
405
                {
406
                    id = ((e.OriginalSource as Border).DataContext as Symbol_Custom).ID;
407
                }
408 be31927d djkim
                else if (type.Name == "TextBlock")
409
                {
410
                    id = ((e.OriginalSource as TextBlock).DataContext as Symbol_Custom).ID;
411
                }
412 16d13764 djkim
413
                IsMouseDown = true;
414
                if (e.ClickCount > 1)
415
                {
416
                    this.PlaceSymbol(id);
417
                }
418 702abd98 humkyung
            }
419 16d13764 djkim
            catch(Exception ex)
420
            {
421
                Logger.sendResLog("Move_Symbol", ex.Message, 0);
422
            }            
423 5ce56a3a KangIngu
        }
424
        #endregion
425
426 498f0fc9 ljiyeon
        #region Private Symbol Rename Event
427 5ce56a3a KangIngu
        private void Rename_Symbol(object sender, RoutedEventArgs e)
428
        {
429
            if (lstSymbolPrivate.SelectedItem == null)
430 787a4489 KangIngu
            {
431 5ce56a3a KangIngu
                DialogMessage_Alert("Please Select Symbol", "Alert");
432
                return;
433 787a4489 KangIngu
            }
434
435 5ce56a3a KangIngu
            DialogParameters parameters = new DialogParameters()
436 787a4489 KangIngu
            {
437 b9b01f8e ljiyeon
                Owner = Application.Current.MainWindow,
438 5ce56a3a KangIngu
                Closed = (obj, args) => this.MarkupReNamePromptClose("", args),
439
                //DefaultPromptResultValue = "Custom State",
440
                DefaultPromptResultValue = (lstSymbolPrivate.SelectedItem as Symbol_Custom).Name,
441
                Content = "Name :",
442
                Header = "Update Custom Symbol Name",
443
                Theme = new VisualStudio2013Theme(),
444
                ModalBackground = new SolidColorBrush { Color = Colors.Black, Opacity = 0.6 },
445
            };
446
            RadWindow.Prompt(parameters);
447 787a4489 KangIngu
448 5ce56a3a KangIngu
        }
449
        #endregion
450 787a4489 KangIngu
451 498f0fc9 ljiyeon
        #region Public Symbol Rename Event
452
        private void Rename_Symbol_Public(object sender, RoutedEventArgs e)
453
        {
454
            if (lstSymbolPublic.SelectedItem == null)
455
            {
456
                DialogMessage_Alert("Please Select Symbol", "Alert");
457
                return;
458
            }
459
460
            DialogParameters parameters = new DialogParameters()
461
            {
462 b9b01f8e ljiyeon
                Owner = Application.Current.MainWindow,
463 498f0fc9 ljiyeon
                Closed = (obj, args) => this.MarkupReNamePromptClose("", args),
464
                //DefaultPromptResultValue = "Custom State",
465
                DefaultPromptResultValue = (lstSymbolPublic.SelectedItem as Symbol_Custom).Name,
466
                Content = "Name :",
467
                Header = "Update Custom Symbol Name",
468
                Theme = new VisualStudio2013Theme(),
469
                ModalBackground = new SolidColorBrush { Color = Colors.Black, Opacity = 0.6 },
470
            };
471
            RadWindow.Prompt(parameters);
472
473
        }
474
        #endregion
475 5ce56a3a KangIngu
        #region Symbol Rename Close Event
476
        private void MarkupReNamePromptClose(string data, WindowClosedEventArgs args)
477
        {
478
            if (args.DialogResult != null && args.DialogResult.Value)
479
            {
480 498f0fc9 ljiyeon
                if(RadTab.SelectedIndex == 0)
481
                {
482
                    string _id = (lstSymbolPrivate.SelectedItem as Symbol_Custom).ID;
483
                    string _name = args.PromptResult;
484
                    Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.RenameSymbolCompleted += BaseClient_RenameSymbolCompleted;
485
                    Logger.sendReqLog("RenameSymbolAsync: ", _id + "," + _name, 1);
486
                    Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.RenameSymbolAsync(_id, _name, RadTab.SelectedIndex);
487
                }
488
                else
489
                {
490
                    string _id = (lstSymbolPublic.SelectedItem as Symbol_Custom).ID;
491
                    string _name = args.PromptResult;
492
                    Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.RenameSymbolCompleted += BaseClient_RenameSymbolCompleted;
493
                    Logger.sendReqLog("RenameSymbolAsync: ", _id + "," + _name, 1);
494
                    Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.RenameSymbolAsync(_id, _name, RadTab.SelectedIndex);
495
                }                        
496 787a4489 KangIngu
            }
497 5ce56a3a KangIngu
        }
498 6c781c0c djkim
499
        private void BaseClient_RenameSymbolCompleted(object sender, ServiceDeepView.RenameSymbolCompletedEventArgs e)
500
        {
501 0f065e57 ljiyeon
            Logger.sendResLog("RenameSymbolCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1);
502 6c781c0c djkim
            DataBind();
503
        }
504 5ce56a3a KangIngu
        #endregion
505
506
        #region Wheel Event
507
        private void lstSymbolPrivate_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
508
        {
509
            ScView.ScrollToVerticalOffset(ScView.ContentVerticalOffset - (e.Delta / 2));
510
        }
511
        private void lstSymbolPublic_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
512
        {
513
            ScView_Public.ScrollToVerticalOffset(ScView_Public.ContentVerticalOffset - (e.Delta / 2));
514
        }
515
        #endregion
516
517
        #region Tab Selection Event
518
        private void RadTabControl_PreviewSelectionChanged(object sender, RadSelectionChangedEventArgs e)
519
        {
520
            foreach (var item in (e.OriginalSource as RadTabControl).Items)
521 787a4489 KangIngu
            {
522 5ce56a3a KangIngu
                (item as RadTabItem).FontWeight = FontWeights.Normal;
523 787a4489 KangIngu
            }
524 5ce56a3a KangIngu
            ((e.OriginalSource as RadTabControl).SelectedItem as RadTabItem).FontWeight = FontWeights.Bold;
525
        }
526
        #endregion
527 787a4489 KangIngu
528 5ce56a3a KangIngu
        #region Department Selection Event
529
        private void deptlist_SelectionChanged(object sender, SelectionChangedEventArgs e)
530
        {
531
            DataBind();
532 787a4489 KangIngu
        }
533 5ce56a3a KangIngu
        #endregion
534 787a4489 KangIngu
535 5ce56a3a KangIngu
        #endregion
536 787a4489 KangIngu
537 5ce56a3a KangIngu
        private void lstSymbolPrivate_PreviewMouseUp(object sender, MouseButtonEventArgs e)
538
        {
539
540
        }
541
542
        private void lstSymbolPrivate_MouseLeave(object sender, MouseEventArgs e)
543
        {
544
545
        }
546
547
        private void lstSymbolPrivate_MouseDown(object sender, MouseButtonEventArgs e)
548 787a4489 KangIngu
        {
549
550
        }
551
552 5ce56a3a KangIngu
        private void StackPanel_MouseLeave(object sender, MouseEventArgs e)
553 787a4489 KangIngu
        {
554 5ce56a3a KangIngu
            if(IsMouseDown && e.LeftButton == MouseButtonState.Pressed)
555
            {
556
                ViewerDataModel.Instance.SystemMain.dzMainMenu.Symbol_ID = moveItem_id;
557
            }
558
            else
559
            {
560
                IsMouseDown = false;
561
            }
562
        }
563 787a4489 KangIngu
564 5ce56a3a KangIngu
        private void StackPanel_MouseUp(object sender, MouseButtonEventArgs e)
565
        {
566
            IsMouseDown = false;
567 787a4489 KangIngu
        }
568 702abd98 humkyung
569
        /// <summary>
570
        /// place symbol which user select
571
        /// </summary>
572
        /// <author>humkyung</author>
573
        /// <date>2018.06.14</date>
574
        /// <param name="sender"></param>
575
        /// <param name="e"></param>
576
        private void Place_Symbol(object sender, RoutedEventArgs e)
577
        {
578
            if (lstSymbolPrivate.SelectedItem == null)
579
            {
580
                DialogMessage_Alert("Please Select Symbol",  "Alert");
581
                return;
582
            }
583
584
            string id = (lstSymbolPrivate.SelectedItem as Symbol_Custom).ID;
585
            this.PlaceSymbol(id);
586
        }
587 ffcc8124 ljiyeon
588
        private void Place_Symbol_Public(object sender, RoutedEventArgs e)
589
        {
590
            if (lstSymbolPublic.SelectedItem == null)
591
            {
592
                DialogMessage_Alert("Please Select Symbol", "Alert");
593
                return;
594
            }
595
596
            string id = (lstSymbolPublic.SelectedItem as Symbol_Custom).ID;
597
            this.PlaceSymbol(id);
598
        }
599 787a4489 KangIngu
    }
600
}
클립보드 이미지 추가 (최대 크기: 500 MB)