프로젝트

일반

사용자정보

개정판 77922798

ID7792279863f30aac28978e99bd7fe9af32f8e648
상위 c37312da
하위 6282063e

송근호이(가) 5년 이상 전에 추가함

issue #1158 :
1. 원인 CheckList 내에서 MainWindow를 참조하는 (Application.Current.MainWindow as MainWindow) 구문이 '코드 최적화' 되면서
MainWindow로 변환이 안되고 Null 로 변환되어 NullException이 떨어졌습니다.
2. 해결 방법 CheckList UserControl을 Content에 넣어서 RadWindow Show 하기전에 MainWindow 참조를 변수로 받아서 (Application.Current.MainWindow as MainWindow) 구문을 대체 했습니다.

Change-Id: Ib96319bdbe34edfa35a306901f16fc653fe20132

차이점 보기:

KCOM/Controls/CheckList.xaml.cs
79 79
        #region 프로퍼티
80 80
        List<CHECK_LIST> items = new List<CHECK_LIST>();
81 81
        List<Customer> Lists = new List<Customer>();
82
        MainWindow mainWindow;
82 83
        //string old_Revision = "";
83 84
        string old_DocID = "";
84 85
        string Current_Revision = "";
......
91 92
        #endregion
92 93

  
93 94
        #region 생성자
94
        public CheckList()
95
        public CheckList(MainWindow main)
95 96
        {
96 97
            Common.ViewerDataModel.Instance.ViewVisible = Visibility.Visible;
97 98
            InitializeComponent();
99
            mainWindow = main;
98 100
            this.Loaded += CheckList_Loaded;
99 101
            this.KeyDown += new KeyEventHandler(KeyEventDownAction);
100 102
            this.AddHandler(Image.MouseLeftButtonDownEvent, new MouseButtonEventHandler(mousedownOnImage), true);
101 103
            
104

  
102 105
        }
103 106
        #endregion
104 107

  
......
109 112
                Isinit = false;
110 113

  
111 114
                Lists = new List<Customer>();
112
                string doc_no = (Application.Current.MainWindow as MainWindow).dzMainMenu._DocItem.DOCUMENT_NO;
115
                string doc_no = mainWindow.dzMainMenu._DocItem.DOCUMENT_NO;
113 116
                string project_no = App.ViewInfo.ProjectNO;
114 117
                string user_id = App.ViewInfo.UserID;
