프로젝트

일반

사용자정보

개정판 eeb0a39c

IDeeb0a39ca8180c29d5415f829d103499821735f1
상위 1f686727
하위 14bbabc0

김태성이(가) 약 5년 전에 추가함

Master 변경

Change-Id: I88bac84fa474fd4c174dc1fffa19eae5303ba2bc

차이점 보기:

KCOM/Controls/Sample.xaml.cs
162 162
        /// <param name="sender"></param>
163 163
        /// <param name="e"></param>
164 164
        private void ImgListbox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
165
        {            
166
            if (ImgListbox.SelectedItem != null)
165
        {
166
            if(e.AddedItems.Count > 0)
167 167
            {
168
                int _CurrentPageNo = -1;
169
                if (this.CurrentPage != null)
170
                {
171
                    this.ParentOfType<MainWindow>().dzTopMenu._SaveEvent(null, null);   /// save controls
172
                    _CurrentPageNo = this.CurrentPage.PageNumber;
173
                }
168
                var number = (e.AddedItems[0] as KCOM.Common.ThumbnailItem).PageNumber;
169

  
170
                ViewerDataModel.Instance.SystemMain.dzTopMenu._SaveEvent(null, null);   /// save controls
174 171

  
175
                this.CurrentPage = ImgListbox.SelectedItem as ThumbnailItem;
176
                int iPageNo = this.CurrentPage.PageNumber;
177
                if(_CurrentPageNo != iPageNo)
172
                this.CurrentPage = e.AddedItems[0] as KCOM.Common.ThumbnailItem;
173

  
174
                PageChanging(this, new PageChangeEventArgs
178 175
                {
179
                    PageChanging(this, new PageChangeEventArgs
180
                    {
181
                        CurrentPage = this._PageList.Where(p => p.PAGE_NUMBER == iPageNo).First(),
182
                        PageNumber = iPageNo,
183
                        PageUri = null
184
                    });
185
                }
176
                    CurrentPage = this._PageList.Where(p => p.PAGE_NUMBER == number).First(),
177
                    PageNumber = number,
178
                    PageUri = null
179
                });
186 180
            }
181
            
182

  
183
            //if (ImgListbox.SelectedItem != null)
184
            //{
185
            //    int _CurrentPageNo = -1;
186
            //    if (this.CurrentPage != null)
187
            //    {
188
            //        ViewerDataModel.Instance.SystemMain.dzTopMenu._SaveEvent(null, null);   /// save controls
189

  
190
            //        _CurrentPageNo = this.CurrentPage.PageNumber;
191
            //    }
192

  
193
            //    this.CurrentPage = ImgListbox.SelectedItem as ThumbnailItem;
194
            //    int iPageNo = this.CurrentPage.PageNumber;
195
            //    if(_CurrentPageNo != iPageNo)
196
            //    {
197
            //        PageChanging(this, new PageChangeEventArgs
198
            //        {
199
            //            CurrentPage = this._PageList.Where(p => p.PAGE_NUMBER == iPageNo).First(),
200
            //            PageNumber = iPageNo,
201
            //            PageUri = null
202
            //        });
203
            //    }
204
            //}
187 205

  
188 206
            //var border = VisualTreeHelper.GetChild(ImgListbox, 0);
189 207
            //if (border != null)
......
686 704
            }
687 705
        }
688 706

  
689
        private void commentUser_SelectionChanged(object sender, SelectionChangedEventArgs e)
690
        {
691
            MarkupList.ItemsSource = null;
692
            txtSearch.Text = string.Empty;
693

  
694
            List<MarkupInfoItemSmall> TempMarkupInfoSmallList = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
695

  
696
            if (commentType.SelectedValue != null) { TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.Data_Type == Convert.ToInt32(commentType.SelectedValue)).ToList(); }
697

  
698
            if (commentUser.SelectedValue != null) { TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.UserName == ((KCOM.Common.UsersCommentPagesMember)commentUser.SelectedValue).UserName).ToList(); }
699

  
700
            if (commentPage.SelectedValue != null) { TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.PageNumber == Convert.ToInt32(commentPage.SelectedValue)).ToList(); }
701

  
702
            MarkupList.ItemsSource = TempMarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
703
        }
704

  
705 707
        public class MarkupInfoItemSmall
706 708
        {
707 709
            public string Id { get; set; }
......
710 712
            public int PageNumber { get; set; }
711 713
            public string Data { get; set; }
712 714
            public int Data_Type { get; set; }
715
            public bool IsConsolidate { get; set; }
713 716
        }
714 717

  
715 718
        private List<MarkupInfoItemSmall> _MarkupInfoSmallList { get; set; }
