프로젝트

일반

사용자정보

개정판 39f0624f

ID39f0624f0dbcbc7eead3e7b5aad58ff314a2edbf
상위 b9b3b659
하위 2db955fd

이지연이(가) 5년 이상 전에 추가함

issue #564 Markup List 동기화 수정중..

Change-Id: I7ef97cfe1e719e9f77cb2d195162a3dc68e128fe

차이점 보기:

KCOM/Controls/Sample.xaml.cs
26 26
        public List<FAVORITE_DOC> _FavoriteSet { get; set; }
27 27
        public event PropertyChangedEventHandler PropertyChanged;
28 28
        public Sample()
29
        {
30
            //InitializeComponent();   
29
        {             
31 30
            App.splashString(ISplashMessage.SAMPLE);
32 31
            this.Loaded += Sample_Loaded;
33
            //_Initialize = true;
34

  
35
            //lstSelectComment.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(lstSelectComment_SelectionChanged);
36
            //ImgListbox.MouseDoubleClick += ImgListbox_MouseDoubleClick;
37 32
        }
38 33

  
39 34
        private void Sample_Loaded(object sender, RoutedEventArgs e)
......
41 36
            if(!_Initialize)
42 37
            {
43 38
                InitializeComponent();
44
                //System.Diagnostics.Debug.WriteLine("Sample() : " + sw.ElapsedMilliseconds.ToString() + "ms");
45

  
46 39
                _Initialize = true;
47 40
                this.lstSelectComment.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(lstSelectComment_SelectionChanged);
48 41
                this.ImgListbox.SelectionChanged += new SelectionChangedEventHandler(ImgListbox_SelectionChanged);                
......
54 47
        private string _DefaultUri = null;
55 48
        public ThumbnailItem CurrentPage = null;
56 49
        public int PageCount = 0;
57

  
58 50
        private bool _Initialize;
59 51
        public event EventHandler<PageChangeEventArgs> PageChanged;
60 52
        public event EventHandler<PageChangeEventArgs> PageChanging;
......
65 57
            public string PageUri { get; set; }
66 58
            public int PageNumber { get; set; }
67 59
        }
68

  
69 60
        private bool _IsFitOn { get; set; }
70 61
        public bool IsFitOn
71 62
        {
......
99 90
            expCommentPages.PreviewCollapsed += new Telerik.Windows.RadRoutedEventHandler(expCommentPages_PreviewCollapsed);
100 91
            expCommentPages.PreviewExpanded += new Telerik.Windows.RadRoutedEventHandler(expCommentPages_PreviewExpanded);
101 92
        }
93

  
102 94
        void rdoCommented_Checked(object sender, RoutedEventArgs e)
103 95
        {
104 96
            Logger.sendCheckLog("rdoCommented_Checked", 1);
......
385 377
        {
386 378
            SetCommentPages();
387 379
        }
388

  
389

  
380
        
390 381
        void user_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
391 382
        {
392 383
            SetCommentPages();
393 384
            //System.Diagnostics.Debug.WriteLine(e.PropertyName);
394 385
        }
386

  
395 387
        public void SetCommentPages()
396 388
        {
397 389
            ThumbnailSet();
......
629 621
        {
630 622
            if (e.ClickCount >= 2)
631 623
            {
632
                var selectItem = gogogo.SelectedItem as IKCOM.MarkupItem;
624
                var selectItem = MarkupList.SelectedItem as IKCOM.MarkupItem;
633 625
                GotoPage(selectItem.PageNumber);
634 626
                var result = MarkupParser.GetBaseControl(selectItem.Data);
635 627
                Rect rect = new Rect(new Point(result.StartPoint.X - 100, result.StartPoint.Y - 100), new Point(result.EndPoint.X + 100, result.EndPoint.Y + 100));
......
650 642
                //};
651 643
                //imageViewer.SizeMode = Leadtools.Windows.Controls.SizeMode.Normal;
652 644

  
653
                //GotoPage(gogogo.SelectedItem as MarkupList)
645
                //GotoPage(MarkupList.SelectedItem as MarkupList)
654 646
            }
655 647
        }
656 648

  
657 649
        private void commentUser_SelectionChanged(object sender, SelectionChangedEventArgs e)
658 650
        {
659
            gogogo.ItemsSource = null;
651
            MarkupList.ItemsSource = null;
660 652
            tbSearch.Text = string.Empty;
661 653

  
662
            //List<MarkupInfoItemSmall> TempMarkupInfoSmallList = new List<MarkupInfoItemSmall>();
663
            TempMarkupInfoSmallList = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
664
            if (commentType.SelectedValue != null)
665
            {
666
                TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.Data_Type == Convert.ToInt32(commentType.SelectedValue)).ToList();
667
            }
654
            List<MarkupInfoItemSmall> TempMarkupInfoSmallList = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
668 655

  
669
            if (commentUser.SelectedValue != null)
670
            {
671
                TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.UserName == ((IKCOM.MarkupInfoItem)commentUser.SelectedValue).UserName).ToList();
672
            }
656
            if (commentType.SelectedValue != null) { TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.Data_Type == Convert.ToInt32(commentType.SelectedValue)).ToList(); }
673 657

  
674
            if (commentPage.SelectedValue != null)
675
            {
676
                TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.PageNumber == Convert.ToInt32(commentPage.SelectedValue)).ToList();
677
            }
