프로젝트

일반

사용자정보

개정판 1a503498

ID1a503498e198d77bb254b203466aabab28c7c123
상위 44c5e27e
하위 fb8d74b1

이지연이(가) 약 6년 전에 추가함

issue #680 modify method

차이점 보기:

MarkupToPDF/Controls/Parsing/MarkupParse.cs
5359 5359
            var unknownData = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
5360 5360
            return unknownData;
5361 5361
        }
5362
        
5363
        //Temp
5364
        public Control TempMarkupParseEx(string MarkupString, ObservableCollection<CommentUserInfo> baseLayer, string DisplayColor, string ToolTipMessage, string markupInfoID, string commentId)
5365
        {
5366
            Control return_control = new Control();
5367
            if (MarkupString != "False")
5368
            {   
5369
                SolidColorBrush _SetColor = new SolidColorBrush(Common.ValueConverter.StringToColorConverter.Parse(DisplayColor));
5370
                //SolidColorBrush _SetColor = new SolidColorBrush(Colors.Red);
5371
                string[] delimiterChars = { "|DZ|" };
5372
                string[] delimiterChars2 = { "|" };
5373
                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
5374
                List<string> dataSet = new List<string>();
5375

  
5376
                foreach (var dataPease in data)
5377
                {
5378
                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
5379
                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
5380
                    switch (unkownControl.Name)
5381
                    {
5382
                        #region ArrowText
5383
                        case "ArrowTextControl":
5384
                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
5385
                            {
5386
                                #region 신규
5387
                                //string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5388
                                ArrowTextControl instance = new ArrowTextControl();
5389
                                instance.MarkupInfoID = markupInfoID;
5390
                                //Layer.Children.Add(instance);
5391
                                baseLayer.Add(instance);
5392
                                instance.ApplyTemplate();
5393
                                //instance.LineSize = Convert.ToDouble(data2.First());
5394
                                instance.PointSet = s.PointSet;
5395
                                instance.StartPoint = s.StartPoint;
5396
                                instance.EndPoint = s.EndPoint;
5397
                                instance.StrokeColor = new SolidColorBrush(Colors.Red);
5398
                                //instance.DashSize = s.DashSize;
5399
                                instance.ArrowTextStyle = s.ArrowStyle;
5400
                                instance.isHighLight = s.isHighLight;
5401
                                instance.ArrowText = s.ArrowText;
5402
                                instance.Opacity = s.Opac;
5403
                                instance.BorderSize = s.BorderSize;
5404
                                instance.BoxWidth = s.BoxWidth;
5405
                                instance.BoxHeight = s.BoxHeight;
5406
                                instance.isFixed = s.isFixed;
5407
                                instance.Angle = s.Angle;
5408
                                instance.UserID = s.UserID;
5409
                                instance.StrokeColor = _SetColor;
5410
                                instance.isTrans = s.isTrans;
5411
                                instance.MidPoint = s.MidPoint;
5412
                                instance.Memo = s.Memo;
5413
                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
5414
                                {
5415
                                    s.fontConfig = new List<string>();
5416

  
5417
                                    s.fontConfig.Add("Arial");
5418
                                    s.fontConfig.Add("Normal");
5419
                                    s.fontConfig.Add("Normal");
5420
                                    s.fontConfig.Add("30");
5421
                                }
5422

  
5423
                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
5424
                                //인구 추가(2018.04.17)
5425
                                instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
5426
                                instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
5427
                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
5428

  
5429
                                if (s.fontConfig.Count() == 5)
5430
                                {
5431
                                    instance.UnderLine = TextDecorations.Underline;
5432
                                    instance.Base_TextBox.TextDecorations = instance.UnderLine;
5433
                                }
5434

  
5435
                                instance.SetArrowTextPath();
5436
                                instance.Base_TextBox.IsHitTestVisible = false;
5437
                                instance.CommentID = commentId;
5438
                                #endregion
5439

  
5440

  
5441
                                return_control = instance;
5442

  
5443
                            };
5444
                            break;
5445
                        #endregion
5446
                        #region Arrow_Multi
5447
                        case "ArrowControl_Multi":
5448
                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
5449
                            {
5450
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5451
                                ArrowControl_Multi instance = new ArrowControl_Multi
5452
                                {
5453
                                    LineSize = Convert.ToDouble(data2.First()),
5454
                                    StartPoint = s.StartPoint,
5455
                                    MiddlePoint = s.MidPoint,
5456
                                    DashSize = s.DashSize,
5457
                                    EndPoint = s.EndPoint,
5458
                                    PointSet = s.PointSet,
5459
                                    Opacity = s.Opac,
5460
                                    StrokeColor = _SetColor,
5461
                                    UserID = s.UserID
5462
                                };
5463

  
5464
                                //Layer.Children.Add(instance);
5465
                                instance.MarkupInfoID = markupInfoID;
5466
                                baseLayer.Add(instance);
5467
                                instance.ApplyTemplate();
5468
                                instance.SetArrowMultiPath();
5469
                                instance.Memo = s.Memo;
5470
                                instance.CommentID = commentId;
5471
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
5472
                                
5473
                                return_control = instance;
5474
                            }
5475
                            break;
5476
                        #endregion
5477
                        #region Rectangle
5478
                        case "RectangleControl":
5479
                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
5480
                            {
5481
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5482
                                RectangleControl instance = new RectangleControl
5483
                                {
5484
                                    LineSize = Convert.ToDouble(data2.First()),
5485
                                    Paint = s.PaintState,
5486
                                    StartPoint = s.StartPoint,
5487
                                    EndPoint = s.EndPoint,
5488
                                    Angle = s.Angle,
5489
                                    StrokeColor = _SetColor,
5490
                                    DashSize = s.DashSize,
5491
                                    Opacity = s.Opac,
5492
                                    LeftBottomPoint = s.LB,
5493
                                    TopRightPoint = s.TR,
5494
                                    PointSet = s.PointSet,
5495
                                    UserID = s.UserID
5496
                                };
5497

  
5498
                                instance.Memo = s.Memo;
5499
                                //Layer.Children.Add(instance);
5500
                                instance.CommentID = commentId;
5501
                                instance.MarkupInfoID = markupInfoID;
5502
                                baseLayer.Add(instance);
5503
                                instance.ApplyTemplate();
5504
                                instance.SetRectPath();
5505

  
5506
                                return_control = instance;
5507
                            }
5508
                            break;
5509
                        #endregion
5510
                        #region Triangle
5511
                        case "TriControl":
5512
                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
5513
                            {
5514
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5515
                                TriControl instance = new TriControl
5516
                                {
5517
                                    LineSize = Convert.ToDouble(data2.First()),
5518
                                    MidPoint = s.MidPoint,
5519
                                    StartPoint = s.StartPoint,
5520
                                    Paint = s.Paint,
5521
                                    EndPoint = s.EndPoint,
5522
                                    Opacity = s.Opac,
5523
                                    Angle = s.Angle,
5524
                                    DashSize = s.DashSize,
5525
                                    PointSet = s.PointSet,
5526
                                    StrokeColor = _SetColor,
5527
                                    UserID = s.UserID,
5528
                                };
5529
                                instance.Memo = s.Memo;
5530
                                //Layer.Children.Add(instance);
5531
                                instance.CommentID = commentId;
5532
                                instance.MarkupInfoID = markupInfoID;
5533
                                baseLayer.Add(instance);
5534
                                instance.ApplyTemplate();
5535
                                instance.SetTri();
5536
                                return_control = instance;
5537
                            }
5538
                            break;
5539
                        #endregion
5540
                        #region Cicle
5541
                        case "CircleControl":
5542
                            using (S_CircleControl s = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
5543
                            {
5544
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5545
                                CircleControl instance = new CircleControl
5546
                                {
5547
                                    LineSize = Convert.ToDouble(data2.First()),
5548
                                    Paint = s.PaintState,
5549
                                    StartPoint = s.StartPoint,
5550
                                    EndPoint = s.EndPoint,
5551
                                    LeftBottomPoint = s.LBP,
5552
                                    TopRightPoint = s.TRP,
5553
                                    Opacity = s.Opac,
5554
                                    Angle = s.Angle,
5555
                                    DashSize = s.DashSize,
5556
                                    PointSet = s.PointSet,
5557
                                    StrokeColor = _SetColor,
5558
                                    UserID = s.UserID,
5559
                                };
5560
                                instance.Memo = s.Memo;
5561
                                //Layer.Children.Add(instance);
5562
                                instance.CommentID = commentId;
5563
                                instance.MarkupInfoID = markupInfoID;
5564
                                baseLayer.Add(instance);
5565
                                instance.ApplyTemplate();
5566
                                instance.SetCircle();
5567
                                return_control = instance;
5568
                            }
5569
                            break;
5570
                        #endregion
5571
                        #region Poly
5572
                        case "PolygonControl":
5573
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
5574
                            {
5575
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5576
                                PolygonControl instance = new PolygonControl
5577
                                {
5578
                                    LineSize = Convert.ToDouble(data2.First()),
5579
                                    //Toler = s.Toler,
5580
                                    IsCompleted = s.IsCompleted,
5581
                                    //PointSet = new List<Point>(),
5582
                                    Opacity = s.Opac,
5583
                                    StrokeColor = _SetColor,
5584
                                    StartPoint = s.StartPoint,
5585
                                    PointSet = s.PointSet,
5586
                                    EndPoint = s.EndPoint,
5587
                                    UserID = s.UserID,
5588
                                    //강인구 추가(Chain인지 Polygon인지 구분)
5589
                                    ControlType = s.Type,
5590
                                    DashSize = s.DashSize,
5591
                                    Paint = s.PaintState,
5592
                                    //PointC = s.PointC,
5593
                                };
5594
                                //Layer.Children.Add(instance);
5595
                                instance.MarkupInfoID = markupInfoID;
5596
                                baseLayer.Add(instance);
5597
                                instance.CommentID = commentId;
5598
                                instance.Memo = s.Memo;
5599
                                instance.ApplyTemplate();
5600
                                instance.SetPolyPath();
5601
                                return_control = instance;
5602
                                //instance.PointSet = s.PointSet;
5603
                                //instance.ClosePath();
5604
                                //instance.ChangePaint(s.PaintState);
5605
                            }
5606
                            break;
5607
                        #endregion
5608
                        #region InkControl
5609
                        case "InkControl":
5610
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
5611
                            {
5612
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5613
                                InkControl instance = new InkControl
5614
                                {
5615
                                    LineSize = Convert.ToDouble(data2.First()),
5616
                                    //Toler = s.Toler,
5617
                                    IsCompleted = s.IsCompleted,
5618
                                    //PointSet = new List<Point>(),
5619
                                    Opacity = s.Opac,
5620
                                    StrokeColor = _SetColor,
5621
                                    StartPoint = s.StartPoint,
5622
                                    PointSet = s.PointSet,
5623
                                    UserID = s.UserID,
5624
                                    EndPoint = s.EndPoint,
5625
                                    //강인구 추가(Chain인지 Polygon인지 구분)
5626
                                    ControlType = s.Type,
5627
                                    DashSize = s.DashSize,
5628
                                    Paint = s.PaintState,
5629
                                    //PointC = s.PointC,
5630
                                };
5631
                                //Layer.Children.Add(instance);
5632
                                instance.MarkupInfoID = markupInfoID;
5633
                                baseLayer.Add(instance);
5634
                                instance.CommentID = commentId;
5635
                                instance.Memo = s.Memo;
5636
                                instance.ApplyTemplate();
5637
                                instance.SetPolyPath();
5638
                                return_control = instance;
5639
                                //instance.PointSet = s.PointSet;
5640
                                //instance.ClosePath();
5641
                                //instance.ChangePaint(s.PaintState);
5642
                            }
5643
                            break;
5644
                        #endregion
5645
                        #region Cloud
5646
                        case "CloudControl":
5647
                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
5648
                            {
5649
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5650
                                CloudControl instance = new CloudControl
5651
                                {
5652
                                    LineSize = Convert.ToDouble(data2.First()),
5653
                                    Toler = s.Toler,
5654
                                    PointSet = new List<Point>(),
5655
                                    ArcLength = s.ArcLength,
5656
                                    Paint = s.PaintState,
5657
                                    Opacity = s.Opac,
5658
                                    StrokeColor = _SetColor,
5659
                                    isTransOn = s.IsTrans,
5660
                                    isChain = s.IsChain,
5661
                                    DashSize = s.DashSize,
5662
                                    UserID = s.UserID,
5663
                                    StartPoint = s.StartPoint,
5664
                                    EndPoint = s.EndPoint,
5665
                                    //Fill = s.CloudFill,
5666
                                };
5667
                                instance.Memo = s.Memo;
5668
                                //Layer.Children.Add(instance);
5669
                                instance.MarkupInfoID = markupInfoID;
5670
                                baseLayer.Add(instance);
5671
                                instance.CommentID = commentId;
5672
                                instance.PointSet = s.PointSet;
5673
                                instance.ApplyTemplate();
5674
                                instance.ClosePath();
5675
                                instance.ChangePaint(s.PaintState);
5676
                                return_control = instance;
5677
                            }
5678
                            break;
5679
                        #endregion
5680
                        #region Line
5681
                        case "LineControl":
5682
                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
5683
                            {
5684
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5685
                                LineControl instance = new LineControl()
5686
                                {
5687
                                    LineStyleSet = s.LineStyleSet,
5688
                                    StartPoint = s.StartPoint,
5689
                                    DimSize = s.DimSize,
5690
                                    EndPoint = s.EndPoint,
5691
                                    DashSize = s.DashSize,
5692
                                    Interval = s.Interval,
5693
                                    PointSet = s.PointSet,
5694
                                    Opacity = s.Opac,
5695
                                    StrokeColor = _SetColor,
5696
                                    UserID = s.UserID,
5697
                                    LineSize = Convert.ToDouble(data2.First()),
5698
                                };
5699
                                instance.Memo = s.Memo;
5700
                                //Layer.Children.Add(instance);
5701
                                instance.CommentID = commentId;
5702
                                instance.MarkupInfoID = markupInfoID;
5703
                                baseLayer.Add(instance);
5704
                                instance.ApplyTemplate();
5705
                                instance.SetLinePath();
5706
                                return_control = instance;
5707
                            }
5708
                            break;
5709
                        #endregion
5710
                        #region Text
5711
                        case "TextControl":
5712
                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
5713
                            {
5714
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5715
                                TextControl instance = new TextControl()
5716
                                {
5717
                                    Text = s.Text,
5718
                                    StartPoint = s.StartPoint,
5719
                                    EndPoint = s.EndPoint,
5720
                                    CanvasX = s.StartPoint.X,
5721
                                    CanvasY = s.StartPoint.Y,
5722
                                    BoxWidth = s.BoxW,
5723
                                    BoxHeight = s.BoxH,
5724
                                    ControlType_No = s.paintMethod,
5725
                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
5726
                                    TextSize = Convert.ToDouble(data2[1]),
5727
                                    FontColor = _SetColor,
5728
                                    //FontSize = 10,
5729
                                    UserID = s.UserID,
5730
                                    //isHighLight = s.isHighLight,
5731
                                    Angle = s.Angle,
5732
                                    PointSet = s.PointSet,
5733
                                    Opacity = s.Opac,
5734
                                    TextFamily = new FontFamily(s.fontConfig[0]),
5735
                                    //인구 추가(2018.04.17)
5736
                                    TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
5737
                                    TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
5738
                                };
5739

  
5740
                                if (instance.Text != null)
5741
                                {
5742
                                    //Layer.Children.Add(instance);
5743
                                    instance.MarkupInfoID = markupInfoID;
5744
                                    baseLayer.Add(instance);
5745
                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
5746
                                    instance.ApplyTemplate();
5747
                                    instance.Memo = s.Memo;
5748
                                    if (s.fontConfig.Count() == 4)
5749
                                    {
5750
                                        instance.UnderLine = TextDecorations.Underline;
5751
                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
5752
                                    }
5753
                                    instance.Base_TextBlock.Margin = new Thickness(0, 0, 10, 0);
5754

  
5755
                                    //instance.Base_TextBlock.Margin = new Thickness(instance.Base_TextBox.Margin.Left + 4);
5756

  
5757
                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
5758
                                    instance.Base_TextBlock.Visibility = Visibility.Visible;
5759

  
5760
                                    instance.CommentID = commentId;
5761
                                    instance.DrawingCloud();
5762
                                    instance.SetText();
5763
                                    return_control = instance;
5764
                                }
5765
                            }
5766
                            break;
5767
                        #endregion
5768
                        #region Arc
5769
                        case "ArcControl":
5770
                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
5771
                            {
5772
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5773
                                ArcControl instance = new ArcControl()
5774
                                {
5775
                                    StartPoint = s.StartPoint,
5776
                                    EndPoint = s.EndPoint,
5777
                                    DashSize = s.DashSize,
5778
                                    PointSet = s.PointSet,
5779
                                    isTransOn = s.IsTransOn,
5780
                                    MidPoint = s.MidPoint,
5781
                                    StrokeColor = _SetColor,
5782
                                    Clock = s.Clock,
5783
                                    Opacity = s.Opac,
5784
                                    LineSize = Convert.ToDouble(data2.First()),
5785
                                    UserID = s.UserID,
5786
                                };
5787
                                instance.Memo = s.Memo;
5788
                                //Layer.Children.Add(instance);
5789
                                instance.MarkupInfoID = markupInfoID;
5790
                                baseLayer.Add(instance);
5791
                                instance.CommentID = commentId;
5792
                                instance.ApplyTemplate();
5793
                                instance.SetArcPath();
5794
                                return_control = instance;
5795
                            }
5796
                            break;
5797
                        #endregion
5798
                        #region RectCloud
5799
                        case "RectCloudControl":
5800
                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
5801
                            {
5802
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5803
                                RectCloudControl instance = new RectCloudControl()
5804
                                {
5805
                                    StartPoint = s.StartPoint,
5806
                                    EndPoint = s.EndPoint,
5807
                                    LeftBottomPoint = s.LB,
5808
                                    Paint = s.PaintState,
5809
                                    Opacity = s.Opac,
5810
                                    DashSize = s.DashSize,
5811
                                    TopRightPoint = s.TR,
5812
                                    PointSet = s.PointSet,
5813
                                    StrokeColor = _SetColor,
5814
                                    LineSize = Convert.ToDouble(data2.First()),
5815
                                    UserID = s.UserID,
5816
                                    ArcLength = s.ArcLength
5817
                                };
5818
                                instance.Memo = s.Memo;
5819
                                //Layer.Children.Add(instance);
5820
                                instance.MarkupInfoID = markupInfoID;
5821
                                baseLayer.Add(instance);
5822
                                instance.CommentID = commentId;
5823
                                instance.ApplyTemplate();
5824
                                instance.SetRectCloud();
5825
                                return_control = instance;
5826
                            }
5827
                            break;
5828
                        #endregion
5829
                        #region Sign
5830
                        case "SignControl":
5831
                            using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
5832
                            {
5833
                                SignControl instance = new SignControl
5834
                                {
5835
                                    Angle = s.Angle,
5836
                                    StartPoint = s.StartPoint,
5837
                                    TopRightPoint = s.TR,
5838
                                    EndPoint = s.EndPoint,
5839
                                    LeftBottomPoint = s.LB,
5840
                                    PointSet = s.PointSet,
5841
                                    Opacity = s.Opac,
5842
                                    SignImage = null,
5843
                                    UserID = s.UserID,
5844
                                };
5845
                                instance.ApplyTemplate();
5846
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
5847

  
5848
                                if (s.UserNumber != null)
5849
                                {
5850
                                    var _sign = getUser.GetSign(s.UserNumber, ProjectNo);
5851
                                    if (_sign != null)
5852
                                    {
5853
                                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
5854

  
5855
                                        System.IO.MemoryStream stream = new System.IO.MemoryStream();
5856
                                        stream.Write(imageBytes, 0, imageBytes.Length);
5857
                                        stream.Position = 0;
5858
                                        System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
5859
                                        BitmapImage returnImage = new BitmapImage();
5860
                                        returnImage.BeginInit();
5861
                                        System.IO.MemoryStream ms = new System.IO.MemoryStream();
5862
                                        img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
5863
                                        ms.Seek(0, System.IO.SeekOrigin.Begin);
5864
                                        returnImage.StreamSource = ms;
5865
                                        returnImage.EndInit();
5866
                                        stream.Close();
5867
                                        instance.SignImage = returnImage;
5868
                                    }
5869
                                }
5870

  
5871
                                instance.MarkupInfoID = markupInfoID;
5872
                                instance.CommentID = commentId;
5873
                                baseLayer.Add(instance);
5874
                                instance.ApplyTemplate();
5875
                                instance.SetImage();
5876
                                return_control = instance;
5877
                            }
5878
                            break;
5879
                        #endregion
5880
                        #region Ink
5881
                        case "InkPresenter":
5882
                            using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
5883
                            {
5884
#if SILVERLIGHT
5885
                                this._InkBoard.Strokes = s.SCC; 
5886
#endif
5887
                            }
5888
                            break;
5889
                        #endregion
5890
                        #region Date
5891
                        case "DateControl":
5892
                            {
5893
                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
5894
                                {
5895
                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5896
                                    DateControl instance = new DateControl
5897
                                    {
5898
                                        Angle = s.Angle,
5899
                                        StartPoint = s.StartPoint,
5900
                                        EndPoint = s.EndPoint,
5901
                                        LeftBottomPoint = s.LB,
5902
                                        TopRightPoint = s.TR,
5903
                                        Opacity = s.Opac,
5904
                                        FontColor = _SetColor,
5905
                                        LineSize = Convert.ToDouble(data2.First()),
5906
                                        Text = s.Text,
5907
                                        PointSet = s.PointSet,
5908
                                        UserID = s.UserID
5909
                                    };
5910
                                    instance.Memo = s.Memo;
5911
                                    //Layer.Children.Add(instance);
5912
                                    baseLayer.Add(instance);
5913
                                    instance.CommentID = commentId;
5914
                                    instance.ApplyTemplate();
5915
                                    instance.SetDate();
5916
                                    return_control = instance;
5917
                                }
5918
                            }
5919
                            break;
5920
                        #endregion
5921
                        #region Symbol
5922
                        case "SymControl":
5923
                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
5924
                            {
5925
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5926
                                Common.StringToPathConverter sm = new Common.StringToPathConverter();
5927
                                SymControl instance = new SymControl()
5928
                                {
5929
                                    LineSize = Convert.ToDouble(data2.First()),
5930
                                    PointSet = s.PointSet,
5931
                                    Paint = s.PaintState,
5932
                                    StartPoint = s.StartPoint,
5933
                                    StrokeColor = _SetColor,
5934
                                    EndPoint = s.EndPoint,
5935
                                    Angle = s.Angle,
5936
                                    LeftBottomPoint = s.LB,
5937
                                    TopRightPoint = s.TR,
5938
                                    PathData = sm.Convert(s.PathInfo.ToString()),
5939
                                    Opacity = s.Opac,
5940
                                };
5941

  
5942
                                instance.Memo = s.Memo;
5943
                                baseLayer.Add(instance);
5944
                                instance.CommentID = commentId;
5945
                                instance.ApplyTemplate();
5946
                                instance.SetSymPath();
5947
                                return_control = instance;
5948
                            }
5949
                            break;
5950
                        #endregion
5951
                        #region Image
5952
                        case "ImgControl":
5953
                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
5954
                            {
5955
                                Image img = new Image();
5956
                                img.Source = new BitmapImage(new Uri(s.ImagePath));
5957

  
5958
                                ImgControl instance = new ImgControl
5959
                                {
5960
                                    Angle = s.Angle,
5961
                                    StartPoint = s.StartPoint,
5962
                                    TopRightPoint = s.TR,
5963
                                    EndPoint = s.EndPoint,
5964
                                    LeftBottomPoint = s.LB,
5965
                                    PointSet = s.PointSet,
5966
                                    Opacity = s.Opac,
5967
                                    FilePath = s.ImagePath,
5968
                                    UserID = s.UserID,
5969
                                    ImageData = img.Source
5970
                                };
5971
                                //Layer.Children.Add(instance);
5972
                                instance.Memo = s.Memo;
5973
                                baseLayer.Add(instance);
5974
                                instance.CommentID = commentId;
5975
                                instance.ApplyTemplate();
5976
                                instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
5977
                                instance.SetImage();
5978
                                return_control = instance;
5979
                            }
5980
                            break;
5981
                        #endregion
5982
                        #region SymbolN
5983
                        case "SymControlN":
5984
                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
5985
                            {
5986
                                SymControlN instance = new SymControlN()
5987
                                {
5988
                                    PointSet = s.PointSet,
5989
                                    StartPoint = s.StartPoint,
5990
                                    EndPoint = s.EndPoint,
5991
                                    Angle = s.Angle,
5992
                                    LeftBottomPoint = s.LB,
5993
                                    TopRightPoint = s.TR,
5994
                                    Opacity = s.Opac,
5995
                                    PathXathData = s.DBData,
5996
                                };
5997
                                instance.Memo = s.Memo;
5998
                                instance.MarkupInfoID = markupInfoID;
5999
                                baseLayer.Add(instance);
6000
                                instance.CommentID = commentId;
6001
                                instance.ApplyTemplate();
6002

  
6003
                                var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(instance.PathXathData);
6004
                                xamlData = xamlData.Replace("daelim", "DAELIM");
6005
                                System.IO.MemoryStream stream = new System.IO.MemoryStream();
6006
                                System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
6007
                                writer.Write(xamlData);
6008
                                writer.Flush();
6009
                                stream.Position = 0;
6010

  
6011
                                object obj = XamlReader.Load(stream);
6012
                                instance.Base_ViewBox.Child = obj as UIElement;
6013
                                instance.SetViewBox();
6014
                                return_control = instance;
6015
                            }
6016
                            break;
6017
                        #endregion
6018
                        default:
6019

  
6020
                            break;
6021
                    };
6022
                }
6023
            }
6024
            return return_control;
6025
        }
6026

  
5362 6027
    }
5363 6028
}

내보내기 Unified diff

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