프로젝트

일반

사용자정보

개정판 d62c0439

IDd62c0439bafb70567987eb36faf5072dce67e0ea
상위 064efb98
하위 d0b39faa

백흠경이(가) 5년 이상 전에 추가함

issue #923: remove undo after selecting item, fixed multi selection logic

Change-Id: Id2a6e63336747aeaf3337218f5e2e3b35fba5dfa

차이점 보기:

KCOM/Events/Implementation/TopMenuEvent.cs
307 307
        /// <param name="e"></param>
308 308
        public void SaveEvent(object sender, RoutedEventArgs e)
309 309
        {
310
            this.ParentOfType<MainWindow>().dzMainMenu.EmptyControlCheck();
311

  
312 310
            if (this.ParentOfType<MainWindow>().dzMainMenu.busyIndicator.IsBusy == true) return;
313 311

  
314 312
            this.ParentOfType<MainWindow>().dzMainMenu.busyIndicator.IsBusy = true;
......
322 320
        }
323 321

  
324 322
        /// <summary>
325
        /// save document
323
        /// save markup
326 324
        /// </summary>
327 325
        /// <param name="sender"></param>
328 326
        /// <param name="e"></param>
329 327
        public void _SaveEvent(object sender, RoutedEventArgs e)
330 328
        {
329
            var menu = this.ParentOfType<MainWindow>().dzMainMenu;
331 330
            try
332 331
            {
333 332
                SelectionSet.Instance.UnSelect(this.ParentOfType<MainWindow>().dzMainMenu);
334 333

  
335 334
                this.ParentOfType<MainWindow>().dzMainMenu.InkControl_Convert();
336 335

  
337
                var menu = this.ParentOfType<MainWindow>().dzMainMenu;
338

  
339
                //코멘트가 없을 경우
340
                if (ViewerDataModel.Instance.MarkupList_USER.Count == 0)
341
                {
342
                    foreach (var item in menu.gridViewMarkup.SelectedItems)
343
                    {
344
                        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
345
                        {
346
                            this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem));
347
                            return;
348
                        }
349
                    }
350
                }
351

  
352
                menu.ChangeCommentReact();
353

  
354 336
                if (menu.PreviewUserMarkupInfoItem != null && menu.PreviewUserMarkupInfoItem.IsPreviewUser == true)
355 337
                {
356
                    RefactoryCommentReact(menu);
338
                    this.ExecuteSaveCommand(menu);
357 339
                }
358 340
                else if (menu.gridViewMarkup.SelectedItems.Count == 0 && menu.gridViewMarkup.Items.Count > 0)
