프로젝트

일반

사용자정보

개정판 e6c46927

IDe6c46927e4b2567af626ce5eb5915c4167d3314e
상위 fdab8f9c
하위 7753c079, a1cc6e1f

김태성이(가) 3달 전에 추가함

issue #0000 print&export Cancel event

Change-Id: I2a76519720a26759073c98b90a09c223fe6eea46

차이점 보기:

KCOM/Controls/PrintControl.xaml
14 14
    mc:Ignorable="d">
15 15

  
16 16
    <UserControl.Resources>
17
        <converter:AvoidStringConverter x:Key="AvoidStringConverter" />
18

  
19
        <converter:TeamConsolidateStringConverter x:Key="TeamConsoliStringConverter" />
17 20
        <converter:BoolToVisibleConverter x:Key="BoolToVisibleConverter" />
21
        <converter:ConsolidationStringConverter x:Key="ConsoliStringConverter" />
18 22
        <Style x:Key="GridViewCellCenterStyle" TargetType="telerik:GridViewCell">
19 23
            <Setter Property="HorizontalAlignment" Value="Center" />
20 24
        </Style>
......
555 559
                                        DataMemberBinding="{Binding UserName}"
556 560
                                        Header="User Name"
557 561
                                        IsReadOnly="True" />
558
                                    <telerik:GridViewDataColumn
562
                                    <!--<telerik:GridViewDataColumn
559 563
                                        Width="0.5*"
560 564
                                        DataMemberBinding="{Binding PageCount}"
561 565
                                        Header="Pages"
562
                                        IsReadOnly="True" />
566
                                        IsReadOnly="True" />-->
563 567
                                    <telerik:GridViewDataColumn
568
                                        Width="Auto"
569
                                        Header="CONSOLIDATION"
570
                                        IsReadOnly="True">
571
                                        <telerik:GridViewDataColumn.CellTemplate>
572
                                            <DataTemplate>
573
                                                <!--<TextBlock Text="{Binding Consolidate}"/>-->
574
                                                <Grid>
575
                                                    <Grid.ColumnDefinitions>
576
                                                        <ColumnDefinition Width="Auto" />
577
                                                        <ColumnDefinition Width="Auto" />
578
                                                        <ColumnDefinition Width="Auto" />
579
                                                    </Grid.ColumnDefinitions>
580

  
581
                                                    <TextBlock
582
                                                        Grid.Column="0"
583
                                                        Foreground="Red"
584
                                                        Text="{Binding AvoidConsolidate, Converter={StaticResource AvoidStringConverter}}" />
585
                                                    <TextBlock
586
                                                        Grid.Column="1"
587
                                                        Foreground="Blue"
588
                                                        Text="{Binding PartConsolidate, Converter={StaticResource TeamConsoliStringConverter}}" />
589
                                                    <TextBlock Grid.Column="2" Text="{Binding Consolidate, Converter={StaticResource ConsoliStringConverter}}" />
590
                                                    <!--
591
                                                        <TextBlock HorizontalAlignment="Center" Grid.Column="2">
592
                                                        <TextBlock.Text>
593
                                                        <Binding Converter="{StaticResource ConsoliStringConverter}"/>
594
                                                        </TextBlock.Text>
595
                                                        </TextBlock>
596
                                                    -->
597
                                                </Grid>
598
                                            </DataTemplate>
599
                                        </telerik:GridViewDataColumn.CellTemplate>
600
                                    </telerik:GridViewDataColumn>
601
                                    <!--<telerik:GridViewDataColumn
564 602
                                        Width="1*"
565 603
                                        DataMemberBinding="{Binding Description}"
566 604
                                        Header="Descriptions"
567
                                        IsReadOnly="True" />
605
                                        IsReadOnly="True" />-->
568 606

  
569 607
                                </telerik:RadGridView.Columns>
570 608
                            </telerik:RadGridView>
......
644 682
            VerticalAlignment="Stretch"
645 683
            telerik:StyleManager.Theme="Office2016"
646 684
            BorderThickness="0"
647
            BusyContent="Printing. . ."
648 685
            DisplayAfter="0:0:0.3"
649 686
            IsBusy="False"
650
            Visibility="{Binding IsBusy, Converter={StaticResource BoolToVisibleConverter}, RelativeSource={RelativeSource Self}}" />
