프로젝트

일반

사용자정보

개정판 79f3f21a

ID79f3f21a6fcd5bf769ba2e2ad92526fe467c9c84
상위 224f1503
하위 fba57365

김동진이(가) 약 6년 전에 추가함

issue #781 text search modify

차이점 보기:

KCOM/Controls/Sample.xaml.cs
676 676

  
677 677
        private void commentUser_SelectionChanged(object sender, SelectionChangedEventArgs e)
678 678
        {
679
            tbSearch.Text = string.Empty;
679 680
            if (e.AddedItems.Count > 0)
680 681
            {
681 682
                if (commentUser.Items.Count > 0)
......
923 924
        private void commentType_SelectionChanged(object sender, SelectionChangedEventArgs e)
924 925
        {
925 926
            gogogo.ItemsSource = null;
927
            tbSearch.Text = string.Empty;
926 928
            if (e.AddedItems.Count >0)
927 929
            {
928 930
                
......
937 939
        private void commentPage_SelectionChanged(object sender, SelectionChangedEventArgs e)
938 940
        {
939 941
            gogogo.ItemsSource = null;
942
            tbSearch.Text = string.Empty;
940 943
            if (e.AddedItems.Count > 0)
941 944
            {
942 945
                gogogo.ItemsSource = MarkupInfoSmallList.Where(d => d.PageNumber == Convert.ToInt32(e.AddedItems[0])).ToList();
......
951 954
        {
952 955
            ViewerDataModel.Instance.SystemMain.dzTopMenu.PanoramaShow();
953 956
        }
957

  
958
        private void btnSearch_Click(object sender, RoutedEventArgs e)
959
        {
960
            string search_str = tbSearch.Text;
961
            var sel_type = commentType.SelectedItem;
962
            var sel_user = commentUser.SelectedItem;
963
            var sel_page = commentPage.SelectedItem;
964
            List<MarkupInfoItemSmall> small_list = new List<MarkupInfoItemSmall>();
965
            List<MarkupInfoItemSmall> list = MarkupInfoSmallList;
966
            if(sel_page !=null)
967
            {
968
                list = list.Where(d => d.PageNumber == Convert.ToInt32(sel_page)).ToList();
969
            }
970
            if(sel_type !=null)
971
            {
972
                list = list.Where(d => d.Data_Type == Convert.ToInt32(sel_type)).ToList();
973
            }
974
            if (sel_user != null)
975
            {
976
                list = list.Where(d => d.UserID == (sel_user as MarkupInfoItem).UserID).ToList();
977
            }
978
            foreach (var item in list)
979
            {
980
                var data = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString(item.Data.ToString());
981
                
982
                switch (Enum.Parse(typeof(MarkupToPDF.Controls.Common.ControlType), item.Data_Type.ToString()))
983
                {                    
984
                    case MarkupToPDF.Controls.Common.ControlType.TextControl:
985
                    case MarkupToPDF.Controls.Common.ControlType.TextBorder:
986
                    case MarkupToPDF.Controls.Common.ControlType.TextCloud:
987
                        {
988
                            MarkupToPDF.Serialize.S_Control.S_TextControl instance = MarkupToPDF.Serialize.Core.JsonSerializerHelper.JsonDeserialize<MarkupToPDF.Serialize.S_Control.S_TextControl>(data);
989
                            if (instance.Text.Contains(search_str))
990
                            {                                
991
                                small_list.Add(item);
992
                            }
993
                        }
994
                        break;
995
                    case MarkupToPDF.Controls.Common.ControlType.ArrowTextBorderControl:
996
                    case MarkupToPDF.Controls.Common.ControlType.ArrowTextCloudControl:
997
                    case MarkupToPDF.Controls.Common.ControlType.ArrowTextControl:
998
                    case MarkupToPDF.Controls.Common.ControlType.ArrowTransTextBorderControl:
999
                    case MarkupToPDF.Controls.Common.ControlType.ArrowTransTextCloudControl:
1000
                    case MarkupToPDF.Controls.Common.ControlType.ArrowTransTextControl:
1001
                        {
1002
                            MarkupToPDF.Serialize.S_Control.S_ArrowTextControl instance = MarkupToPDF.Serialize.Core.JsonSerializerHelper.JsonDeserialize<MarkupToPDF.Serialize.S_Control.S_ArrowTextControl>(data);
1003
                            if (instance.ArrowText.Contains(search_str))
1004
                            {
1005
                                small_list.Add(item);
1006
                            }
1007
                        }
1008
                        break;
1009
                    
1010
                }
1011
                
1012
            }
1013
            
1014
            gogogo.ItemsSource = null;
1015
            gogogo.ItemsSource = small_list.OrderBy(d => d.PageNumber).ToList();
1016
            tbSearch.Text = string.Empty;
1017
        }
954 1018
    }
955 1019
}

내보내기 Unified diff

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