프로젝트

일반

사용자정보

개정판 24c5e56c

ID24c5e56cba9a265a53397a5ffe348514c5f100b8
상위 c206d293
하위 ef22793a

김태성이(가) 4년 이상 전에 추가함

- final pdf Font 추가
- Markus navi 속도 최적화 Key input 최적화

Change-Id: I7f2cf1933e86017d7b1df9ef4bd3048a8e80a653

차이점 보기:

KCOM/Controls/Sample.xaml.cs
56 56
            if(!_Initialize)
57 57
            {
58 58
                _Initialize = true;
59

  
60 59
                SelectCommentCommand = new DelegateCommand(SetCommentPages);
61 60

  
61

  
62 62
                this.SizeChanged += Sample_SizeChanged;
63 63
                this.lstSelectComment.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(lstSelectComment_SelectionChanged);
64
                this.ImgListbox.SelectionChanged += new SelectionChangedEventHandler(ImgListbox_SelectionChanged);                
64
                this.ImgListbox.SelectionChanged += new SelectionChangedEventHandler(ImgListbox_SelectionChanged);
65
                this.ImgListbox.PreviewKeyUp += ImgListbox_PreviewKeyUp;
66

  
67

  
65 68
            }            
66 69
        }
67 70

  
68 71
        private void Sample_SizeChanged(object sender, SizeChangedEventArgs e)
69 72
        {
70
            if(e.WidthChanged)
73
            if (e.WidthChanged)
71 74
            {
72 75
                ImgListbox.UpdateLayout();
73 76
            }
......
195 198

  
196 199
        private async void ShowPageChange(object sender, RoutedEventArgs e)
197 200
        {
198
            if (_Initialize)
201
            //if (rdoAllPages.IsChecked == true) expCommentPages.IsExpanded = false;
202
            if (IsInitialized)
199 203
            {
200
                //if (rdoAllPages.IsChecked == true) expCommentPages.IsExpanded = false;
201 204
                await this.Dispatcher.InvokeAsync(() => ThumbnailSetAsync());
202 205
            }
203 206
        }
......
216 219
            SetCommentPages();
217 220
        }
218 221

  
222
        private void ImgListbox_PreviewKeyUp(object sender, KeyEventArgs e)
223
        {
224
            if (ImgListbox.SelectedItem != null && (e.Key == Key.Up || e.Key == Key.Down))
225
            {
226
                System.Diagnostics.Debug.WriteLine("ImgListbox_PreviewKeyUp");
227

  
228
                PageChange(ImgListbox.SelectedItem as KCOM.Common.ThumbnailItem);
229
            }
230
        }
231

  
219 232
        /// <summary>
220 233
        /// called when image list box's selection is changed
221 234
        /// </summary>
222 235
        /// <param name="sender"></param>
223 236
        /// <param name="e"></param>
224
        private async void ImgListbox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
237
        private void ImgListbox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
225 238
        {
226
            if(e.AddedItems.Count > 0)
239
            if (!Keyboard.IsKeyDown(Key.Down) && !Keyboard.IsKeyDown(Key.Up))
227 240
            {
228
                await ImgListbox.Dispatcher.InvokeAsync(() =>
229
                {
230
                    var number = (e.AddedItems[0] as KCOM.Common.ThumbnailItem).PageNumber;
241
                PageChange(ImgListbox.SelectedItem as KCOM.Common.ThumbnailItem);
242
            }
243
        }
231 244

  
245
        private void PageChange(KCOM.Common.ThumbnailItem selectItem)
246
        { 
247
                var number = selectItem.PageNumber;
248

  
249
                if (ViewerDataModel.Instance.PageNumber != number)
250
                {
232 251
                    ViewerDataModel.Instance.SystemMain.dzTopMenu._SaveEvent(null, null);   /// save controls
233 252

  
234
                    this.CurrentPage = e.AddedItems[0] as KCOM.Common.ThumbnailItem;
253
                    this.CurrentPage = ImgListbox.SelectedItem as KCOM.Common.ThumbnailItem;
235 254

  
236 255
                    PageChanging(this, new PageChangeEventArgs
237 256
                    {
......
239 258
                        PageNumber = number,
240 259
                        PageUri = null
241 260
                    });
242

  
243
                });
244
            }
245
            
246

  
247
            //if (ImgListbox.SelectedItem != null)
248
            //{
249
            //    int _CurrentPageNo = -1;
250
            //    if (this.CurrentPage != null)
251
            //    {
252
            //        ViewerDataModel.Instance.SystemMain.dzTopMenu._SaveEvent(null, null);   /// save controls
253

  
254
            //        _CurrentPageNo = this.CurrentPage.PageNumber;
255
            //    }
256

  
257
            //    this.CurrentPage = ImgListbox.SelectedItem as ThumbnailItem;
258
            //    int iPageNo = this.CurrentPage.PageNumber;
259
            //    if(_CurrentPageNo != iPageNo)
260
            //    {
261
            //        PageChanging(this, new PageChangeEventArgs
262
            //        {
263
            //            CurrentPage = this._PageList.Where(p => p.PAGE_NUMBER == iPageNo).First(),
264
            //            PageNumber = iPageNo,
265
            //            PageUri = null
266
            //        });
267
            //    }
268
            //}
269

  
270
            //var border = VisualTreeHelper.GetChild(ImgListbox, 0);
271
            //if (border != null)
272
            //{
273
            //    IEnumerable<ScrollViewer> scrollViewer = border.ChildrenOfType<ScrollViewer>();
274

  
275
            //}
276
            //ScrollViewer scrollViewer = (sender as RadListBox) as ScrollViewer;
277

  
278
            
279
            //System.Diagnostics.Debug.WriteLine("page:"+ImgListbox.SelectedIndex);
261
                }