687
            Visibility="{Binding IsBusy, Converter={StaticResource BoolToVisibleConverter}, RelativeSource={RelativeSource Self}}">
688
            <telerik:RadBusyIndicator.OverlayStyle>
689
                <Style TargetType="Rectangle">
690
                    <Setter Property="Stroke" Value="#FFDA8282" />
691
                    <Setter Property="Fill" Value="#7F252729" />
692
                </Style>
693
            </telerik:RadBusyIndicator.OverlayStyle>
694
            <telerik:RadBusyIndicator.BusyContentTemplate>
695
                <DataTemplate>
696
                    <StackPanel>
697
                        <TextBlock
698
                            Margin="2"
699
                            FontSize="14"
700
                            FontWeight="Bold"
701
                            Foreground="White"
702
                            Text="{Binding BusyContent, Mode=TwoWay}" />
703
                        <Button
704
                            Width="100"
705
                            Background="#FF66ACFF"
706
                            BorderBrush="#FF0A6295"
707
                            Click="btPrintCancel_click"
708
                            Content="Cancel"
709
                            FontSize="16"
710
                            Foreground="White" />
711
                    </StackPanel>
712
                </DataTemplate>
713
            </telerik:RadBusyIndicator.BusyContentTemplate>
714
        </telerik:RadBusyIndicator>
651 715
    </Grid>
652 716
</UserControl>
KCOM/Controls/PrintControl.xaml.cs
21 21
using iTextSharp.text.pdf;
22 22
using System.Net;
23 23
using Image = System.Windows.Controls.Image;
24
using System.ComponentModel;
24 25

  
25 26
namespace KCOM.Control
26 27
{
......
122 123
        System.Windows.Threading.DispatcherTimer tm = new System.Windows.Threading.DispatcherTimer();
123 124
        bool _initializeComponentFinished; //이벤트
124 125
        bool _IsDagSlider = false; //드래그 상태인가
125
        bool IsExportOrPrint = false; 
126
        bool IsExportOrPrint = false;
127
        bool IsStop = false;
126 128

  
127 129
        List<DisplayColorInfo> colorList = new List<DisplayColorInfo>();
128 130
        DefinedPages DocumentInfo { get; set; } //문서정보 정의        
......
151 153
        #endregion
152 154

  
153 155
        #region Static Property Defines
156

  
157
        public static readonly DependencyProperty BusyContentProperty =
158
            DependencyProperty.RegisterAttached("BusyContent", typeof(string), typeof(PrintControl),
159
            new PropertyMetadata(new PropertyChangedCallback(BusyContentPropertyChanged)));
160
        #endregion
161

  
162
        #region Property
163
        public string BusyContent
164
        {
165
            get { return (string)GetValue(BusyContentProperty); }
166
            set { SetValue(BusyContentProperty, value); }
167
        }
168
        #endregion
169

  
170
        #region PropertyChangeMethod
171
        private static void BusyContentPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
172
        {
173
        }
174

  
154 175
        public static readonly DependencyProperty CurrentPageNoProperty =
155 176
                   DependencyProperty.Register("CurrentPageNo", typeof(int), typeof(PrintControl),
156 177
                   new PropertyMetadata(new PropertyChangedCallback(CurrentPageNoPropertyChanged)));
......
592 613

  
593 614
                await this.Dispatcher.InvokeAsync(() => { 
594 615
                        this.printIndy.IsBusy = true;
595
                        printIndy.BusyContent = "Printing. . .";
616
                        this.BusyContent = "Printing. . .";
596 617
                });
597 618

  
598 619

  
......
629 650

  
630 651
                foreach (int PageNo in _lstPrintPageNo)
631 652
                {
653
                    if (IsStop)
654
                        break;
655

  
632 656
                    cnt++;
633 657
                    sliderPages.Value = PageNo;
634 658
                    await PageChangeAsync(token,PageNo, true, true);
......
637 661
                PrintName = cbPrint.SelectedItem.ToString();
638 662

  
639 663
                await this.Dispatcher.InvokeAsync(() => {
640
                    if (cnt == _lstPrintPageNo.Count)
664
                    if (cnt == _lstPrintPageNo.Count && !IsStop)
641 665
                    {
642 666
                        Printing();
643 667
                    }
......
651 675
            }
652 676
            finally
653 677
            {
678
                if (IsStop)
679
                {
680
                    printIndy.IsBusy = false;
681
                    IsStop = false;
682
                }
654 683
                (this.Parent as RadWindow).CanClose = true;
655 684
            }
656 685

  
......
671 700
                (this.Parent as RadWindow).CanClose = false;
672 701

  
673 702
                this.printIndy.IsBusy = true;
674
                printIndy.BusyContent = "Exporting. . .";
703
                this.BusyContent = "Exporting. . .";
675 704

  
676 705
                Export export = new Export();
677 706
                _lstPrintPageNo = PrintPageCreate();
......
723 752

  
724 753
                    foreach (int PageNo in _lstPrintPageNo)
725 754
                    {
755
                        if (IsStop)
756
                            break;
757

  
726 758
                        await Dispatcher.InvokeAsync(() =>
727 759
                        {
728 760
                            sliderPages.Value = PageNo;
......
762 794

  
763 795
                                    foreach (var item in PrintimgPath_List)
764 796
                                    {
797
                                        if (IsStop)
798
                                            break;
799

  
765 800
                                        System.Drawing.Image image = System.Drawing.Image.FromFile(item.Value);
766 801
                                        Export_img = iTextSharp.text.Image.GetInstance(image,System.Drawing.Imaging.ImageFormat.Jpeg);
767 802

  
......
789 824
                                {
790 825
                                    foreach (var item in PrintimgPath_List)
791 826
                                    {
827
                                        if (IsStop)
828
                                            break;
829

  
792 830
                                        File.Copy(item.Value, SaveDig.FileName.Replace(".jpg", "_" + item.Key.ToString()) + ".jpg");
793 831
                                    }
794 832
                                    break;
......
837 875
                GC.Collect();
838 876
                GC.WaitForPendingFinalizers();
839 877
                GC.Collect();
840

  
878
                IsStop = false;
841 879
                (this.Parent as RadWindow).CanClose = true;
842 880
            }
843 881
        }
......
1023 1061
            currentPage++;
1024 1062

  
1025 1063
            ////인쇄를 계속 할지 말지 확인
1026
            if (currentPage <= printDocument.PrinterSettings.ToPage)
1064
            if (currentPage <= printDocument.PrinterSettings.ToPage && !IsStop)
1027 1065
                e.HasMorePages = true;
1028 1066
            else
1029 1067
                e.HasMorePages = false;
......
1039 1077

  
1040 1078
                sliderPages.Value = 1;
1041 1079
                printIndy.IsBusy = false;
1042

  
1080
                IsStop = false;
1043 1081
            }));
1044 1082
        }
1045 1083
        #endregion
......
1092 1130
        #endregion
1093 1131

  
1094 1132
        #endregion
1133

  
1134
        private void btPrintCancel_click(object sender, RoutedEventArgs e)
1135
        {
1136
            IsStop = true;
1137
        }
1095 1138
    }
1096 1139
}
KCOM/Events/Implementation/TopMenuEvent.cs
445 445

  
446 446
            List<IKCOM.MarkupInfoItem> markupinfo = new List<IKCOM.MarkupInfoItem>();
