프로젝트

일반

사용자정보

개정판 fd19a116

IDfd19a1166b3c545ba5b10a9dbf1d7cfd64cfaaab
상위 284ed1c7
하위 e024b149

백흠경이(가) 3달 전에 추가함

Fix: Conslidate할때 Z정렬이 유지되지 않는 오류 수정

Change-Id: I54e1878e0365f94ede14e366e6e769fe9fd4b4ec

차이점 보기:

KCOM/Common/ViewerDataModel.cs
95 95
            return MarkupTokenSource.Token;
96 96
        }
97 97

  
98

  
99
        private static DateTime KeyInputTime = DateTime.Now;
100
        private static TimeSpan KeyInputDelay = new TimeSpan(0, 0, 1);
101

  
102
        public bool IsFastKeyInput()
103
        {
104
            if(DateTime.Now - KeyInputTime < KeyInputDelay)
105
            {
106
                return true;
107
            }
108
            else
109
            {
110
                KeyInputTime = DateTime.Now;
111
                return false;
112
            }
113
        }
114

  
115 98
        #region Data Members
116 99

  
117 100
        private static ViewerDataModel instance = new ViewerDataModel();
KCOM/Controls/Sample.xaml.cs
331 331
                */
332 332

  
333 333
                #region 페이지 전환시 저장(성능 저하 초래)
334
                await ViewerDataModel.Instance.SystemMain.dzTopMenu._SaveEvent(null, null);   /// save controls
334
                await ViewerDataModel.Instance.SystemMain.dzTopMenu.SaveEventAsync(null, null);   /// save controls
335 335
                #endregion
336 336

  
337 337
                this.CurrentPage = ImgListbox.SelectedItem as KCOM.Common.ThumbnailItem;