359 341
                {
......
366 348
                    {
367 349
                        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
368 350
                        {
369
                            RefactoryCommentReact(menu);
351
                            this.ExecuteSaveCommand(menu);
370 352
                            ViewerDataModel.Instance._markupInfoList.Where(data => data.MarkupInfoID == (item as IKCOM.MarkupInfoItem).MarkupInfoID).FirstOrDefault().UpdateTime = DateTime.Now;
371

  
372 353
                            if (ViewerDataModel.Instance.IsConsolidate)
373 354
                            {
374 355
                                return;
375 356
                            }
376 357

  
377
                            menu.gridViewMarkup.ItemsSource = null;
378
                            menu.gridViewMarkup.ItemsSource = ViewerDataModel.Instance._markupInfoList;
379
                            menu.gridViewMarkup.SelectedItem = item;
380
                            GroupDescriptor descriptor = new GroupDescriptor();
381
                            descriptor.Member = "Depatment";
382
                            descriptor.DisplayContent = "DEPT";
383
                            descriptor.SortDirection = ListSortDirection.Ascending;
384
                            menu.gridViewMarkup.GroupDescriptors.Add(descriptor);
385

  
386 358
                            if (sender != null)
387 359
                            {
388 360
                                if (ViewerDataModel.Instance.IsPressCtrl)
......
410 382
            }
411 383
            finally
412 384
            {
385
                /// delete markup information when 코멘트가 없을 경우
386
                if (ViewerDataModel.Instance.MyMarkupList.Count == 0)
387
                {
388
                    foreach (var item in menu.gridViewMarkup.SelectedItems)
389
                    {
390
                        if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
391
                        {
392
                            this.ParentOfType<MainWindow>().dzMainMenu.DeleteItem((item as IKCOM.MarkupInfoItem));
393
                        }
394
                    }
395
                }
413 396
            }
414 397
        }
415 398

  
416
		public void RefactoryCommentReact(MainMenu menu)
399
        /// <summary>
400
        /// call save command
401
        /// </summary>
402
        /// <param name="menu"></param>
403
		private void ExecuteSaveCommand(MainMenu menu)
417 404
        {
418
            this.ParentOfType<MainWindow>().dzMainMenu.InkControl_Convert();
419

  
420 405
            SaveCommand.Instance.Project_No = App.ViewInfo.ProjectNO;
421 406
            SaveCommand.Instance.document_id = App.ViewInfo.DocumentItemID;
422 407
            SaveCommand.Instance.user_id = App.ViewInfo.UserID;
......
424 409

  
425 410
            try
426 411
            {
427
                List<IKCOM.MarkupInfoItem> MySelectItem = new List<IKCOM.MarkupInfoItem>();
412
                this.ParentOfType<MainWindow>().dzMainMenu.InkControl_Convert();
413

  
414
                List<IKCOM.MarkupInfoItem> SelectedMarkupInfos = new List<IKCOM.MarkupInfoItem>();
428 415
                foreach (var item in menu.gridViewMarkup.SelectedItems)
429 416
                {
430 417
                    if ((item as IKCOM.MarkupInfoItem).UserID == App.ViewInfo.UserID)
431 418
                    {
432
                        MySelectItem.Add(item as IKCOM.MarkupInfoItem);
419
                        SelectedMarkupInfos.Add(item as IKCOM.MarkupInfoItem);
433 420
                    }
434 421
                }
435 422

  
436
                menu.ChangeCommentReact();
437
                SaveCommand.Instance.Execute(MySelectItem, SaveCommand.Instance.page_no);
423
                menu.UpdateMyMarkupList();
424
                SaveCommand.Instance.Execute(SelectedMarkupInfos, SaveCommand.Instance.page_no);
438 425
                SaveCommand.Instance.PageAngleSave(App.ViewInfo.ProjectNO, ViewerDataModel.Instance.RotationDocs);
439 426
            }
440 427
            catch (Exception ex)
......
457 444
                SelectionSet.Instance.UnSelect(menu);
458 445
                if (menu.PreviewUserMarkupInfoItem != null && menu.PreviewUserMarkupInfoItem.IsPreviewUser == true)
459 446
                {
460
                    RefactoryCommentReact(menu);
447
                    this.SaveEvent(null, null);
461 448
                }
462 449
                else if (menu.gridViewMarkup.SelectedItems.Count == 0 || (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem).UserID != App.ViewInfo.UserID)
463 450
                {
......
465 452
                }
466 453
                else
467 454
                {
468
                    RefactoryCommentReact(menu);
455
                    this.SaveEvent(null, null);
469 456
                }
470 457
            }
471 458

  
......
2097 2084
                    #endregion
2098 2085
                    #region Delete
2099 2086
                    case "Delete":
2100
                        DeleteCommand.Instance.Execute(this.ParentOfType<MainWindow>().SelectedItems);
2087
                        DeleteCommand.Instance.Execute(SelectionSet.Instance.SelectedItems);
2101 2088
                        this.ParentOfType<MainWindow>().dzMainMenu.SelectLayer.Children.Clear();
2102 2089

  
2103 2090
                        instanceToggle.IsChecked = false;
......
2178 2165
                                                //MARKUP_DATA UPDATE
2179 2166
                                                //Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.UpdateMarkupData((InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo).CommentID, group_id, App.ViewInfo.ProjectNO);
2180 2167
                                                //Logger.sendReqLog("UpdateMarkupData: ", "", 1);
2181
                                                ViewerDataModel.Instance.MarkupList_USER.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().Group_ID = group_id;
2182
                                                ViewerDataModel.Instance.MarkupList_USER.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().IsUpdate = true;
2168
                                                ViewerDataModel.Instance.MyMarkupList.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().Group_ID = group_id;
2169
                                                ViewerDataModel.Instance.MyMarkupList.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().IsUpdate = true;
2183 2170
                                            }
2184 2171
                                        }
2185 2172
                                    }
......
2218 2205
                                    {
2219 2206
                                        if (!ViewerDataModel.Instance.MarkupControls.Contains(InnerItem.DrawingData))
2220 2207
                                        {
2221
                                            long group_id = ViewerDataModel.Instance.MarkupList_USER.Where(d => d.ID == (InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo).CommentID).FirstOrDefault().Group_ID;
2208
                                            long group_id = ViewerDataModel.Instance.MyMarkupList.Where(d => d.ID == (InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo).CommentID).FirstOrDefault().Group_ID;
2222 2209
                                            //MARKUP_DATA UPDATE
2223 2210
                                            //Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.UpdateMarkupData((InnerItem.DrawingData as MarkupToPDF.Common.CommentUserInfo).CommentID, 0, App.ViewInfo.ProjectNO);
2224 2211
                                            //Logger.sendReqLog("UpdateMarkupData: ", "", 1);
2225
                                            ViewerDataModel.Instance.MarkupList_USER.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().Group_ID = 0;
2226
                                            ViewerDataModel.Instance.MarkupList_USER.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().IsUpdate = true;
2212
                                            ViewerDataModel.Instance.MyMarkupList.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().Group_ID = 0;
2213
                                            ViewerDataModel.Instance.MyMarkupList.Where(d => d.ID == (InnerItem.DrawingData as CommentUserInfo).CommentID).FirstOrDefault().IsUpdate = true;
2227 2214

  
2228 2215

  
2229 2216
                                            //MARKUP_DATA_GROUP UPDATE
......
2439 2426
            {
2440 2427
                if ((item.UserID == App.ViewInfo.UserID) && (ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage != null))
2441 2428
                {
2442
                    var instance = ViewerDataModel.Instance.MarkupList_USER.Where(d => d.PageNumber == ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber &&
2429
                    var instance = ViewerDataModel.Instance.MyMarkupList.Where(d => d.PageNumber == ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber &&
2443 2430
                    d.MarkupInfoID == item.MarkupInfoID).ToList();
2444 2431
                    data = new string[instance.Count];
2445 2432
                    foreach (var markup in instance)

내보내기 Unified diff

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