658
            if (commentUser.SelectedValue != null) { TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.UserName == ((IKCOM.MarkupInfoItem)commentUser.SelectedValue).UserName).ToList(); }
678 659

  
679
            gogogo.ItemsSource = TempMarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
660
            if (commentPage.SelectedValue != null) { TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.PageNumber == Convert.ToInt32(commentPage.SelectedValue)).ToList(); }
680 661

  
681
            /*
682
            tbSearch.Text = string.Empty;
683
            if (e.AddedItems.Count > 0)
684
            {
685
                if (commentUser.Items.Count > 0)
686
                {
687
                    MarkupInfoSmallList.Clear();
688
                    #region 주석
689
                    //var d = e.AddedItems.Cast<MarkupInfoItem>().FirstOrDefault().MarkupList.First();
690
                    //d.PageNumber
691

  
692
                    //e.AddedItems.Cast<MarkupInfoItem>().FirstOrDefault().MarkupList.First().
693
                    //gogo.DataContext = e.AddedItems.Cast<MarkupInfoItem>().FirstOrDefault().MarkupList;
694

  
695
                    //gogogo.ItemsSource = e.AddedItems.Cast<MarkupInfoItem>().FirstOrDefault().MarkupList;
696
                    //gogogo.ItemsSource = ViewerDataModel.Instance._markupInfoList.Where(d=>d.UserName ==  sender as RadCombo
697
                    #endregion
698
                    var temp = e.AddedItems.Cast<MarkupInfoItem>().FirstOrDefault();
699
                    var markuplist = ViewerDataModel.Instance.MyMarkupList.Where(d => d.MarkupInfoID == temp.MarkupInfoID).ToList();
700
                    markuplist.ForEach(d =>
701
                    {
702
                        MarkupInfoSmallList.Add(new MarkupInfoItemSmall
703
                        {
704
                            Data = d.Data,
705
                            Data_Type = d.Data_Type,
706
                            PageNumber = d.PageNumber,
707
                            UserID = temp.UserID,
708
                            UserName = temp.UserName,
709
                        });
710
                    });
711
                    gogogo.ItemsSource = null;
712
                    gogogo.ItemsSource = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
713
                }
714
            }
715
            else
716
            {
717
                MarkupInfoSmallList.Clear();
718
                ViewerDataModel.Instance._markupInfoList.ToList().ForEach(d =>
719
                {
720
                    var markuplist = ViewerDataModel.Instance.MyMarkupList.Where(u => u.MarkupInfoID == d.MarkupInfoID).ToList();
721

  
722
                    markuplist.ForEach(b =>
723
                    {
724
                        MarkupInfoSmallList.Add(new MarkupInfoItemSmall
725
                        {
726
                            Data = b.Data,
727
                            Data_Type = b.Data_Type,
728
                            PageNumber = b.PageNumber,
729
                            UserID = d.UserID,
730
                            UserName = d.UserName,
731
                        });
732
                    });
733

  
734
                });
735
                
736
                gogogo.ItemsSource = null;
737
                gogogo.ItemsSource = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
738
            }
739
            */
662
            MarkupList.ItemsSource = TempMarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
740 663
        }
741 664

  
742 665
        public class MarkupInfoItemSmall
......
749 672
            public int Data_Type { get; set; }
750 673
        }
751 674

  
752
        List<MarkupInfoItemSmall> TempMarkupInfoSmallList = new List<MarkupInfoItemSmall>();
753 675
        private List<MarkupInfoItemSmall> _MarkupInfoSmallList { get; set; }
754 676
        public List<MarkupInfoItemSmall> MarkupInfoSmallList
755 677
        {
......
901 823
            }
902 824
        }
903 825

  
904
        private void gogogo_Loaded(object sender, RoutedEventArgs e)
826
        private void MarkupList_Loaded(object sender, RoutedEventArgs e)