KCOM/Events/Event_KeyEvent.cs
164 164
                    {
165 165
                        if (ViewerDataModel.Instance.IsPressCtrl && (App.ViewInfo.CreateFinalPDFPermission || App.ViewInfo.NewCommentPermission))
166 166
                        {
167
                            var text_item_ = ViewerDataModel.Instance.MarkupControls_USER.Where(data => (data as TextControl) != null && (data as TextControl).IsEditingMode == true).FirstOrDefault();
167
                            var text_item_ = ViewerDataModel.Instance.MarkupControls_USER.FirstOrDefault(data => data is TextControl && (data as TextControl).IsEditingMode);
168 168
                            if (text_item_ != null)
169 169
                            {
170 170
                                (text_item_ as TextControl).Base_TextBlock.Visibility = Visibility.Visible;
......
174 174
                                SelectionSet.Instance.UnSelect(ViewerDataModel.Instance.SystemMain.dzMainMenu);
175 175
                            }
176 176

  
177
                            var Arrowtext_item_ = ViewerDataModel.Instance.MarkupControls_USER.Where(data => (data as ArrowTextControl) != null && (data as ArrowTextControl).IsEditingMode == true).FirstOrDefault();
177
                            var Arrowtext_item_ = ViewerDataModel.Instance.MarkupControls_USER.FirstOrDefault(data => data is ArrowTextControl && (data as ArrowTextControl).IsEditingMode);
178 178
                            if (Arrowtext_item_ != null && ((Arrowtext_item_ as ArrowTextControl).IsNew == false))
179 179
                            {
180 180
                                (Arrowtext_item_ as ArrowTextControl).IsEditingMode = false;
......
191 191

  
192 192
                            this.dzMainMenu.currentControl = null;
193 193

  
194
                            //this.dzTopMenu.SaveEvent(null, null);
195 194
                            if (App.ViewInfo.CreateFinalPDFPermission || App.ViewInfo.NewCommentPermission)
196 195
                            {
197 196
                                ViewerDataModel.Instance.IsMarkupUpdate = true;
198 197
                                this.dzTopMenu.SaveEventCallback(new object(), null);
199 198
                            }
200

  
201
                            //저장완료후 임시파일 삭제
202
                            //TempFile.Remove();
203 199
                        }
204 200
                    }
205 201
                    break;
......
478 474
                case Key.Add:
479 475
                    foreach (var item in SelectionSet.Instance.SelectedItems)
480 476
                    {
481
                        if (item.ZIndex < 99)
477
                        if (item.ZIndex < CommentUserInfo.MaxZIndex)
482 478
                        {
483 479
                            item.ZIndex++;
484 480
                            Canvas.SetZIndex(item, item.ZIndex);
KCOM/Events/Implementation/TopMenuEvent.cs
36 36
{
37 37
    public partial class TopMenu : UserControl
38 38
    {
39
        public int rotateOffSet = 0;
40
        private double[] rotateValue = { 0, 90, 180, 270 };
41 39
        public System.Windows.Threading.DispatcherTimer SaveTimer { get; set; }
42 40
        public bool isClosed = true;
43 41

  
......
69 67
            Error,
70 68
        }
71 69

  
72
        /// <summary>
73
        ///  comment의 속성 변경시 저장여부 확인 하도록 undocommand에 추가
74
        /// </summary>
75
        /// <param name="adnoerFinal"></param>
76
        public void ChangeComment(Controls.AdornerFinal adnoerFinal)
77
        {
78
            var adornerMembers = adnoerFinal.Members.Cast<Controls.AdornerMember>();
79

  
80
            if (adornerMembers.Count() > 0)
81
            {
82
                //UndoCommand.Instance.Push(adornerMembers.Select(x => x.DrawingData).Cast<CommentUserInfo>().ToList(), adnoerFinal.AngleValue);
83
                UndoCommand.Instance.Push(EventType.Operation, adornerMembers.Select(x => x.DrawingData).Cast<CommentUserInfo>().ToList());
84
            }
85
        }
86

  
87 70
        //강인구 추가(Undo End)
88 71
        private void SetPaintEvent()
89 72
        {
......
273 256
        /// </summary>
274 257
        /// <param name="sender"></param>
275 258
        /// <param name="e"></param>
276
        public  void SaveEventCallback(object sender, RoutedEventArgs e)
259
        public async void SaveEventCallback(object sender, RoutedEventArgs e)
277 260
        {
278 261
            var mianMenu = this.ParentOfType<MainWindow>().dzMainMenu;
279 262

  
280
            if (mianMenu.busyIndicator.IsBusy == true)
263
            if (mianMenu.busyIndicator.IsBusy)
281 264
            {
282 265
                return;
283 266
            }
......
286 269
            //{
287 270
                this.ParentOfType<MainWindow>().dzMainMenu.busyIndicator.IsBusy = true;
288 271

  
289
                _SaveEvent(sender, e);
272
                await SaveEventAsync(sender, e);
290 273

  
291 274
                mianMenu.busyIndicator.IsBusy = false;
292 275
               
......
307 290
        ///  - unselect and update my markup list
308 291
        /// <param name="sender"></param>
309 292
        /// <param name="e"></param>
310
        public async Task<bool> _SaveEvent(object sender, RoutedEventArgs e)
293
        public async Task<bool> SaveEventAsync(object sender, RoutedEventArgs e)
311 294
        {
312 295
            bool result = false;
313 296

  
......
372 355
            return result;
373 356
        }
374 357

  
375
        public async Task<bool>  SaveEventAsync()
376
        {
377
            bool result = false;
378

  
379
            var mainMenu = this.ParentOfType<MainWindow>().dzMainMenu;
380
            try
381
            {
382
                mainMenu.ConvertInkControlToPolygon();
383

  
384
                // update mylist and gridview
385
                mainMenu.UpdateMyMarkupList();
386

  
387
                if (mainMenu.gridViewMarkup.SelectedItems.Count == 0 && mainMenu.gridViewMarkup.Items.Count > 0)
388
                {
389
                    this.ParentOfType<MainWindow>().DialogMessage_Alert("Please Select Your Comment List Item", "Alert");
390
                }
391
                else
392
                {
393
                    foreach (var item in mainMenu.gridViewMarkup.SelectedItems)
394
                    {
395
                        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
396
                        {
397
                            /// 저장 서비스 호출
398
                            result = await this.ExecuteSaveCommandAsync(mainMenu);
399
                            ViewerDataModel.Instance._markupInfoList.Where(data => data.MarkupInfoID == (item as IKCOM.MarkupInfoItem).MarkupInfoID).FirstOrDefault().UpdateTime = DateTime.Now;
400
                        }
401
                    }
402
                }
403

  
404
                mainMenu.SetCommentPages(null);
405

  
406
                ViewerDataModel.Instance.UndoDataList.Clear();
407
                result = true;
408
            }
409
            catch (Exception ex)
410
            {
411
                System.Diagnostics.Debug.WriteLine("_SaveEvent Error : " + ex.ToString());
412
            }
413
            finally
414
            {
415
                /*
416
                /// delete markup information when 코멘트가 없을 경우
417
                if (ViewerDataModel.Instance.MyMarkupList.Count == 0)
418
                {
419
                    foreach (var item in menu.gridViewMarkup.SelectedItems)
420
                    {
421
                        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
422
                        {
423
                            //this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem));
424
                        }
425
                    }
426
                }
427
                */
428
            }
429

  
430
            return result;
431
        }
432

  
433 358
        /// <summary>
434 359
        /// 마크업 데이터를 저장한다.
435 360
        /// </summary>
......
1597 1522
                    instanceMain.dzMainMenu.rotate.Angle -= 90;
1598 1523
                }
1599 1524
            }
1600
            //double angle = (double)rotateValue.GetValue(rotateOffSet);
1601 1525
            //instanceMain.dzMainMenu.rotate.Angle = angle;
1602 1526
            //var rotationNum = Math.Abs((instanceMain.dzMainMenu.rotate.Angle / 90));
1603 1527

  
......
2539 2463
             public double height { get; set; }
2540 2464
         }
2541 2465
         */
2542
        private async void CollapsedButton_Click()
2543
        {
2544
            this.ParentOfType<MainWindow>().dzTopMenu._SaveEvent(null, null); // 저장하지 못한 데이터가 있다면 저장
2545

  
2546
            string[] data = new string[0];
2547

  
2548
            int cnt = 0;
2549
            var menu = this.ParentOfType<MainWindow>().dzMainMenu;
2550

  
2551
            List<MarkupInfoItem> gridSelectionItem = menu.gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업
2552

  
2553
            foreach (var item in gridSelectionItem)
2554
            {
2555
                if ((item.UserID == App.ViewInfo.UserID) && (ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage != null))
2556
                {
2557
                    var instance = ViewerDataModel.Instance.MyMarkupList.Where(d => d.PageNumber == ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber &&
2558
                    d.MarkupInfoID == item.MarkupInfoID).ToList();
2559
                    data = new string[instance.Count];
2560
                    foreach (var markup in instance)
2561
                    {
2562
                        data[cnt++] = await MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressStringAsync(markup.Data,ViewerDataModel.Instance.NewMarkupCancelToken());
2563
                    }
2564
                }
2565
            }
2566

  
2567
            if (data != null && KCOM.Properties.Settings.Default.cad == 1)
2568
            {
2569
                string FilePath = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\Cad");
2570
                string FileName = FilePath + "\\commentstring.json"; // Default file name
2571
                if (!File.Exists(FilePath))
2572
                {
2573
                    Directory.CreateDirectory(FilePath);
2574
                }
2575

  
2576
                if (!string.IsNullOrEmpty(FileName))
2577
                {
2578
                    //  File.WriteAllText(SaveDig.FileName, data);
2579
                    File.WriteAllLines(FileName, data);
2580
                }
2581
            }
2582
        }
2583 2466

  
2584 2467
        private double minHeight;
2585 2468
        private double minWidth;
KCOM/Events/SaveCommand.cs
64 64
        }
65 65
        #endregion
66 66

  
67
        public void MarkupConsolidate()
68
        {
69

  
70
        }
71

  
72 67
        /// <summary>
73 68
        /// save comments related to given markup information
74 69
        /// </summary>
KCOM/MainWindow.xaml.cs
50 50

  
51 51
            this.Loaded += MainWindow_Loaded;
52 52
            this.Unloaded += MainWindow_Unloaded;
53
            //this.PreviewKeyDown += new KeyEventHandler(KeyEventDownAction);
54 53
            this.Activated += MainWindow_Activated;
55 54
        }
56

  
57 55
      
58 56

  
59 57
        private void MainWindow_Activated(object sender, EventArgs e)
KCOM/Services/BaseServices.cs
330 330
        /// <param name="e"></param>
331 331
        private void BaseClient_GetMarkupInfoItemsCompleted(object sender, GetMarkupInfoItemsCompletedEventArgs e)
332 332
        {
333
            //Logger.sendResLog("GetMarkupInfoItemsCompleted", "UserState : " + e.UserState + "\r Result :" + e.Result?.Count + "\r Cancelled :" + e.Cancelled + "\r Error :" + e.Error, 1);
334

  
335 333
            ViewerDataModel.Instance.MarkupControls_USER.Clear();
336 334
            ViewerDataModel.Instance.MarkupControls.Clear();
337 335

  
......
820 818
                List<MarkupInfoItem> gridSelectionItem = gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업
821 819
                List<MarkupInfoItem> gridNonSelectionItem = gridItem.Except(gridSelectionItem).ToList(); //선택 되지 않은 마크업
822 820
#region 코멘트 보기
823
                if (e.AddedItems.Count() > 0 && this.pageNavigator.CurrentPage != null)
821
                if (e.AddedItems.Any() && this.pageNavigator.CurrentPage != null)
824 822
                {
825 823
                    foreach (var item in gridSelectionItem)
826 824
                    {
......
881 879
                     });
882 880

  
883 881

  
884
                    var myComment = _infoItem.Where(d => d.UserID == App.ViewInfo.UserID).FirstOrDefault();
882
                    var myComment = _infoItem.Find(d => d.UserID == App.ViewInfo.UserID);
885 883
                    if (myComment != null)
886 884
                    {
887 885
                        Common.ViewerDataModel.Instance.MarkupControls_USER.ToList().ForEach(delegate (MarkupToPDF.Common.CommentUserInfo markupitem)
KCOM/Views/MainMenu.xaml.cs
14 14
using MarkupToPDF.Controls.Text;
15 15
using System;
16 16
using System.Collections.Generic;
17
using System.Collections.ObjectModel;
17 18
using System.Diagnostics;
18 19
using System.Linq;
19 20
using System.Reflection;
......
124 125
        public CommentUserInfo previousControl { get; set; }
125 126
        public CommentUserInfo currentControl { get; set; }
126 127
        public ControlType controlType { get; set; }
127
        private Move move = new Move();
128
        private double[] rotateValue = { 0, 90, 180, 270 };
129
        public MouseHandlingMode mouseHandlingMode = MouseHandlingMode.None;
128
        public MouseHandlingMode mouseHandlingMode { get; set; } = MouseHandlingMode.None;
130 129
        private static readonly double DragThreshold = 5;
131 130
        private System.Windows.Input.Cursor cursor { get; set; }
132 131

  
......
143 142
        private Point canvasZoommovingMouseDownPoint;
144 143
        private List<object> ControlList = new List<object>();
145 144
        private ListBox listBox = new ListBox();
146
        private Dictionary<Geometry, string> selected_item = new Dictionary<Geometry, string>();
147 145
        private bool isDraggingSelectionRect = false;
148 146
        private VPRevision CurrentRev { get; set; }
149 147
        public RadRibbonButton btnConsolidate { get; set; }
......
152 150
        public RadRibbonButton btnConsolidateFinalPDF { get; set; }
153 151

  
154 152
        public string Filename_ { get; set; }
155
        public double L_Size = 0;
156
        public AdornerFinal adorner_;
157 153
        public UndoData multi_UndoData;
158 154
        public string Symbol_ID = "";
159 155

  
......
172 168

  
173 169
        private Point Sync_Offset_Point;
174 170

  
175
        //강인구 테스트
176
        private Path _SelectionPath { get; set; }
177

  
178
        public Path SelectionPath
179
        {
180
            get
181
            {
182
                return _SelectionPath;
183
            }
184
            set
185
            {
186
                if (_SelectionPath != value)
187
                {
188
                    _SelectionPath = value;
189
                    RaisePropertyChanged("SelectionPath");
190
                }
191
            }
192
        }
193

  
194 171
        private System.Windows.Controls.Image _imageViewer { get; set; }
195 172

  
196 173
        public System.Windows.Controls.Image imageViewer
......
274 251
            public int IsUpdate { get; set; }
275 252
        }
276 253

  
277
        private List<TempDt> tempDtList = new List<TempDt>();
278

  
279 254
        public void SetCursor()
280 255
        {
281 256
            this.Cursor = cursor;
......
652 627
            /// add or update markup list
653 628
            foreach (var control in ViewerDataModel.Instance.MarkupControls_USER)
654 629
            {
630
                #region Index를 저장한다.
631
                control.Index = ViewerDataModel.Instance.MarkupControls_USER.IndexOf(control);
632
                #endregion
655 633
                var markup = MarkupParser.MarkupToString(control, App.ViewInfo.UserID);
656 634

  
657 635
                var exist = ViewerDataModel.Instance.MyMarkupList.Find(data => data.ID == markup.CommentID);
......
725 703

  
726 704
        private async Task PageChangingAsync(DOCPAGE currentPage, int changePageNumber, CancellationToken token)
727 705
        {
728
            var BalancePoint = ViewerDataModel.Instance.PageBalanceMode == true ? changePageNumber + ViewerDataModel.Instance.PageBalanceNumber : changePageNumber;
706
            var BalancePoint = ViewerDataModel.Instance.PageBalanceMode ? changePageNumber + ViewerDataModel.Instance.PageBalanceNumber : changePageNumber;
729 707

  
730 708
            #region 페이지가 벗어난 경우
731 709

  
......
920 898
            instanceMain.dzTopMenu.tlcurrentPage.Text = e.CurrentPage.PAGE_NUMBER.ToString();
921 899
            instanceMain.dzTopMenu.tlcurrentPage_readonly.Text = e.CurrentPage.PAGE_NUMBER.ToString();
922 900

  
923
            instanceMain.dzTopMenu.rotateOffSet = 0;
924 901
            var pageinfo = this.CurrentDoc.docInfo.DOCPAGE.FirstOrDefault(p => p.PAGE_NUMBER == e.CurrentPage.PAGE_NUMBER);
925 902
            drawingPannelRotate(pageinfo.PAGE_ANGLE);
926 903

  
......
936 913
            textControl.Base_TextBlock.Visibility = Visibility.Visible;
937 914
        }
938 915

  
939
        private SymControlN GetSymNControl(double PageWidth, double PageHeight, string userId, string markupInfoId, Point startPosition)
940
        {
941
            SymControlN result = null;
942

  
943
            try
944
            {
945
                double height = 80;
946
                double itemWidth = 180;
947

  
948
                System.Windows.Point startPoint = new System.Windows.Point(startPosition.X, startPosition.Y);
949
                System.Windows.Point endPoint = new System.Windows.Point(startPosition.X + itemWidth, startPosition.Y + height);
950
                System.Windows.Point leftBottomPoint = new System.Windows.Point(startPosition.X, startPosition.Y + height);
951
                System.Windows.Point topRightPoint = new System.Windows.Point(startPosition.X + itemWidth, startPosition.Y);
952

  
953
                result = new SymControlN
954
                {
955
                    CommentID = Commons.ShortGuid(),
956
                    MarkupInfoID = markupInfoId,
957
                    UserID = userId,
958
                    PointSet = new List<Point> { startPoint, leftBottomPoint, endPoint, topRightPoint },
959
                    StartPoint = startPoint,
960
                    EndPoint = endPoint,
961
                    CommentAngle = 0,
962
                    LeftBottomPoint = leftBottomPoint,
963
                    TopRightPoint = topRightPoint,
964
                    Opacity = 1,
965
                    PathXathData = "eJy1Ul1PwjAU/SvN9c3EdY5g1FAShyIxRgygxsemu7AbupZ0Vae/3g42/Azxxfuw9Z7Tnpx72t6lo4zdyAIFyHUBqwptSgG596tTzkuVYyHLqCDlbGnnPlK24C9k5hVP4viIV7LQfOWwROOlJ2ug36tVo1Sq5cLZJ5P1e1OrKRtYbV3qnsqcrZcC9oZNARuvpCL/KiCODoHxfo//EJmg8tIsNLKpd+hVLmBIWkPd2iU2cnGoFprlpJYGyzBOt8WuyeCVJSNgUstCM/1WHNgDZT5oJ3E4M0Ja5F7A8QmwgTTPIYlrnAfgIIm6W2hmVy3CN9M3GUzsyznOyVAdTBlG+NxvxffXx37nOlF3Fx3vppNd5P6nnL8bnWHlU23VktUrAWe3t5Px/cU5sKE1/qFRuKi8k6nV2Qae0ltIshPXncPNtX25lZF19BY2Sn2maWGK8GQEDMIXHbB7dJ7Ur1RrUcDmbXx3l76y0eN4endz+Qd/yX/663xk2v7eAQ==",
966
                    Memo = null
967
                };
968
            }
969
            catch (Exception ex)
970
            {
971
                System.Diagnostics.Debug.WriteLine(ex.ToString());
972
            }
973

  
974
            return result;
975
        }
976

  
977
        private RectangleControl GetRectControl(double PageWidth, double PageHeight, string userId, string markupInfoId, Point startPosition)
978
        {
979
            RectangleControl result = null;
980

  
981
            try
982
            {
983
                double height = 80;
984
                double itemWidth = 180;
985

  
986
                System.Windows.Point startPoint = new System.Windows.Point(startPosition.X, startPosition.Y);
987
                System.Windows.Point endPoint = new System.Windows.Point(startPosition.X + itemWidth, startPosition.Y + height);
988
                System.Windows.Point leftBottomPoint = new System.Windows.Point(startPosition.X, startPosition.Y + height);
989
                System.Windows.Point topRightPoint = new System.Windows.Point(startPosition.X + itemWidth, startPosition.Y);
990

  
991
                result = new RectangleControl
992
                {
993
                    CommentID = Commons.ShortGuid(),
994
                    MarkupInfoID = markupInfoId,
995
                    LineSize = 5,
996
                    Paint = MarkupToPDF.Controls.Common.PaintSet.None,
997
                    StartPoint = startPoint,
998
                    EndPoint = endPoint,
999
                    CommentAngle = 0,
1000
                    StrokeColor = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 255, 0x0, 0x0)),
1001
                    //StrokeColor = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 64, 224, 208)),
1002
                    FillColor = null,
1003
                    DashSize = new System.Windows.Media.DoubleCollection(new[] { 999999.0 }),
1004
                    Opacity = 1,
1005
                    LeftBottomPoint = leftBottomPoint,
1006
                    TopRightPoint = topRightPoint,
1007
                    PointSet = new List<Point> { startPoint, leftBottomPoint, endPoint, topRightPoint },
1008
                    UserID = userId,
1009
                    Memo = null
1010
                };
1011
            }
1012
            catch (Exception ex)
1013
            {
1014
                System.Diagnostics.Debug.WriteLine(ex.ToString());
1015
            }
1016

  
1017
            return result;
1018
        }
1019

  
1020
        private TextControl GetTextControl(double PageWidth, double PageHeight, string userId, string markupInfoId, string Text, double fontSize, FontWeight fontWeight, TextAlignment textAlignment, Rect parentRect, double positionY)
1021
        {
1022
            TextControl result = null;
1023

  
1024
            try
1025
            {
1026
                var txtSize = ShapeMeasure(new TextBlock { Text = Text, FontSize = fontSize, FontWeight = fontWeight, FontFamily = new FontFamily("Tahoma") });
1027

  
1028
                double startPositionX = parentRect.X;
1029

  
1030
                switch (textAlignment)
1031
                {
1032
                    case TextAlignment.Right:
1033
                        startPositionX = parentRect.X + parentRect.Width - txtSize.Width;
1034
                        break;
1035

  
1036
                    case TextAlignment.Center:
1037
                        startPositionX = parentRect.X + parentRect.Width / 2 - txtSize.Width / 2 - 3;
1038
                        break;
1039
                }
1040

  
1041
                Point startPosition = new Point
1042
                {
1043
                    X = startPositionX,
1044
                    Y = positionY
1045
                };
1046

  
1047
                System.Windows.Point startPoint = new System.Windows.Point(startPosition.X, startPosition.Y);
1048
                System.Windows.Point endPoint = new System.Windows.Point(startPosition.X + txtSize.Width, startPosition.Y + txtSize.Height);
1049
                System.Windows.Point leftBottomPoint = new System.Windows.Point(startPosition.X, startPosition.Y + txtSize.Height);
1050
                System.Windows.Point topRightPoint = new System.Windows.Point(startPosition.X + txtSize.Width, startPosition.Y);
1051

  
1052
                result = new TextControl
1053
                {
1054
                    CommentID = Commons.ShortGuid(),
1055
                    MarkupInfoID = markupInfoId,
1056
                    Text = Text,
1057
                    StartPoint = startPoint,
1058
                    EndPoint = endPoint,
1059
                    CanvasX = startPosition.X,
1060
                    CanvasY = startPosition.Y,
1061
                    BoxWidth = txtSize.Width,
1062
                    BoxHeight = txtSize.Height,
1063
                    ControlType_No = 0,
1064
                    LineSize = new Thickness(5),
1065
                    TextSize = fontSize,
1066
                    Foreground = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 255, 0, 0)),
1067
                    FontSize = 10,
1068
                    UserID = userId,
1069
                    IsHighLight = false,
1070
                    CommentAngle = 0,
1071
                    PointSet = new List<Point>(),
1072
                    Opacity = 1,
1073
                    IsSelected = false,
1074
                    TextFamily = new FontFamily("Tahoma"),
1075
                    TextStyle = FontStyles.Normal,
1076
                    TextWeight = FontWeights.Bold
1077
                };
1078
            }
1079
            catch (Exception ex)
1080
            {
1081
            }
1082

  
1083
            return result;
1084
        }
1085

  
1086
        public static Size ShapeMeasure(UIElement e)
1087
        {
1088
            // Measured Size is bounded to be less than maxSize
1089
            Size maxSize = new Size(
1090
                 double.PositiveInfinity,
1091
                 double.PositiveInfinity);
1092
            e.Measure(maxSize);
1093
            return e.DesiredSize;
1094
        }
1095

  
1096 916
        /// <summary>
1097 917
        /// 주어진 pageNumber의 마크업 데이터를 읽어 화면에 표시한다.
1098 918
        /// </summary>
......
1146 966
            }
