프로젝트

일반

사용자정보

개정판 e1c892f7

IDe1c892f79fc4f24a2a0b11e27f12a5c62a9a198b
상위 c4c41461
하위 abf289f3

김태성이(가) 4년 이상 전에 추가함

- 효성 AutoStamping 서비스 추가

Change-Id: I5d001e75e3c0de5d2475641cf0f771ca541e6e40

차이점 보기:

KCOM/Views/MainMenu.xaml.cs
819 819
            /// 페이지의 모든 마크업을 로드한 후 호출
820 820
            /// 좌측 마크업 list의 아이템을 클릭하는 경우 MarkupControls_USER가 0으로 나와서 추가함.
821 821
            ViewerDataModel.Instance.LoadPageMarkup();
822

  
823
            //Point startPoint = new Point(15, 15);
824

  
825
            
826
            //var markupinfo = ViewerDataModel.Instance._markupInfoList.Where(x => x.UserID == App.ViewInfo.UserID).First();
827

  
828
            ////var rect = GetRectControl(Convert.ToDouble(pageinfo.PAGE_WIDTH), Convert.ToDouble(pageinfo.PAGE_HEIGHT), markupinfo.UserID, markupinfo.MarkupInfoID, startPoint);
829

  
830
            ////var txtApproved = GetTextControl(Convert.ToDouble(pageinfo.PAGE_WIDTH), Convert.ToDouble(pageinfo.PAGE_HEIGHT), markupinfo.UserID, markupinfo.MarkupInfoID,
831
            ////                             "APPROVED",30, FontWeights.Bold, TextAlignment.Center, rect.ItemRect, 15);
832

  
833
            ////var txtCreator = GetTextControl(Convert.ToDouble(pageinfo.PAGE_WIDTH), Convert.ToDouble(pageinfo.PAGE_HEIGHT), markupinfo.UserID, markupinfo.MarkupInfoID
834
            ////                , "By HYOSUNG", 18, FontWeights.Bold, TextAlignment.Center, rect.ItemRect, txtApproved.StartPoint.Y + txtApproved.BoxHeight + 3);
835

  
836
            //var symCtrl = GetSymNControl(Convert.ToDouble(pageinfo.PAGE_WIDTH), Convert.ToDouble(pageinfo.PAGE_HEIGHT), markupinfo.UserID, markupinfo.MarkupInfoID, startPoint);
837

  
838
            //var bottom = Rect.Offset(symCtrl.ItemRect, new Vector(0, symCtrl.ItemRect.Height));
839

  
840
            //var txtOriginator = GetTextControl(Convert.ToDouble(pageinfo.PAGE_WIDTH), Convert.ToDouble(pageinfo.PAGE_HEIGHT), markupinfo.UserID, markupinfo.MarkupInfoID
841
            //               , App.ViewInfo.UserID, 18, FontWeights.Bold, TextAlignment.Left, bottom, bottom.Top + 3);
842

  
843
            //var dtfi = new System.Globalization.DateTimeFormatInfo { DateSeparator = "-", ShortDatePattern = @"yyyy/MM/dd" };
844

  
845
            //var txtDate = GetTextControl(Convert.ToDouble(pageinfo.PAGE_WIDTH), Convert.ToDouble(pageinfo.PAGE_HEIGHT), markupinfo.UserID, markupinfo.MarkupInfoID
846
            //               , DateTime.Now.ToString("d", dtfi), 18, FontWeights.Bold, TextAlignment.Left, bottom, txtOriginator.StartPoint.Y + txtOriginator.BoxHeight + 2);
847

  
848
            //ViewerDataModel.Instance.MarkupControls_USER.Add(symCtrl);
849
            ////ViewerDataModel.Instance.MarkupControls_USER.Add(txtApproved);
850
            ////ViewerDataModel.Instance.MarkupControls_USER.Add(txtCreator);