115 118

  
......
385 388
        {
386 389
            try
387 390
            {
388
                if ((Application.Current.MainWindow as MainWindow).dzMainMenu.mouseHandlingMode == MouseHandlingMode.Capture)
391
                if (mainWindow.dzMainMenu.mouseHandlingMode == MouseHandlingMode.Capture)
389 392
                {
390 393
                    DialogMessage_Alert("Capture중 입니다.");
391 394
                    return;
......
445 448
                            }
446 449
                            worksheet.Cells[3, w + 8] = project_name;
447 450

  
448
                            worksheet.Cells[4, w + 8] = (Application.Current.MainWindow as MainWindow).dzMainMenu._DocItem.DOCUMENT_NO;
449
                            worksheet.Cells[5, w + 8] = (Application.Current.MainWindow as MainWindow).dzMainMenu.userData.NAME + " (" + App.ViewInfo.UserID + ")";
451
                            worksheet.Cells[4, w + 8] = (mainWindow as MainWindow).dzMainMenu._DocItem.DOCUMENT_NO;
452
                            worksheet.Cells[5, w + 8] = (mainWindow as MainWindow).dzMainMenu.userData.NAME + " (" + App.ViewInfo.UserID + ")";
450 453
                            worksheet.Cells[6, w + 8] = DateTime.Now.ToString("yyyy.MM.dd");
451 454

  
452 455
                            Excel.Range Range_I = worksheet.Range["K9"];
......
677 680
        {
678 681
            try
679 682
            {
680
                Application.Current.MainWindow.Focus();
683
                mainWindow.Focus();
681 684

  
682 685
                Common.ViewerDataModel.Instance.CheckList_ID = Commons.shortGuid();
683 686
                Common.ViewerDataModel.Instance.Capture_Opacity = 0.5;
684
                (Application.Current.MainWindow as MainWindow).dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Capture;
687
                (mainWindow as MainWindow).dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Capture;
685 688
            }
686 689
            catch(Exception ex)
687 690
            {
......
694 697
        {
695 698
            try
696 699
            {
697
                if ((Application.Current.MainWindow as MainWindow).dzMainMenu.mouseHandlingMode == MouseHandlingMode.Capture)
700
                if ((mainWindow as MainWindow).dzMainMenu.mouseHandlingMode == MouseHandlingMode.Capture)
698 701
                {
699 702
                    DialogMessage_Alert("Capture중 입니다.");
700 703
                    return;
......
876 879
            //Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.GotoPage(((e.Source as Telerik.Windows.Controls.RadButton).DataContext as Customer).PAGENUMBER);
877 880
            Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.GotoPage(((e.Source as Image).DataContext as Customer).PAGENUMBER);
878 881
            Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.zoomAndPanControl.ZoomTo(rect);
879
            Application.Current.MainWindow.Focus();
882
            mainWindow.Focus();
880 883
        }
881 884

  
882 885
        private void CaptureEvent(object sender, MouseButtonEventArgs e)
......
884 887
            SyncInit();
885 888

  
886 889
            //캡쳐 하기 전에 코멘트 저장
887
            if (Common.ViewerDataModel.Instance.MarkupControls_USER.Count > 0 || (Application.Current.MainWindow as MainWindow).dzMainMenu.SelectLayer.Children.Count > 0)
890
            if (Common.ViewerDataModel.Instance.MarkupControls_USER.Count > 0 || (mainWindow as MainWindow).dzMainMenu.SelectLayer.Children.Count > 0)
888 891
            {
889
                var menu = (Application.Current.MainWindow as MainWindow).dzMainMenu;
892
                var menu = (mainWindow as MainWindow).dzMainMenu;
890 893
                SelectionSet.Instance.UnSelect(menu);
891 894
                if (menu.PreviewUserMarkupInfoItem != null && menu.PreviewUserMarkupInfoItem.IsPreviewUser == true)
892 895
                {
893
                    (Application.Current.MainWindow as MainWindow).dzTopMenu.SaveEventCallback(null, null);
896
                    (mainWindow as MainWindow).dzTopMenu.SaveEventCallback(null, null);
894 897
                }
895 898
                else if (menu.gridViewMarkup.SelectedItems.Count == 0 || (menu.gridViewMarkup.SelectedItems.FirstOrDefault() as IKCOM.MarkupInfoItem).UserID != App.ViewInfo.UserID)
896 899
                {
......
898 901
                }
899 902
                else
900 903
                {
901
                    (Application.Current.MainWindow as MainWindow).dzTopMenu.SaveEventCallback(null, null);
904
                    (mainWindow as MainWindow).dzTopMenu.SaveEventCallback(null, null);
902 905
                }
903 906
            }
904 907

  
905 908
            //Common.ViewerDataModel.Instance.CheckList_ID = ((e.Source as Telerik.Windows.Controls.RadButton).DataContext as Customer).ID;
906 909
            Common.ViewerDataModel.Instance.CheckList_ID = ((e.Source as Image).DataContext as Customer).ID;
907 910
            //Common.ViewerDataModel.Instance.PageNumber = ((e.Source as Image).DataContext as Customer).PAGENUMBER;
908
            Application.Current.MainWindow.Focus();
911
            mainWindow.Focus();
909 912
            Common.ViewerDataModel.Instance.Capture_Opacity = 0.49;
910
            (Application.Current.MainWindow as MainWindow).dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Capture;
913
            (mainWindow as MainWindow).dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.Capture;
911 914
        }
912 915

  
913 916
        public void KeyEventDownAction(object sender, KeyEventArgs e)
......
916 919
            {
917 920
                case Key.Escape:
918 921
                    {
919
                        (Application.Current.MainWindow as MainWindow).dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
922
                        (mainWindow as MainWindow).dzMainMenu.mouseHandlingMode = IKCOM.MouseHandlingMode.None;
920 923
                        Common.ViewerDataModel.Instance.Capture_Opacity = 0;
921 924
                    }
922 925
                    break;
......
1194 1197
                rect = new Rect(new Point(double.Parse(RectPoint[0]), double.Parse(RectPoint[1])), new Point(double.Parse(RectPoint[0]) + double.Parse(RectPoint[2]), double.Parse(RectPoint[1]) + double.Parse(RectPoint[3])));
1195 1198
                ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.GotoPage(((e.Source as Image).DataContext as Customer).PAGENUMBER);
1196 1199
                ViewerDataModel.Instance.SystemMain.dzMainMenu.zoomAndPanControl.Sync_ZoomTo(rect);
1197
                (Application.Current.MainWindow as MainWindow).dzMainMenu.Sync_Event(_vpList);
1200
                (mainWindow as MainWindow).dzMainMenu.Sync_Event(_vpList);
1198 1201

  
1199 1202
            }
1200 1203
            catch (Exception ex)
KCOM/Events/Implementation/TopMenuEvent.cs
1343 1343
                isClosed = false;
1344 1344

  
1345 1345
                
1346
                CheckList check = new CheckList();
1346
                CheckList check = new CheckList(this.ParentOfType<MainWindow>());
1347 1347

  
1348 1348
                CheckPop = new RadWindow
1349 1349
                {

내보내기 Unified diff

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