1147 967
            #endregion
1148 968

  
1149
            System.Diagnostics.Debug.WriteLine("MarkupLoad - MarkupParser " + new TimeSpan(stopwatch.ElapsedTicks).ToString());
1150

  
1151 969
            /// fire selection event
1152 970
            List<MarkupInfoItem> gridSelectionItem = gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업
1153 971
            this.gridViewMarkup.UnselectAll();
......
1224 1042
            //db에 업데이트 한 list 를 view 에 업데이트
1225 1043
            string sDocID = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu._DocInfo.ID;
1226 1044
            List<MarkupInfoItem> results = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetMarkupInfoItems(App.ViewInfo.ProjectNO, sDocID);
1227
            MarkupInfoItem dbinfo = results.Where(x => x.MarkupInfoID == markupinfo_id).FirstOrDefault();
1228
            MarkupInfoItem viewinfo = Common.ViewerDataModel.Instance._markupInfoList.Where(x => x.MarkupInfoID == markupinfo_id).FirstOrDefault();
1045
            MarkupInfoItem dbinfo = results.Find(x => x.MarkupInfoID == markupinfo_id);
1046
            MarkupInfoItem viewinfo = Common.ViewerDataModel.Instance._markupInfoList.FirstOrDefault(x => x.MarkupInfoID == markupinfo_id);