280 262
        }
281 263

  
282 264
        public bool GotoPageFlag = false;
......
498 480
            await this.Dispatcher.InvokeAsync(() => ThumbnailSetAsync());
499 481
        }
500 482

  
501
        public void SetCommentList(List<UsersCommentPagesMember> UsersCommentPagesList)
483
        public void SetCommentList(List<UsersCommentPagesMember> UsersCommentPagesList,CancellationToken? cts)
502 484
        {
503 485
            Logger.sendCheckLog("SetCommentList", 1);
504 486
            Logger.sendCheckLog("SetCommentList_기존 Comment 색상 제거", 1);
......
524 506
                {
525 507
                    _delItem.Add(item);
526 508
                }
509

  
510
                if (cts != null)
511
                {
512
                    if (cts.Value.IsCancellationRequested)
513
                        return;
514
                }
527 515
            });
528 516

  
529 517
            _delItem.ForEach(f => this.UsersCommentPagesList.Remove(f));
......
557 545
                        setColorMarkupItems.Add(new SetColorMarkupItem { DisplayColor = user.SetColor, markupID = user.MarkupInfoID, Page = page });
558 546
                        
559 547
                    }
560
                        
548

  
549
                    if (cts != null)
550
                    {
551
                        if (cts.Value.IsCancellationRequested)
552
                            return;
553
                    }
561 554
                });
562 555
            });
563 556

  
......
689 682
            }
690 683
        }
691 684

  
685

  
692 686
        private async void Border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
693 687
        {
694 688
            if (e.ClickCount >= 2)
......
697 691

  
698 692
                GotoPage(selectItem.PageNumber);
699 693

  
700
                var result = await MarkupParser.GetBaseControlAsync(selectItem.Data);
694
                var result = await MarkupParser.GetBaseControlAsync(selectItem.Data, ViewerDataModel.Instance.CancellationToken());
701 695

  
702 696
                Rect rect = new Rect(new Point(result.StartPoint.X - 100, result.StartPoint.Y - 100), new Point(result.EndPoint.X + 100, result.EndPoint.Y + 100));
703 697
                this.ParentOfType<KCOM.Views.MainMenu>().zoomAndPanControl.ZoomTo(rect);
......
770 764
                    MarkupInfoItemSmall gaza = clickButtonItem.CommandParameter as MarkupInfoItemSmall;
771 765
                    GotoPage(Convert.ToInt32(gaza.PageNumber));
772 766

  
773
                    var data = await MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressStringAsync(gaza.Data.ToString()); //언패킹작업
767
                    var data = await MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressStringAsync(gaza.Data.ToString(),ViewerDataModel.Instance.CancellationToken()); //언패킹작업
774 768
                    switch (Enum.Parse(typeof(MarkupToPDF.Controls.Common.ControlType), gaza.Data_Type.ToString()))
775 769
                    {
776 770
                        case MarkupToPDF.Controls.Common.ControlType.TextControl:
......
883 877
            }
884 878
        }
885 879

  
886

  
887 880
        private void btGotoMarkup_Click(object sender, RoutedEventArgs e)
888 881
        {
889 882
            var clickButtonItem = sender as RadButton;
......
1286 1279
            }
1287 1280
            foreach (var item in list)
1288 1281
            {
1289
                var data = await MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressStringAsync(item.Data.ToString());
1282
                var data = await MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressStringAsync(item.Data.ToString(), ViewerDataModel.Instance.CancellationToken());
1290 1283

  
1291 1284
                switch (Enum.Parse(typeof(MarkupToPDF.Controls.Common.ControlType), item.Data_Type.ToString()))
1292 1285
                {

내보내기 Unified diff

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