851
            //ViewerDataModel.Instance.MarkupControls_USER.Add(txtOriginator);
852
            //ViewerDataModel.Instance.MarkupControls_USER.Add(txtDate);
853

  
854
            //symCtrl.ApplyTemplate();
855
            ////txtApproved.ApplyTemplate();
856
            ////txtCreator.ApplyTemplate();
857
            //txtOriginator.ApplyTemplate();
858
            //txtDate.ApplyTemplate();
859

  
860
            ////SetTextControl(txtApproved);
861
            ////SetTextControl(txtCreator);
862
            //SetTextControl(txtOriginator);
863
            //SetTextControl(txtDate);
864

  
865
            //multi_Undo_Data = new Multi_Undo_data();
866

  
867
            //MarkupToPDF.Common.Undo_data UndoData = new Undo_data()
868
            //{
869
            //    IsUndo = false,
870
            //    Event = Event_Type.Create,
871
            //    EventTime = DateTime.Now,
872
            //    Markup_List = new List<Multi_Undo_data>()
873
            //};
874

  
875
            //multi_Undo_Data = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.Control_Style(symCtrl as MarkupToPDF.Common.CommentUserInfo);
876
            //UndoData.Markup_List.Add(multi_Undo_Data);
877

  
878
            ////multi_Undo_Data = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.Control_Style(txtApproved as MarkupToPDF.Common.CommentUserInfo);
879
            ////UndoData.Markup_List.Add(multi_Undo_Data);
880

  
881
            ////multi_Undo_Data = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.Control_Style(txtCreator as MarkupToPDF.Common.CommentUserInfo);
882
            ////UndoData.Markup_List.Add(multi_Undo_Data);
883

  
884
            //multi_Undo_Data = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.Control_Style(txtOriginator as MarkupToPDF.Common.CommentUserInfo);
885
            //UndoData.Markup_List.Add(multi_Undo_Data);
886

  
887
            //multi_Undo_Data = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.Control_Style(txtDate as MarkupToPDF.Common.CommentUserInfo);
888
            //UndoData.Markup_List.Add(multi_Undo_Data);
889

  
890
            //ViewerDataModel.Instance.UndoDataList.Add(UndoData);
891

  
892
            //System.Diagnostics.Debug.WriteLine(symCtrl.GetMarkupData(App.ViewInfo.UserID, 1, markupinfo.MarkupVersionID).DATA);
893
            ////System.Diagnostics.Debug.WriteLine(txtApproved.GetMarkupData(App.ViewInfo.UserID, 1, markupinfo.MarkupVersionID).DATA);
894
            ////System.Diagnostics.Debug.WriteLine(txtCreator.GetMarkupData(App.ViewInfo.UserID, 1, markupinfo.MarkupVersionID).DATA);
895
            //System.Diagnostics.Debug.WriteLine(txtOriginator.GetMarkupData(App.ViewInfo.UserID, 1, markupinfo.MarkupVersionID).DATA);
896
            //System.Diagnostics.Debug.WriteLine(txtDate.GetMarkupData(App.ViewInfo.UserID, 1, markupinfo.MarkupVersionID).DATA);
897
        }
898

  
899
        private void SetTextControl(TextControl textControl)
900
        {
901
            textControl.Base_TextBlock.Margin = new Thickness(0, 0, 10, 0);
902
            textControl.Base_TextBox.Visibility = Visibility.Collapsed;
903
            textControl.Base_TextBlock.Visibility = Visibility.Visible;
904

  
905
        }
906

  
907
        private SymControlN GetSymNControl(double PageWidth, double PageHeight, string userId, string markupInfoId, Point startPosition)