1229 1047
            if (dbinfo.MarkupList.Count > 0)
1230 1048
            {
1231 1049
                if (viewinfo.MarkupList != null)
......
1489 1307
            {
1490 1308
                ControlList.Clear();
1491 1309
                listBox.Items.Clear();
1492
                selected_item.Clear();
1493 1310

  
1494 1311
                (item as IMarkupCommonData).IsSelected = false;
1495 1312
            }
1496 1313
        }
1497 1314

  
1498
        public void ReleaseSelectPath()
1499
        {
1500
            if (SelectionPath == null)
1501
            {
1502
                SelectionPath = new Path();
1503
                SelectionPath.Name = "";
1504
            }
1505
            if (SelectionPath.Name != "")
1506
            {
1507
                SelectionPath.Name = "None";
1508
            }
1509
            SelectionPath.Opacity = 0.01;
1510
            SelectionPath.RenderTransform = null;
1511
            SelectionPath.RenderTransformOrigin = new Point(0, 0);
1512
        }
1513

  
1514
        #region 컨트롤 초기화
1515

  
1516
        public void Control_Init(object control)
1517
        {
1518
            if (L_Size != 0 && (control as IPath) != null)
1519
            {
1520
                (control as IPath).LineSize = L_Size;
1521
                L_Size = 0;
1522
            }
1523

  
1524
            switch (control.GetType().Name)
1525
            {
1526
                case "RectangleControl":
1527
                    {
1528
                        (control as RectangleControl).StrokeColor = Brushes.Red;
1529
                    }
1530
                    break;
1531

  
1532
                case "CircleControl":
1533
                    {
1534
                        (control as CircleControl).StrokeColor = Brushes.Red;
1535
                    }
1536
                    break;
1537

  
1538
                case "TriControl":
1539
                    {
1540
                        (control as TriControl).StrokeColor = Brushes.Red;
1541
                    }
1542
                    break;
1543

  
1544
                case "RectCloudControl":
1545
                    {
1546
                        (control as RectCloudControl).StrokeColor = Brushes.Red;
1547
                    }
1548
                    break;
1549

  
1550
                case "CloudControl":
1551
                    {
1552
                        (control as CloudControl).StrokeColor = Brushes.Red;
1553
                    }
1554
                    break;
1555

  
1556
                case "PolygonControl":
1557
                    {
1558
                        (control as PolygonControl).StrokeColor = Brushes.Red;
1559
                    }
1560
                    break;
1561

  
1562
                case "ArcControl":
1563
                    {
1564
                        (control as ArcControl).StrokeColor = Brushes.Red;
1565
                    }
1566
                    break;
1567

  
1568
                case "ArrowArcControl":
1569
                    {
1570
                        (control as ArrowArcControl).StrokeColor = Brushes.Red;
1571
                    }
1572
                    break;
1573

  
1574
                case "LineControl":
1575
                    {
1576
                        (control as LineControl).StrokeColor = Brushes.Red;
1577
                    }
1578
                    break;
1579

  
1580
                case "ArrowControl_Multi":
1581
                    {
1582
                        (control as ArrowControl_Multi).StrokeColor = Brushes.Red;
1583
                    }
1584
                    break;
1585

  
1586
                case "TextControl":
1587
                    {
1588
                        (control as TextControl).BackInnerColor = new SolidColorBrush(Color.FromArgb(Convert.ToByte(255 * 0.6), Colors.White.R, Colors.White.G, Colors.White.B));
1589
                    }
1590
                    break;
1591

  
1592
                case "ArrowTextControl":
1593
                    {
1594
                        (control as ArrowTextControl).BackInnerColor = new SolidColorBrush(Color.FromArgb(Convert.ToByte(255 * 0.6), Colors.White.R, Colors.White.G, Colors.White.B));
1595
                    }
1596
                    break;
1597

  
1598
                case "InsideWhiteControl":
1599
                    {
1600
                        (control as InsideWhiteControl).StrokeColor = Brushes.White;
1601
                    }
1602
                    break;
1603

  
1604
                case "OverlapWhiteControl":
1605
                    {
1606
                        (control as OverlapWhiteControl).StrokeColor = Brushes.White;
1607
                    }
1608
                    break;
1609

  
1610
                case "ClipWhiteControl":
1611
                    {
1612
                        (control as ClipWhiteControl).StrokeColor = Brushes.White;
1613
                    }
1614
                    break;
1615

  
1616
                case "CoordinateControl":
1617
                    {
1618
                        (control as CoordinateControl).StrokeColor = Brushes.Black;
1619
                    }
1620
                    break;
1621
            }
1622
        }