905 827
        {
906 828
            if (MarkupInfoSmallList.Count == 0)
907 829
            {
......
923 845
                        });
924 846
                    }
925 847
                });
926
                gogogo.ItemsSource = null;
927
                gogogo.ItemsSource = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
848
                MarkupList.ItemsSource = null;
849
                MarkupList.ItemsSource = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
928 850

  
929 851
                commentPage.ItemsSource = MarkupInfoSmallList.Select(d => d.PageNumber).Distinct().OrderBy(d => d).ToList();
930 852
                commentType.ItemsSource = MarkupInfoSmallList.Select(d => d.Data_Type).Distinct().OrderBy(d => d).ToList();
931 853
            }
932 854
        }
933 855

  
934
        public void markupListUpdate(MarkupReturn res, Event_Type eventType, string CommentID, MarkupInfoItem item)
856
        public void MarkupListUpdate(MarkupReturn res, Event_Type eventType, string CommentID, MarkupInfoItem item)
935 857
        {
936 858
            if (MarkupInfoSmallList.Count == 0)
937 859
            {
......
953 875
                        });
954 876
                    }
955 877
                });
956
                gogogo.ItemsSource = null;
957
                gogogo.ItemsSource = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
958

  
878
                MarkupList.ItemsSource = null;
879
                MarkupList.ItemsSource = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
959 880
                commentPage.ItemsSource = MarkupInfoSmallList.Select(d => d.PageNumber).Distinct().OrderBy(d => d).ToList();
960 881
                commentType.ItemsSource = MarkupInfoSmallList.Select(d => d.Data_Type).Distinct().OrderBy(d => d).ToList();
961 882
            }
......
986 907
                        MarkupInfoSmallList.RemoveAll(p => p.Id.Equals(CommentID));
987 908
                    }                    
988 909
                    break;
989
                case Event_Type.Thumb://이동 회전,,,,,
910
                case Event_Type.Thumb://이동 회전
990 911
                    MarkupInfoSmallList.RemoveAll(p => p.Id.Equals(res.CommentID));
991 912
                    MarkupInfoSmallList.Add(new MarkupInfoItemSmall
992 913
                    {
......
1000 921
                    break;
1001 922
                default:
1002 923
                    break;
1003
            }            
1004

  
1005
            //TempMarkupInfoSmallList = new List<MarkupInfoItemSmall>();
1006
            TempMarkupInfoSmallList = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
1007
            if (commentType.SelectedValue != null)
1008
            {
1009
                TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.Data_Type == Convert.ToInt32(commentType.SelectedValue)).ToList();
1010 924
            }
1011 925

  
1012
            if (commentUser.SelectedValue != null)
1013
            {
1014
                TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.UserName == ((IKCOM.MarkupInfoItem)commentUser.SelectedValue).UserName).ToList();                
1015
            }            
926
            List<MarkupInfoItemSmall> TempMarkupInfoSmallList = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
927
            if (commentType.SelectedValue != null) { TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.Data_Type == Convert.ToInt32(commentType.SelectedValue)).ToList(); }
1016 928

  
1017
            if (commentPage.SelectedValue != null)
1018
            {
1019
                TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.PageNumber == Convert.ToInt32(commentPage.SelectedValue)).ToList();
1020
            }
929
            if (commentUser.SelectedValue != null) { TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.UserName == ((IKCOM.MarkupInfoItem)commentUser.SelectedValue).UserName).ToList();                 }            
1021 930

  
1022
            gogogo.ItemsSource = TempMarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();            
931
            if (commentPage.SelectedValue != null) { TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.PageNumber == Convert.ToInt32(commentPage.SelectedValue)).ToList(); }
932

  
933
            MarkupList.ItemsSource = TempMarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();            
1023 934
           
1024 935
            commentType.ItemsSource = MarkupInfoSmallList.Select(d => d.Data_Type).Distinct().OrderBy(d => d).ToList();
1025
            commentPage.ItemsSource = MarkupInfoSmallList.Select(d => d.PageNumber).Distinct().OrderBy(d => d).ToList();
1026
            
936
            commentPage.ItemsSource = MarkupInfoSmallList.Select(d => d.PageNumber).Distinct().OrderBy(d => d).ToList();            
1027 937
        }
1028 938

  
1029 939
        private void commentType_SelectionChanged(object sender, SelectionChangedEventArgs e)