908
        {
909
            SymControlN result = null;
910

  
911
            try
912
            {
913
                double height = 80;
914
                double itemWidth = 180;
915

  
916
                System.Windows.Point startPoint = new System.Windows.Point(startPosition.X, startPosition.Y);
917
                System.Windows.Point endPoint = new System.Windows.Point(startPosition.X + itemWidth, startPosition.Y + height);
918
                System.Windows.Point leftBottomPoint = new System.Windows.Point(startPosition.X, startPosition.Y + height);
919
                System.Windows.Point topRightPoint = new System.Windows.Point(startPosition.X + itemWidth, startPosition.Y);
920

  
921
                result = new SymControlN
922
                {
923
                    CommentID = Commons.shortGuid(),
924
                    MarkupInfoID = markupInfoId,
925
                    UserID = userId,
926
                    PointSet = new List<Point> { startPoint, leftBottomPoint, endPoint, topRightPoint },
927
                    StartPoint = startPoint,
928
                    EndPoint = endPoint,
929
                    CommentAngle = 0,
930
                    LeftBottomPoint = leftBottomPoint,
931
                    TopRightPoint = topRightPoint,
932
                    Opacity = 1,
933
                    PathXathData = "eJy1Ul1PwjAU/SvN9c3EdY5g1FAShyIxRgygxsemu7AbupZ0Vae/3g42/Azxxfuw9Z7Tnpx72t6lo4zdyAIFyHUBqwptSgG596tTzkuVYyHLqCDlbGnnPlK24C9k5hVP4viIV7LQfOWwROOlJ2ug36tVo1Sq5cLZJ5P1e1OrKRtYbV3qnsqcrZcC9oZNARuvpCL/KiCODoHxfo//EJmg8tIsNLKpd+hVLmBIWkPd2iU2cnGoFprlpJYGyzBOt8WuyeCVJSNgUstCM/1WHNgDZT5oJ3E4M0Ja5F7A8QmwgTTPIYlrnAfgIIm6W2hmVy3CN9M3GUzsyznOyVAdTBlG+NxvxffXx37nOlF3Fx3vppNd5P6nnL8bnWHlU23VktUrAWe3t5Px/cU5sKE1/qFRuKi8k6nV2Qae0ltIshPXncPNtX25lZF19BY2Sn2maWGK8GQEDMIXHbB7dJ7Ur1RrUcDmbXx3l76y0eN4endz+Qd/yX/663xk2v7eAQ==",
934
                    Memo = null
935
                };
936

  
937
            }
938
            catch (Exception ex)
939
            {
940
                System.Diagnostics.Debug.WriteLine(ex.ToString());
941
            }
942

  
943
            return result;
944
        }
945

  
946
        private RectangleControl GetRectControl(double PageWidth, double PageHeight, string userId,string markupInfoId, Point startPosition)
947
        {
948
            RectangleControl result = null;
949

  
950
            try
951
            {
952
                double height = 80;
953
                double itemWidth = 180;
954

  
955
                System.Windows.Point startPoint = new System.Windows.Point(startPosition.X, startPosition.Y);
956
                System.Windows.Point endPoint = new System.Windows.Point(startPosition.X + itemWidth, startPosition.Y + height);
957
                System.Windows.Point leftBottomPoint = new System.Windows.Point(startPosition.X, startPosition.Y + height);
958
                System.Windows.Point topRightPoint = new System.Windows.Point(startPosition.X + itemWidth, startPosition.Y);
959

  
960
                result = new RectangleControl
961
                {
962
                    CommentID = Commons.shortGuid(),
963
                    MarkupInfoID = markupInfoId,
964
                    LineSize = 5,
965
                    Paint = MarkupToPDF.Controls.Common.PaintSet.None,
966
                    StartPoint = startPoint,
967
                    EndPoint = endPoint,
968
                    CommentAngle = 0,
969
                    StrokeColor = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 255, 0x0, 0x0)),
970
                    //StrokeColor = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 64, 224, 208)),
971
                    FillColor = null,
972
                    DashSize = new System.Windows.Media.DoubleCollection(new[] { 999999.0 }),
973
                    Opacity = 1,
974
                    LeftBottomPoint = leftBottomPoint,
975
                    TopRightPoint = topRightPoint,
976
                    PointSet = new List<Point> { startPoint,leftBottomPoint,endPoint,topRightPoint },
977
                    UserID = userId,
978
                    Memo = null
979
                };