1623

  
1624
        #endregion 컨트롤 초기화
1625

  
1626
        public void firstCondition_MouseLeave(object sender, MouseEventArgs e)
1627
        {
1628
            //Control_Init(e.Source);
1629
        }
1630

  
1631 1315
        //private Window _dragdropWindow = null;
1632 1316

  
1633 1317
        [DllImport("user32.dll")]
......
1641 1325
            public Int32 Y;
1642 1326
        };
1643 1327

  
1644
        /*
1645
       public string symbol_id = null;
1646
       public long symbol_group_id;
1647
       public int symbol_SelectedIndex;
1648
       public ImageSource symbol_img;
1649
       public string symbol_Data = null;
1650
       public void symboldata(string id, long group_id, int SelectedIndex, string Data_, ImageSource img)
1651
       {
1652
           PlaceImageSymbol(symbol_id, symbol_group_id, symbol_SelectedIndex, new Point(zoomAndPanCanvas.ActualWidth / 2,
1653
               zoomAndPanCanvas.ActualHeight / 2));
1654

  
1655
               if (this._dragdropWindow != null)
1656
               {
1657
                   this._dragdropWindow.Close();
1658
                   this._dragdropWindow = null;
1659
               }
1660

  
1661
               symbol_id = id;
1662
               symbol_group_id = group_id;
1663
               symbol_SelectedIndex = SelectedIndex;
1664
               symbol_Data = Data_;
1665
               symbol_img = img;
1666

  
1667
               CreateDragDropWindow2(img);
1668
    }
1669

  
1670
    private void CreateDragDropWindow2(ImageSource image)
1671
        {
1672
            this._dragdropWindow = new Window();
1673
            _dragdropWindow.Cursor = new Cursor(App.DefaultArrowCursorStream);
1674
            _dragdropWindow.WindowStyle = WindowStyle.None;
1675
            _dragdropWindow.AllowsTransparency = true;
1676
            _dragdropWindow.AllowDrop = false;
1677
            _dragdropWindow.Background = null;
1678
            _dragdropWindow.IsHitTestVisible = false;
1679
            _dragdropWindow.SizeToContent = SizeToContent.WidthAndHeight;
1680
            _dragdropWindow.Topmost = true;
1681
            _dragdropWindow.ShowInTaskbar = false;
1682

  
1683
            Rectangle r = new Rectangle();
1684
            r.Width = image.Width;
1685
            r.Height = image.Height;
1686
            r.Opacity = 0.5;
1687
            r.Fill = new ImageBrush(image);
1688
            this._dragdropWindow.Content = r;
1689

  
1690
            Win32Point w32Mouse = new Win32Point();
1691
            GetCursorPos(ref w32Mouse);
1692

  
1693
            //w32Mouse.X = getCurrentPoint.X;
1694
            this._dragdropWindow.Left = w32Mouse.X - (image.Width / 2);
1695
            this._dragdropWindow.Top = w32Mouse.Y - (image.Height / 2);
1696
            this._dragdropWindow.Show();
1697
        }
1698

  
1699
         */
1700

  
1701 1328
        public void MoveZoomAndPanControl(Vector dragOffset)
1702 1329
        {
1703 1330
            zoomAndPanControl.ContentOffsetX -= dragOffset.X;
......
2238 1865
            }
2239 1866
        }
2240 1867

  
2241
        private CommentUserInfo enterMouse = null;
2242

  
2243
        private object IntersectsControls(Point mousePosition, Canvas drawingRotateCanvas)
2244
        {
2245
            object result = null;
2246

  
2247
            // 검색할 정사각형의 크기 및 반경 설정
2248
            double squareSize = 1;
2249
            Rect searchRect = new Rect(
2250
                mousePosition.X - squareSize,
2251
                mousePosition.Y - squareSize,
2252
                squareSize * 2,
2253
                squareSize * 2
2254
            );
2255

  
2256
            foreach (CommentUserInfo child in drawingRotateCanvas.ChildrenOfType<CommentUserInfo>())
2257
            {
2258
                if (child is CommentUserInfo comment)
2259
                {
2260
                    // 검색 영역과 Rectangle의 경계가 겹치는지 확인합니다.
2261
                    if (searchRect.IntersectsWith(child.ItemRect))
2262
                    {
2263
                        child.IsMouseEnter = true;
2264
                        result = (object)child;
2265
                        // Geometry를 적용하거나 원하는 작업을 수행합니다.
2266
                        // 예: rectangle.Fill = new SolidColorBrush(Colors.Red);
2267
                    }
2268
                    else
2269
                    {
2270
                        child.IsMouseEnter = false;
2271
                    }
2272
                }
2273
            }
2274

  
2275
            return result;
2276
        }
2277

  
2278 1868
        private void zoomAndPanControl2_MouseMove(object sender, MouseEventArgs e)
2279 1869
        {
2280 1870
            if ((e.MiddleButton == MouseButtonState.Pressed) || (e.RightButton == MouseButtonState.Pressed))
......
2296 1886
            }
2297 1887
        }
2298 1888

  
2299
        private List<CommentUserInfo> hitList = new List<CommentUserInfo>();
2300

  
2301 1889
        private void zoomAndPanControl_MouseUp(object sender, MouseButtonEventArgs e)
2302 1890
        {
2303 1891
            IsDrawing = false;
......
2603 2191
            ViewerDataModel.Instance.MarkupAngle = rotate.Angle;
2604 2192
        }
2605 2193

  
2606
        private void syncPannelRotate(double angle)
2607
        {
2608
            //Logger.sendCheckLog("pageNavigator_PageChanging_drawingPannelRotate Setting", 1);
2609
            rotate.Angle = angle;
2610
            var rotationNum = Math.Abs((rotate.Angle / 90));
2611

  
2612
            if (angle == 90 || angle == 270)
2613
            {
2614
                double emptySize = zoomAndPanCanvas2.Width;
2615
                zoomAndPanCanvas2.Width = zoomAndPanCanvas2.Height;
2616
                zoomAndPanCanvas2.Height = emptySize;
2617
            }
2618
            if (angle == 0)
2619
            {
2620
                translate2.X = 0;
2621
                translate2.Y = 0;
2622
            }
2623
            else if (angle == 90)
2624
            {
2625
                translate2.X = zoomAndPanCanvas2.Width;
2626
                translate2.Y = 0;
2627
            }
2628
            else if (angle == 180)
2629
            {
2630
                translate2.X = zoomAndPanCanvas2.Width;
2631
                translate2.Y = zoomAndPanCanvas2.Height;
2632
            }
2633
            else
2634
            {
2635
                translate2.X = 0;
2636
                translate2.Y = zoomAndPanCanvas2.Height;
2637
            }
2638

  
2639
            zoomAndPanControl2.RotationAngle = rotate.Angle;
2640
        }