......
1051 1054
                    {
1052 1055
                        d.MarkupList.ForEach(b =>
1053 1056
                        {
1057
                            bool isConsolidate = false;
1058

  
1059
                            if(d.Consolidate == 1 && d.AvoidConsolidate == 0)
1060
                            {
1061
                                isConsolidate = true;
1062
                            }
1063

  
1064
                            System.Diagnostics.Debug.WriteLine($"UserID : {d.UserID} Consolidate : {d.Consolidate}  AvoidConsolidate : {d.AvoidConsolidate}");
1065

  
1054 1066
                            MarkupInfoSmallList.Add(new MarkupInfoItemSmall
1055 1067
                            {
1056 1068
                                Id = b.ID,
......
1059 1071
                                PageNumber = b.PageNumber,
1060 1072
                                UserID = d.UserID,
1061 1073
                                UserName = d.UserName,
1074
                                IsConsolidate = isConsolidate
1075

  
1062 1076
                            });
1063 1077
                        });
1064 1078
                    }
......
1066 1080
                MarkupList.ItemsSource = null;
1067 1081
                MarkupList.ItemsSource = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
1068 1082

  
1069
                commentPage.ItemsSource = MarkupInfoSmallList.Select(d => d.PageNumber).Distinct().OrderBy(d => d).ToList();
1070
                commentType.ItemsSource = MarkupInfoSmallList.Select(d => d.Data_Type).Distinct().OrderBy(d => d).ToList();
1083
                FilterUpdate();
1071 1084
            }
1072 1085
        }
1073 1086

  
......
1095 1108
                });
1096 1109
                MarkupList.ItemsSource = null;
1097 1110
                MarkupList.ItemsSource = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
1098
                commentPage.ItemsSource = MarkupInfoSmallList.Select(d => d.PageNumber).Distinct().OrderBy(d => d).ToList();
1099
                commentType.ItemsSource = MarkupInfoSmallList.Select(d => d.Data_Type).Distinct().OrderBy(d => d).ToList();
1100 1111
            }
1101 1112

  
1102 1113
            switch (eventType)
......
1142 1153
            }
1143 1154

  
1144 1155
            List<MarkupInfoItemSmall> TempMarkupInfoSmallList = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
1145
            if (commentType.SelectedValue != null) { TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.Data_Type == Convert.ToInt32(commentType.SelectedValue)).ToList(); }
1146 1156

  
1147
            if (commentUser.SelectedValue != null) { TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.UserName == ((KCOM.Common.UsersCommentPagesMember)commentUser.SelectedValue).UserName).ToList();                 }            
1157
            bool IsConsolidation = false;
1158
            string UserId = null;
1159

  
1160
            if (commentUser.SelectedValue != null)
1161
            {
1162
                if (((KCOM.Common.UsersCommentPagesMember)commentUser.SelectedValue).UserName != "Consolidated")
1163
                {
1164
                    UserId = ((KCOM.Common.UsersCommentPagesMember)commentUser.SelectedValue).UserName;
1165
                }
1166
                else
1167
                {
1168
                    IsConsolidation = true;
1169
                }
1170
            }
1171

  
1172
            var filterItems = TempMarkupInfoSmallList.WhereIf(commentType.SelectedValue != null, d => d.Data_Type == Convert.ToInt32(commentType.SelectedValue))
1173
                                 .WhereIf(UserId != null, d => d.UserName == ((KCOM.Common.UsersCommentPagesMember)commentUser.SelectedValue).ToString())
1174
                                 .WhereIf(commentPage.SelectedValue != null, d => d.PageNumber == Convert.ToInt32(commentPage.SelectedValue));
1148 1175

  
1149
            if (commentPage.SelectedValue != null) { TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.PageNumber == Convert.ToInt32(commentPage.SelectedValue)).ToList(); }
1176
            MarkupList.ItemsSource = TempMarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
1150 1177

  
1151
            MarkupList.ItemsSource = TempMarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();            
1152
           
1153
            commentType.ItemsSource = MarkupInfoSmallList.Select(d => d.Data_Type).Distinct().OrderBy(d => d).ToList();
1154
            commentPage.ItemsSource = MarkupInfoSmallList.Select(d => d.PageNumber).Distinct().OrderBy(d => d).ToList();            
1178
            FilterUpdate();
1155 1179
        }
1156 1180

  
1157
        private void commentType_SelectionChanged(object sender, SelectionChangedEventArgs e)
1181
        private void FilterUpdate(string selectUser = null)
1158 1182
        {
1159
            MarkupList.ItemsSource = null;
1160
            txtSearch.Text = string.Empty;
1161
            List<MarkupInfoItemSmall> TempMarkupInfoSmallList = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
1162
            if (commentType.SelectedValue != null) { TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.Data_Type == Convert.ToInt32(commentType.SelectedValue)).ToList(); }