447 447

  
448
            markupinfo = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetPrintDocItemList(App.ViewInfo.ProjectNO, App.ViewInfo.DocumentItemID, ViewerDataModel.Instance._markupInfoList.ToList());
448
            markupinfo.AddRange(Common.ViewerDataModel.Instance._markupInfoList.ToList());
449 449

  
450
            if (markupinfo?.Count() > 0)
450
            foreach (var item in markupinfo)
451 451
            {
452
                //Logger.sendResLog("GetPrintDocItemList", "TRUE", 1);
453
            }
454
            else
455
            {
456
                //Logger.sendResLog("GetPrintDocItemList", "FALSE", 1);
457 452
            }
453
            //markupinfo = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetPrintDocItemList(App.ViewInfo.ProjectNO, App.ViewInfo.DocumentItemID, ViewerDataModel.Instance._markupInfoList.ToList());
454

  
455
            //if (markupinfo?.Count() > 0)
456
            //{
457
            //    //Logger.sendResLog("GetPrintDocItemList", "TRUE", 1);
458
            //}
459
            //else
460
            //{
461
            //    //Logger.sendResLog("GetPrintDocItemList", "FALSE", 1);
462
            //}
458 463

  
459 464
            /// Tile Source URL을 구한다
460 465

  

내보내기 Unified diff