2641

  
2642
        public void PlaceImageSymbol(string id, string groupID, int SelectedIndex, Point canvasZoomPanningMouseDownPoint)
2643
        {
2644
            string Data_ = "";
2645

  
2646
            try
2647
            {
2648
                //Logger.sendReqLog("GetSymbolImageURL: ", id + "," + SelectedIndex, 1);
2649
                Data_ = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetSymbolImageURL(id, SelectedIndex);
2650
                if (Data_ != null || Data_ != "")
2651
                {
2652
                    //Logger.sendResLog("GetSymbolImageURL", "TRUE", 1);
2653
                }
2654
                else
2655
                {
2656
                    //Logger.sendResLog("GetSymbolImageURL", "FALSE", 1);
2657
                }
2658

  
2659
                //MARKUP_DATA_GROUP mARKUP_DATA_GROUP = new MARKUP_DATA_GROUP
2660
                //{
2661
                //    SYMBOL_ID = id,//InnerItem.Symbol_ID
2662
                //    STATE = 0,
2663
                //};
2664
                if (Data_ != null)
2665
                {
2666
                    Image img = new Image();
2667
                    //img.Source = new System.Windows.Media.Imaging.BitmapImage(new Uri(Data_));
2668
                    if (Data_.Contains(".svg"))
2669
                    {
2670
                        SharpVectors.Converters.SvgImageExtension svgImage = new SharpVectors.Converters.SvgImageExtension(Data_);
2671
                        img.Source = (DrawingImage)svgImage.ProvideValue(null);
2672
                    }
2673
                    else
2674
                    {
2675
                        img.Source = new BitmapImage(new Uri(Data_));
2676
                    }
2677

  
2678
                    var currentControl = new MarkupToPDF.Controls.Etc.ImgControl
2679
                    {
2680
                        PointSet = new List<Point>(),
2681
                        FilePath = Data_,
2682
                        ImageData = img.Source,
2683
                        StartPoint = canvasZoomPanningMouseDownPoint,
2684
                        EndPoint = new Point(canvasZoomPanningMouseDownPoint.X + img.Source.Width,
2685
                        canvasZoomPanningMouseDownPoint.Y + img.Source.Height),
2686
                        TopRightPoint = new Point(canvasZoomPanningMouseDownPoint.X + img.Source.Width,
2687
                        canvasZoomPanningMouseDownPoint.Y),
2688
                        LeftBottomPoint = new Point(canvasZoomPanningMouseDownPoint.X,
2689
                        canvasZoomPanningMouseDownPoint.Y + img.Source.Height)
2690
                    };
2691

  
2692
                    currentControl.PointSet = new List<Point>
2693
                                        {
2694
                                            currentControl.StartPoint,
2695
                                            currentControl.LeftBottomPoint,
2696
                                            currentControl.EndPoint,
2697
                                            currentControl.TopRightPoint,
2698
                                        };
2699
                    UndoDataGroup = new UndoDataGroup()
2700
                    {
2701
                        IsUndo = false,
2702
                        Event = EventType.Create
2703
                    };
2704
                    ViewerDataModel.Instance.UndoDataList.Where(data1 => data1.IsUndo == true).ToList().ForEach(i =>
2705
                    {
2706
                        ViewerDataModel.Instance.UndoDataList.Remove(i);
2707
                    });
2708

  
2709
                    //multi_UndoData = dzMainMenu.Control_Style(currentControl as MarkupToPDF.Common.CommentUserInfo);
2710
                    var UndoData = new UndoData(currentControl as MarkupToPDF.Common.CommentUserInfo);
2711
                    UndoDataGroup.MarkupDataColl.Add(UndoData);
2712
                    ViewerDataModel.Instance.UndoDataList.Add(UndoDataGroup);
2713

  
2714
                    ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl as MarkupToPDF.Common.CommentUserInfo);
2715
                    currentControl.CommentID = Commons.ShortGuid();
2716
                    currentControl.SymbolID = id;
2717
                    currentControl.GroupID = groupID;
2718
                    currentControl.ApplyTemplate();
2719
                    currentControl.SetImage();
2720

  
2721
                    ViewerDataModel.Instance.MarkupControls_USER.Remove(currentControl as MarkupToPDF.Common.CommentUserInfo);
2722
                    Controls.AdornerFinal final = new Controls.AdornerFinal(currentControl as MarkupToPDF.Common.CommentUserInfo);
2723
                    SelectLayer.Children.Add(final);
2724
                }
2725
            }
2726
            catch (Exception ex)
2727
            {
2728
                this.ParentOfType<MainWindow>().dzMainMenu.DialogMessage_Alert(ex.Message, "Error");
2729
            }
2730
        }
2731

  
2732 2194
        // 저장전 textbox 입력 완료 때문에 public로 하여 savecommand에서 호출하도록 임시로 함.
2733 2195
        public async void zoomAndPanControl_MouseDown(object sender, MouseButtonEventArgs e)
2734 2196
        {
......
3089 2551
                                }
3090 2552
                                else