1030 940
        {
1031
            gogogo.ItemsSource = null;
941
            MarkupList.ItemsSource = null;
1032 942
            tbSearch.Text = string.Empty;
1033
            /*
1034
            if (e.AddedItems.Count > 0)
1035
            {
1036
                gogogo.ItemsSource = MarkupInfoSmallList.Where(d => d.Data_Type == Convert.ToInt32(e.AddedItems[0])).ToList();
1037
            }
1038
            else
1039
            {
1040
                gogogo.ItemsSource = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
1041
            }
1042
            */
943
            List<MarkupInfoItemSmall> TempMarkupInfoSmallList = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
944
            if (commentType.SelectedValue != null) { TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.Data_Type == Convert.ToInt32(commentType.SelectedValue)).ToList(); }
1043 945

  
1044
           // List<MarkupInfoItemSmall> TempMarkupInfoSmallList = new List<MarkupInfoItemSmall>();
1045
            TempMarkupInfoSmallList = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
1046
            if (commentType.SelectedValue != null)
1047
            {
1048
                TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.Data_Type == Convert.ToInt32(commentType.SelectedValue)).ToList();
1049
            }
946
            if (commentUser.SelectedValue != null) { TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.UserName == ((IKCOM.MarkupInfoItem)commentUser.SelectedValue).UserName).ToList(); }
1050 947

  
1051
            if (commentUser.SelectedValue != null)
1052
            {
1053
                TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.UserName == ((IKCOM.MarkupInfoItem)commentUser.SelectedValue).UserName).ToList();
1054
            }
948
            if (commentPage.SelectedValue != null) { TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.PageNumber == Convert.ToInt32(commentPage.SelectedValue)).ToList(); }
1055 949

  
1056
            if (commentPage.SelectedValue != null)
1057
            {
1058
                TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.PageNumber == Convert.ToInt32(commentPage.SelectedValue)).ToList();
1059
            }
1060

  
1061
            gogogo.ItemsSource = TempMarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
950
            MarkupList.ItemsSource = TempMarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
1062 951
        }
1063 952

  
1064 953
        private void commentPage_SelectionChanged(object sender, SelectionChangedEventArgs e)
1065 954
        {
1066
            gogogo.ItemsSource = null;
955
            MarkupList.ItemsSource = null;
1067 956
            tbSearch.Text = string.Empty;
1068
            /*
1069
            if (e.AddedItems.Count > 0)
1070
            {
1071
                gogogo.ItemsSource = MarkupInfoSmallList.Where(d => d.PageNumber == Convert.ToInt32(e.AddedItems[0])).ToList();
1072
            }
1073
            else
1074
            {
1075
                gogogo.ItemsSource = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
1076
            }
1077
            */
1078 957

  
1079
            //List<MarkupInfoItemSmall> TempMarkupInfoSmallList = new List<MarkupInfoItemSmall>();
1080
            TempMarkupInfoSmallList = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
1081
            if (commentType.SelectedValue != null)
1082
            {
1083
                TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.Data_Type == Convert.ToInt32(commentType.SelectedValue)).ToList();
1084
            }
958
            List<MarkupInfoItemSmall> TempMarkupInfoSmallList = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
959
            if (commentType.SelectedValue != null) { TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.Data_Type == Convert.ToInt32(commentType.SelectedValue)).ToList(); }
1085 960

  
1086
            if (commentUser.SelectedValue != null)
1087
            {
1088
                TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.UserName == ((IKCOM.MarkupInfoItem)commentUser.SelectedValue).UserName).ToList();
1089
            }
961
            if (commentUser.SelectedValue != null) { TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.UserName == ((IKCOM.MarkupInfoItem)commentUser.SelectedValue).UserName).ToList(); }
1090 962

  
1091
            if (commentPage.SelectedValue != null)
1092
            {
1093
                TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.PageNumber == Convert.ToInt32(commentPage.SelectedValue)).ToList();
1094
            }
963
            if (commentPage.SelectedValue != null) { TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.PageNumber == Convert.ToInt32(commentPage.SelectedValue)).ToList(); }
1095 964

  
1096
            gogogo.ItemsSource = TempMarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
965
            MarkupList.ItemsSource = TempMarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
1097 966
        }
1098 967

  
1099 968
        private void btnPanorama_Click(object sender, RoutedEventArgs e)
......
1152 1021
                            }
1153 1022
                        }
1154 1023
                        break;
1155

  
1156 1024
                }
1157

  
1158 1025
            }
1159 1026

  
1160
            gogogo.ItemsSource = null;
1161
            gogogo.ItemsSource = small_list.OrderBy(d => d.PageNumber).ToList();
1027
            MarkupList.ItemsSource = null;
1028
            MarkupList.ItemsSource = small_list.OrderBy(d => d.PageNumber).ToList();
1162 1029
            tbSearch.Text = string.Empty;
1163 1030
        }
1164 1031
    }

내보내기 Unified diff

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