1183
            //var items = MarkupList.ItemsSource as List<MarkupInfoItemSmall>;
1163 1184

  
1164
            if (commentUser.SelectedValue != null) { TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.UserName == ((IKCOM.MarkupInfoItem)commentUser.SelectedValue).UserName).ToList(); }
1185
            //commentType.ItemsSource = items.Select(d => d.Data_Type).Distinct().OrderBy(d => d).ToList();
1186
            //commentPage.ItemsSource = items.Select(d => d.PageNumber).Distinct().OrderBy(d => d).ToList();
1165 1187

  
1166
            if (commentPage.SelectedValue != null) { TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.PageNumber == Convert.ToInt32(commentPage.SelectedValue)).ToList(); }
1167 1188

  
1168
            MarkupList.ItemsSource = TempMarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
1189
            var items = MarkupList.ItemsSource as List<MarkupInfoItemSmall>;
1190
 
1191
            var filterUsers = MarkupInfoSmallList.WhereIf(commentType.SelectedValue != null, d => d.Data_Type == Convert.ToInt32(commentType.SelectedValue))
1192
                                   .WhereIf(commentPage.SelectedValue != null, d => d.PageNumber == Convert.ToInt32(commentPage.SelectedValue));
1193

  
1194
            var filterTypes = MarkupInfoSmallList.WhereIf(selectUser != null, d => d.UserName == selectUser)
1195
                                .WhereIf(commentPage.SelectedValue != null, d => d.PageNumber == Convert.ToInt32(commentPage.SelectedValue));
1196

  
1197
            var filterPages = MarkupInfoSmallList.WhereIf(commentType.SelectedValue != null, d => d.Data_Type == Convert.ToInt32(commentType.SelectedValue))
1198
                              .WhereIf(selectUser != null, d => d.UserName == selectUser);
1199

  
1200
            commentUser.ItemsSource = filterUsers.Select(d => d.UserName).Distinct().OrderBy(d => d).ToList();
1201
            commentType.ItemsSource = filterTypes.Select(d => d.Data_Type).Distinct().OrderBy(d => d).ToList();
1202
            commentPage.ItemsSource = filterPages.Select(d => d.PageNumber).Distinct().OrderBy(d => d).ToList();
1169 1203
        }
1170 1204

  
1171
        private void commentPage_SelectionChanged(object sender, SelectionChangedEventArgs e)
1205
        
1206

  
1207
        private void commentFilter_SelectionChanged(object sender, SelectionChangedEventArgs e)
1172 1208
        {
1173 1209
            MarkupList.ItemsSource = null;
1174 1210
            txtSearch.Text = string.Empty;
1175 1211

  
1176 1212
            List<MarkupInfoItemSmall> TempMarkupInfoSmallList = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
1177
            if (commentType.SelectedValue != null) { TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.Data_Type == Convert.ToInt32(commentType.SelectedValue)).ToList(); }
1178 1213

  
1179
            if (commentUser.SelectedValue != null) { TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.UserName == ((IKCOM.MarkupInfoItem)commentUser.SelectedValue).UserName).ToList(); }
1214
            bool IsConsolidation = false;
1215
            string userName = null;
1180 1216

  
1181
            if (commentPage.SelectedValue != null) { TempMarkupInfoSmallList = TempMarkupInfoSmallList.Where(d => d.PageNumber == Convert.ToInt32(commentPage.SelectedValue)).ToList(); }
1217
            if (commentUser.SelectedValue != null)
1218
            {
1219
                if(commentUser.SelectedValue?.ToString() != "Consolidated")
1220
                {
1221
                    userName = commentUser.SelectedValue.ToString();
1222
                }
1223
                else
1224
                {
1225
                    IsConsolidation = true;
1226
                }
1227
            }
1182 1228

  
1183
            MarkupList.ItemsSource = TempMarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
1229
            var filterItems = TempMarkupInfoSmallList.WhereIf(commentType.SelectedValue != null, d => d.Data_Type == Convert.ToInt32(commentType.SelectedValue))
1230
                                   .WhereIf(userName != null, d => d.UserName == userName)
1231
                                   .WhereIf(IsConsolidation,d=>d.IsConsolidate == IsConsolidation)
1232
                                   .WhereIf(commentPage.SelectedValue != null, d => d.PageNumber == Convert.ToInt32(commentPage.SelectedValue));
1233

  
1234
            MarkupList.ItemsSource = filterItems.OrderBy(d => d.PageNumber).ToList();
1235

  
1236
            FilterUpdate();
1184 1237
        }
1185 1238

  
1186 1239
        private void btnPanorama_Click(object sender, RoutedEventArgs e)

내보내기 Unified diff

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