3091 2553
                                {
3092
                                    this.ParentOfType<MainWindow>().dzTopMenu._SaveEvent(null, null);
2554
                                    await this.ParentOfType<MainWindow>().dzTopMenu.SaveEventAsync(null, null);
3093 2555
                                    if (ViewerDataModel.Instance.MyMarkupList.Any(d => d.PageNumber == Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber
3094 2556
                                     && d.Data_Type == Convert.ToInt32(MarkupToPDF.Controls.Common.ControlType.Coordinate)))
3095 2557
                                    {
......
4710 4172
        {
4711 4173
            foreach (var item in SelectionSet.Instance.SelectedItems)
4712 4174
            {
4713
                item.ZIndex = 99;
4175
                item.ZIndex = CommentUserInfo.MaxZIndex;
4714 4176
                item.Index = -1;
4715 4177
                Canvas.SetZIndex(item, item.ZIndex);
4716 4178
                item.UpdateControl();
......
4730 4192
                    {
4731 4193
                        if (item.GetType().Name == "AdornerFinal")
4732 4194
                        {
4733
                            foreach (var InnerItem in (item as Controls.AdornerFinal).Members.Cast<Controls.AdornerMember>())
4195
                            foreach (var InnerItem in (item as Controls.AdornerFinal).Members)
4734 4196
                            {
4735 4197
                                AdonerList.Add(InnerItem);
4736 4198
                            }
......
4750 4212

  
4751 4213
        private void RemoveLineStroke(Point P)
4752 4214
        {
4753
            var control = ViewerDataModel.Instance.MarkupControls_USER.Where(data => data.IsMouseEnter).FirstOrDefault();
4215
            var control = ViewerDataModel.Instance.MarkupControls_USER.FirstOrDefault(data => data.IsMouseEnter);
4754 4216
            if (control != null)
4755 4217
            {
4756 4218
                UndoCommand.Instance.Push(EventType.Delete, new List<CommentUserInfo>() { control });
......
4803 4265
            if (result)
4804 4266
            {
4805 4267
                var consolidateItem = ViewerDataModel.Instance._markupInfoList.Where(x => x.Consolidate == 1 && x.AvoidConsolidate == 0);
4806

  
4807 4268
                if (consolidateItem?.Count() > 0)
4808 4269
                {
4809 4270
                    gridViewMarkup.Select(consolidateItem);
......
4835 4296
                    }
4836 4297
                }
4837 4298

  
4838
                var isSave = await this.ParentOfType<MainWindow>().dzTopMenu.SaveEventAsync();
4299
                var isSave = await this.ParentOfType<MainWindow>().dzTopMenu.SaveEventAsync(null, null);
4839 4300
                if (isSave)
4840 4301
                {
4841 4302
                    var token = ViewerDataModel.Instance.NewMarkupCancelToken();
......
4870 4331
            }
4871 4332
            else
4872 4333
            {
4873
                var isSave = await this.ParentOfType<MainWindow>().dzTopMenu.SaveEventAsync();
4874

  
4334
                var isSave = await this.ParentOfType<MainWindow>().dzTopMenu.SaveEventAsync(null, null);
4875 4335
                if (isSave)
4876 4336
                {
4877 4337
                    var token = ViewerDataModel.Instance.NewMarkupCancelToken();
......
5950 5410
            }
5951 5411
        }
5952 5412

  
5953
        public async Task<PngBitmapEncoder> symImageAsync(string data)
5954
        {
5955
            Canvas _canvas = new Canvas();
5956
            _canvas.Background = Brushes.White;
5957
            _canvas.Width = adorner_.BorderSize.Width;
5958
            _canvas.Height = adorner_.BorderSize.Height;
5959
            await MarkupParser.ParseAsync(App.BaseAddress, App.ViewInfo.ProjectNO, data, _canvas,ViewerDataModel.Instance.PageAngle, "#FFFF0000", "", ViewerDataModel.Instance.NewMarkupCancelToken(),
5960
                STAMP_Contents: App.SystemInfo.STAMP_CONTENTS);
5961

  
5962
            BitmapEncoder encoder = new PngBitmapEncoder();
5963

  
5964
            RenderTargetBitmap renderBitmap = new RenderTargetBitmap((int)_canvas.Width + 50, (int)_canvas.Height + 50, 96d, 96d, PixelFormats.Pbgra32);
5965

  
5966
            DrawingVisual dv = new DrawingVisual();
5967

  
5968
            _canvas.Measure(new System.Windows.Size(adorner_.BorderSize.Width + 50, adorner_.BorderSize.Height + 50));
5969
            _canvas.Arrange(new Rect(new System.Windows.Point { X = -adorner_.BorderSize.X - 20, Y = -adorner_.BorderSize.Y - 20 }, new Point(adorner_.BorderSize.Width + 20, adorner_.BorderSize.Height + 20)));
5970

  
5971
            using (DrawingContext ctx = dv.RenderOpen())
5972
            {
5973
                VisualBrush vb = new VisualBrush(_canvas);
5974
                ctx.DrawRectangle(vb, null, new Rect(new System.Windows.Point { X = -adorner_.BorderSize.X, Y = -adorner_.BorderSize.Y }, new Point(adorner_.BorderSize.Width + 20, adorner_.BorderSize.Height + 20)));
5975
            }
5976

  
5977
            try
5978
            {
5979
                renderBitmap.Render(dv);
5980

  
5981
                GC.Collect(2);
5982
                GC.WaitForPendingFinalizers();
5983
                //GC.Collect();
5984
                // encode png data
5985
                PngBitmapEncoder pngEncoder = new PngBitmapEncoder();
5986
                // puch rendered bitmap into it
5987
                pngEncoder.Interlace = PngInterlaceOption.Off;
5988
                pngEncoder.Frames.Add(BitmapFrame.Create(renderBitmap));
5989
                return pngEncoder;
5990
            }
5991
            catch //(Exception ex)
5992
            {
5993
                return null;
5994
            }
5995
        }
5996

  
5997 5413
        public void DialogMessage_Alert(string content, string header)
5998 5414
        {
5999 5415
            App.splashScreen.Close();
......
6426 5842
        }
6427 5843
        */
6428 5844
    }
6429

  
6430
    public class testItem
6431
    {
6432
        public string Title { get; set; }
6433
    }
6434

  
6435

  
6436 5845
}
MarkupToPDF/Controls/Etc/DateControl.cs
600 600
                ///강인구 추가(2017.11.02)
601 601
                ///Memo 추가
602 602
                ctrl.Memo = this.Memo;
603

  
603
                ctrl.Index = this.Index;
604 604
                ctrl.ZIndex = this.ZIndex;
605 605
                ctrl.GroupID = this.GroupID;
606 606

  
......
632 632
                    PointSet = s.PointSet,
633 633
                    UserID = s.UserID,
634 634
                    Memo = s.Memo,
635
                    Index = s.Index,
635 636
                    ZIndex = s.ZIndex,
636 637
                    GroupID = s.GroupID
637 638
                };
MarkupToPDF/Controls/Etc/ImgControl.cs
523 523
                ///강인구 추가(2017.11.02)
524 524
                ///Memo 추가
525 525
                ctrl.Memo = this.Memo;
526

  
526
                ctrl.Index = this.Index;
527 527
                ctrl.ZIndex = this.ZIndex;
528 528
                ctrl.GroupID = this.GroupID;
529 529

  
......
575 575
                        ImageData = img.Source,
576 576
                        Memo = s.Memo,
577 577
                        GroupID = s.GroupID,
578
                        Index = s.Index,
578 579
                        ZIndex = s.ZIndex
579 580
                    };
580 581

  
MarkupToPDF/Controls/Etc/SignControl.cs
503 503
                ///강인구 추가(2017.11.02)
504 504
                ///Memo 추가
505 505
                ctrl.Memo = this.Memo;
506

  
506
                ctrl.Index = this.Index;
507 507
                ctrl.ZIndex = this.ZIndex;
508 508
                ctrl.GroupID = this.GroupID;
509 509

  
......
534 534
                    UserID = s.UserID,
535 535
                    UserNumber = s.UserNumber,
536 536
                    Memo = s.Memo,
537
                    Index = s.Index,
537 538
                    ZIndex = s.ZIndex,
538 539
                    GroupID = s.GroupID
539 540
                };
MarkupToPDF/Controls/Etc/SymControl.cs
540 540
                ctrl.TR = this.TopRightPoint;
541 541
                ctrl.Opac = this.Opacity;
542 542
                ctrl.Name = this.GetType().Name.ToString();
543
                ctrl.Index = this.Index;
543 544
                ctrl.ZIndex = this.ZIndex;
544 545
                ctrl.GroupID = this.GroupID;
545 546

  
......
574 575
                    PathData = sm.Convert(s.PathInfo.ToString()),
575 576
                    Opacity = s.Opac,
576 577
                    Memo = s.Memo,
578
                    Index = s.Index,
577 579
                    ZIndex = s.ZIndex,
578 580
                    GroupID = s.GroupID
579 581
                };
MarkupToPDF/Controls/Etc/SymControlN.cs
537 537
                ctrl.TR = this.TopRightPoint;
538 538
                ctrl.Opac = this.Opacity;
539 539
                ctrl.Name = this.GetType().Name.ToString();
540
                ctrl.Index = this.Index;
540 541
                ctrl.ZIndex = this.ZIndex;
541 542
                ctrl.GroupID = this.GroupID;
542 543

  
......
564 565
                    Opacity = s.Opac,
565 566
                    PathXathData = s.DBData,
566 567
                    Memo = s.Memo,
568
                    Index = s.Index,
567 569
                    ZIndex = s.ZIndex,
568 570
                    GroupID = s.GroupID
569 571
                };
MarkupToPDF/Controls/Line/ArcControl.cs
672 672
                ///강인구 추가(2017.11.02)
673 673
                ///Memo 추가
674 674
                ctrl.Memo = this.Memo;
675

  
675
                ctrl.Index = this.Index;
676 676
                ctrl.ZIndex = this.ZIndex;
677 677
                ctrl.GroupID = this.GroupID;
678 678

  
......
705 705
                    LineSize = Convert.ToDouble(data2.First()),
706 706
                    UserID = s.UserID,
707 707
                    Memo = s.Memo,
708
                    Index = s.Index,
708 709
                    ZIndex = s.ZIndex,
709 710
                    GroupID = s.GroupID
710 711
                };