980

  
981
            }
982
            catch (Exception ex)
983
            {
984
                System.Diagnostics.Debug.WriteLine(ex.ToString());
985
            }
986

  
987
            return result;
988
        }
989

  
990

  
991

  
992
        private TextControl GetTextControl(double PageWidth, double PageHeight, string userId, string markupInfoId, string Text,double fontSize, FontWeight fontWeight,TextAlignment textAlignment, Rect parentRect,double positionY)
993
        {
994
            TextControl result = null;
995

  
996
            try
997
            {
998

  
999
                var txtSize = ShapeMeasure(new TextBlock { Text = Text, FontSize = fontSize, FontWeight = fontWeight,FontFamily = new FontFamily("Tahoma") });
1000

  
1001
                double startPositionX = parentRect.X;
1002

  
1003
                switch (textAlignment)
1004
                {
1005
                    case TextAlignment.Right:
1006
                        startPositionX = parentRect.X + parentRect.Width - txtSize.Width;
1007
                        break;
1008
                    case TextAlignment.Center:
1009
                        startPositionX = parentRect.X + parentRect.Width / 2 - txtSize.Width / 2 - 3;
1010
                        break;
1011
                }
1012

  
1013
                Point startPosition = new Point
1014
                {
1015
                    X = startPositionX,
1016
                    Y = positionY
1017
                };
1018
                
1019
                System.Windows.Point startPoint = new System.Windows.Point(startPosition.X, startPosition.Y);
1020
                System.Windows.Point endPoint = new System.Windows.Point(startPosition.X + txtSize.Width, startPosition.Y + txtSize.Height);
1021
                System.Windows.Point leftBottomPoint = new System.Windows.Point(startPosition.X, startPosition.Y + txtSize.Height);
1022
                System.Windows.Point topRightPoint = new System.Windows.Point(startPosition.X + txtSize.Width, startPosition.Y);
1023

  
1024
                result = new TextControl
1025
                {
1026
                    CommentID = Commons.shortGuid(),
1027
                    MarkupInfoID = markupInfoId,
1028
                    Text = Text,
1029
                    StartPoint = startPoint,
1030
                    EndPoint = endPoint,
1031
                    CanvasX = startPosition.X,
1032
                    CanvasY = startPosition.Y,
1033
                    BoxWidth = txtSize.Width,
1034
                    BoxHeight = txtSize.Height,
1035
                    ControlType_No = 0,
1036
                    LineSize = new Thickness(5),
1037
                    TextSize = fontSize,
1038
                    Foreground = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 255, 0, 0)),
1039
                    FontSize = 10,
1040
                    UserID = userId,
1041
                    IsHighLight = false,
1042
                    CommentAngle = 0,
1043
                    PointSet = new List<Point>(),
1044
                    Opacity = 1,
1045
                    IsSelected = false,
1046
                    TextFamily = new FontFamily("Tahoma"),
1047
                    TextStyle = FontStyles.Normal,
1048
                    TextWeight = FontWeights.Bold
1049
                };
1050
          
1051
            }
1052
            catch (Exception ex)
1053
            {
1054

  
1055
            }
1056

  
1057
            return result;
1058
        }
1059
        public static Size ShapeMeasure(UIElement e)
1060
        {
1061
            // Measured Size is bounded to be less than maxSize
1062
            Size maxSize = new Size(
1063
                 double.PositiveInfinity,
1064
                 double.PositiveInfinity);
1065
            e.Measure(maxSize);
1066
            return e.DesiredSize;
822 1067
        }
823 1068

  
824 1069
        private async Task MarkupLoadAsync(int pageNumber)

내보내기 Unified diff

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