MarkupToPDF/Controls/Line/ArrowArcControl.cs
617 617
                ///강인구 추가(2017.11.02)
618 618
                ///Memo 추가
619 619
                ctrl.Memo = this.Memo;
620

  
620
                ctrl.Index = this.Index;
621 621
                ctrl.ZIndex = this.ZIndex;
622 622
                ctrl.GroupID = this.GroupID;
623 623

  
......
651 651
                    LineSize = Convert.ToDouble(data2.First()),
652 652
                    UserID = s.UserID,
653 653
                    Memo = s.Memo,
654
                    Index = s.Index,
654 655
                    ZIndex = s.ZIndex,
655 656
                    GroupID = s.GroupID
656 657
                };
MarkupToPDF/Controls/Line/ArrowControl_Multi.cs
498 498
                ///강인구 추가(2017.11.02)
499 499
                ///Memo 추가
500 500
                ctrl.Memo = this.Memo;
501

  
501
                ctrl.Index = this.Index;
502 502
                ctrl.ZIndex = this.ZIndex;
503 503
                ctrl.GroupID = this.GroupID;
504 504

  
......
529 529
                    StrokeColor = brush,
530 530
                    UserID = s.UserID,
531 531
                    Memo = s.Memo,
532
                    Index = s.Index,
532 533
                    ZIndex = s.ZIndex,
533 534
                    GroupID = s.GroupID
534 535
                };
MarkupToPDF/Controls/Line/LineControl.cs
632 632
                ///강인구 추가(2017.11.02)
633 633
                ///Memo 추가
634 634
                ctrl.Memo = this.Memo;
635

  
635
                ctrl.Index = this.Index;
636 636
                ctrl.ZIndex = this.ZIndex;
637 637
                ctrl.GroupID = this.GroupID;
638 638

  
......
664 664
                    StrokeColor = brush,
665 665
                    UserID = ctrl.UserID,
666 666
                    LineSize = Convert.ToDouble(data2.First()),
667
                    Index = ctrl.Index,
667 668
                    ZIndex = ctrl.ZIndex,
668 669
                    GroupID = ctrl.GroupID
669 670
                };
MarkupToPDF/Controls/Parsing/MarkupParse.cs
321 321
                    if (!string.IsNullOrEmpty(markupInfoID)) control.MarkupInfoID = markupInfoID;
322 322
                    if (baseLayer != null)
323 323
                    {
324
                        baseLayer.Add(control);
324
                        #region Index 순서에 맞게 baseLayer에 추가한다.
325
                        int idx = baseLayer.ToList().FindIndex(x => x.Index > control.Index);
326
                        if(idx == -1) 
327
                            baseLayer.Add(control);
328
                        else
329
                            baseLayer.Insert(idx, control);
330
                        #endregion
331

  
325 332
                        control.ApplyTemplate();
326 333
                        #region ZIndex 설정
327 334
                        Canvas.SetZIndex(control, control.ZIndex);
MarkupToPDF/Controls/Polygon/CloudControl.cs
1146 1146
                ///강인구 추가(2017.11.02)
1147 1147
                ///Memo 추가
1148 1148
                ctrl.Memo = this.Memo;
1149

  
1149
                ctrl.Index = this.Index;
1150 1150
                ctrl.ZIndex = this.ZIndex;
1151 1151
                ctrl.GroupID = this.GroupID;
1152 1152

  
......
1182 1182
                    StartPoint = s.StartPoint,
1183 1183
                    EndPoint = s.EndPoint,
1184 1184
                    Memo = s.Memo,
1185
                    Index = s.Index,
1185 1186
                    ZIndex = s.ZIndex,
1186 1187
                    GroupID = s.GroupID
1187 1188

  
MarkupToPDF/Controls/Polygon/InkControl.cs
626 626
                ///강인구 추가(2017.11.02)
627 627
                ///Memo 추가
628 628
                ctrl.Memo = this.Memo;
629

  
629
                ctrl.Index = this.Index;
630 630
                ctrl.ZIndex = this.ZIndex;
631 631
                ctrl.GroupID = this.GroupID;
632 632

  
......
660 660
                    UserID = s.UserID,
661 661
                    Paint = s.PaintState,
662 662
                    EndPoint = s.EndPoint,
663
                    //PointC = s.PointC,
664 663
                    Memo = s.Memo,
664
                    Index = s.Index,
665 665
                    ZIndex = s.ZIndex,
666 666
                    GroupID = s.GroupID
667 667
                };
MarkupToPDF/Controls/Polygon/PolygonControl.cs
665 665
                ///강인구 추가(2017.11.02)
666 666
                ///Memo 추가
667 667
                ctrl.Memo = this.Memo;
668

  
668
                ctrl.Index = this.Index;
669 669
                ctrl.ZIndex = this.ZIndex;
670 670
                ctrl.GroupID = this.GroupID;
671 671

  
......
700 700
                    UserID = s.UserID,
701 701
                    Paint = s.PaintState,
702 702
                    Memo = s.Memo,
703
                    Index = s.Index,
703 704
                    ZIndex = s.ZIndex,
704 705
                    GroupID = s.GroupID
705 706
                };
MarkupToPDF/Controls/Shape/CircleControl.cs
626 626
                ///강인구 추가(2017.11.02)
627 627
                ///Memo 추가
628 628
                ctrl.Memo = this.Memo;
629

  
629
                ctrl.Index = this.Index;
630 630
                ctrl.ZIndex = this.ZIndex;
631 631
                ctrl.GroupID = this.GroupID;
632 632

  
......
659 659
                    StrokeColor = brush,
660 660
                    UserID = s.UserID,
661 661
                    Memo = s.Memo,
662
                    Index = s.Index,
662 663
                    ZIndex = s.ZIndex,
663 664
                    GroupID = s.GroupID
664 665
                };
MarkupToPDF/Controls/Shape/RectCloudControl.cs
686 686
                ///강인구 추가(2017.11.02)
687 687
                ///Memo 추가
688 688
                ctrl.Memo = this.Memo;
689

  
689
                ctrl.Index = this.Index;
690 690
                ctrl.ZIndex = this.ZIndex;
691 691
                ctrl.GroupID = this.GroupID;
692 692

  
......
719 719
                    LineSize = Convert.ToDouble(data2.First()),
720 720
                    UserID = s.UserID,
721 721
                    Memo = s.Memo,
722
                    Index = s.Index,
722 723
                    ZIndex = s.ZIndex,
723 724
                    GroupID = s.GroupID
724 725
                };
MarkupToPDF/Controls/Shape/RectangleControl.cs
725 725
                ///강인구 추가(2017.11.02)
726 726
                ///Memo 추가
727 727
                ctrl.Memo = this.Memo;
728

  
728
                ctrl.Index = this.Index;
729 729
                ctrl.ZIndex = this.ZIndex;
730 730
                ctrl.GroupID = this.GroupID;
731 731

  
......
758 758
                    PointSet = s.PointSet,
759 759
                    UserID = s.UserID,
760 760
                    Memo = s.Memo,
761
                    Index = s.Index,
761 762
                    ZIndex = s.ZIndex,
762 763
                    GroupID = s.GroupID
763 764
                };
MarkupToPDF/Controls/Shape/TriControl.cs
563 563
                ///강인구 추가(2017.11.02)
564 564
                ///Memo 추가
565 565
                ctrl.Memo = this.Memo;
566

  
566
                ctrl.Index = this.Index;
567 567
                ctrl.ZIndex = this.ZIndex;
... 이 차이점은 표시할 수 있는 최대 줄수를 초과해서 이 차이점은 잘렸습니다.

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)