프로젝트

일반

사용자정보

개정판 d18ea2bd

IDd18ea2bd5a22f2671d8dd8b683008c30c6affcc2
상위 10beebc8
하위 f5c6a3d5

김태성이(가) 약 5년 전에 추가함

ThumbnailItem 중복 호출 방지
ColorList convert로 변경

Change-Id: Idc6bb06d6d84c78875400fc99cf218cd1368c253

차이점 보기:

KCOM/Common/Converter/ColorListToBrushConverter.cs
1
using IKCOM;
2
using System;
3
using System.Collections.Generic;
4
using System.Globalization;
5
using System.Linq;
6
using System.Text;
7
using System.Threading.Tasks;
8
using System.Windows;
9
using System.Windows.Data;
10
using System.Windows.Media;
11

  
12
namespace KCOM.Common.Converter
13
{
14
    class ColorListToBrushConverter : IValueConverter
15
    {
16
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
17
        {
18
            LinearGradientBrush _brush = new LinearGradientBrush();
19

  
20
            if (value != null)
21
            {
22
                if (value is List<SetColorMarkupItem>)
23
                {
24
                    var newList = value as List<SetColorMarkupItem>;
25

  
26
                    double _count = 1.0;
27

  
28
                    _brush.StartPoint = new Point(0, 0);
29
                    _brush.EndPoint = new Point(1, 0);
30
                    double _offset = 0.0;
31

  
32
                    foreach (var item in newList)
33
                    {
34
                        Color _color = Common.Converter.StringToColorConverter.Parse(item.DisplayColor);
35
                        _color.A = (byte)90;
36
                        GradientStop _stop = new GradientStop { Color = _color, Offset = _offset };
37
                        _offset = 1.0 / (double)(newList.Count()) * _count; /// 색을 분리하기 위해서
38
                        GradientStop _stop2 = new GradientStop { Color = _color, Offset = _offset };
39

  
40
                        _brush.GradientStops.Add(_stop);
41
                        _brush.GradientStops.Add(_stop2);
42
                        _count++;
43
                    }
44
                }
45
            }
46

  
47
            return _brush;
48
        }
49
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
50
        {
51
            throw new NotSupportedException();
52
        }
53
    }
54
}
KCOM/Common/ThumbnailItem.cs
21 21
        public List<SetColorMarkupItem> DisplayColorItems
22 22
        {
23 23
            get {
24

  
25
                if(_DisplayColorItems == null)
26
                {
27
                    _DisplayColorItems = new List<SetColorMarkupItem>();
28
                }
29

  
30 24
                return _DisplayColorItems;
31 25
            }
32 26

  
33 27
            set {
34

  
35
                if (_DisplayColorItems != value)
36
                {
37 28
                    _DisplayColorItems = value;
38 29

  
39 30
                    NotifyPropertyChanged("DisplayColorItems");
40
                }
41 31
            }
42 32
        }
43 33

  
KCOM/Controls/MarkupColorList.xaml
1
<UserControl x:Class="KCOM.Controls.MarkupColorList"
1
<UserControl x:Name="userControl" x:Class="KCOM.Controls.MarkupColorList"
2 2
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3 3
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4 4
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
5 5
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
6 6
             xmlns:local="clr-namespace:KCOM.Controls"
7
             mc:Ignorable="d" 
8
             d:DesignHeight="300" d:DesignWidth="300">
9
    <Grid x:Name="LayoutRoot">
10

  
11
    </Grid>
7
             mc:Ignorable="d"
8
             d:DesignHeight="300" d:DesignWidth="300" Background="{Binding ColorList, ElementName=userControl}">
9
    <Grid x:Name="LayoutRoot"/>
12 10
</UserControl>
KCOM/Controls/MarkupColorList.xaml.cs
24 24
    {
25 25
        public MarkupColorList()
26 26
        {
27
            App.splashString(ISplashMessage.MARKUPCOLORLIST);
27
            //App.splashString(ISplashMessage.MARKUPCOLORLIST);
28 28
            InitializeComponent();
29 29
        }
30 30

  
......
36 36

  
37 37
        // Using a DependencyProperty as the backing store for MousePosition.  This enables animation, styling, binding, etc...
38 38
        public static readonly DependencyProperty ColorListProperty =
39
                    DependencyProperty.Register("ColorList", typeof(List<SetColorMarkupItem>), typeof(MarkupColorList), new PropertyMetadata(new PropertyChangedCallback(OnColorListChanged)));
39
                    DependencyProperty.RegisterAttached("ColorList", typeof(List<SetColorMarkupItem>), typeof(MarkupColorList), new PropertyMetadata(new PropertyChangedCallback(OnColorListChanged)));
40 40

  
41 41
        private static void OnColorListChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
42 42
        {
43 43
            var MarkupColor = (MarkupColorList)d;
44 44

  
45
            var newList = e.NewValue as List<SetColorMarkupItem>;
46
            System.Diagnostics.Debug.WriteLine("colorList : " + MarkupColor.ColorList.Count() + "  NewValue : " + (e.NewValue as List<SetColorMarkupItem>).Count());
47
            MarkupColor.ColorList = newList;
48

  
45 49
            LinearGradientBrush _brush = new LinearGradientBrush();
46 50
            double _count = 1.0;
47 51

  
48 52
            _brush.StartPoint = new Point(0, 0);
49 53
            _brush.EndPoint = new Point(1, 0);
50 54
            double _offset = 0.0;
51
            foreach (var item in MarkupColor.ColorList)
55
            foreach (var item in newList)
52 56
            {
53 57
                Color _color = Common.Converter.StringToColorConverter.Parse(item.DisplayColor);
54 58
                _color.A = (byte)(255 * MarkupColor.Opacity);
KCOM/Controls/Sample.xaml
8 8
             mc:Ignorable="d"  Background="#f5f5f5" xmlns:converter="clr-namespace:KCOM.Common.Converter"
9 9
             d:DesignHeight="600" d:DesignWidth="200">
10 10
    <UserControl.Resources>
11
        <Style x:Key="PathButtonStyle" TargetType="Path">
11
        <converter:ColorListToBrushConverter x:Key="ColorListToBrushConverter"/>
12
        <Style x:Key="PathButtonStyle" TargetType="{x:Type Path}">
12 13
            <Setter Property="Width" Value="12"/>
13 14
            <Setter Property="Height" Value="12"/>
14 15
            <Setter Property="Fill" Value="White" />
......
29 30
                <Setter.Value>
30 31
                    <ControlTemplate TargetType="{x:Type telerik:RadListBoxItem}">
31 32
                        <Border x:Name="myBorder" VerticalAlignment="Center"
32
                                Padding="0" Margin="1"
33
                                Padding="0" Margin="0"
33 34
                                SnapsToDevicePixels="False">
34 35
                            <Border.Style>
35
                                <Style TargetType="Border">
36
                                <Style TargetType="{x:Type Border}">
36 37
                                    <Setter Property="BorderThickness" Value="3 3 3 3"/>
37 38
                                    <Setter Property="BorderBrush" Value="Transparent"/>
38 39
                                </Style>
39 40
                            </Border.Style>
40
                            <ContentPresenter Margin="5"/>
41
                            <ContentPresenter Margin="2"/>
41 42
                        </Border>
42 43
                        <ControlTemplate.Triggers>
43 44
                            <Trigger Property="IsSelected" Value="true">
......
48 49
                </Setter.Value>
49 50
            </Setter>
50 51
        </Style>
51
        <ControlTemplate x:Key="RadExpanderControlTemplate1" TargetType="telerik:RadExpander">
52
        <ControlTemplate x:Key="RadExpanderControlTemplate1" TargetType="{x:Type telerik:RadExpander}">
52 53
            <Grid HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
53 54
                <VisualStateManager.VisualStateGroups>
54 55
                    <VisualStateGroup x:Name="CommonStateGroup">
......
133 134
                            <Storyboard>
134 135
                                <DoubleAnimation Duration="0:0:0.2"
135 136
                                                 Storyboard.TargetName="arrow"
136
                                                 Storyboard.TargetProperty="(FrameworkElement.RenderTransform).Angle"
137
                                                 Storyboard.TargetProperty="(UIElement.RenderTransform).Angle"
137 138
                                                 To="180" />
138
                                <ColorAnimation d:IsOptimized="True"
139
                                <ColorAnimation
139 140
                                                Duration="0"
140 141
                                                Storyboard.TargetName="OuterCircle"
141 142
                                                Storyboard.TargetProperty="(Shape.Stroke).(SolidColorBrush.Color)"
......
146 147
                            <Storyboard>
147 148
                                <DoubleAnimation Duration="0:0:0.2"
148 149
                                                 Storyboard.TargetName="arrow"
149
                                                 Storyboard.TargetProperty="(FrameworkElement.RenderTransform).Angle"
150
                                                 Storyboard.TargetProperty="(UIElement.RenderTransform).Angle"
150 151
                                                 To="0" />
151 152
                            </Storyboard>
152 153
                        </VisualState>
......
239 240
                                </ObjectAnimationUsingKeyFrames>
240 241
                                <DoubleAnimation Duration="0:0:0"
241 242
                                                 Storyboard.TargetName="arrowPanel"
242
                                                 Storyboard.TargetProperty="(FrameworkElement.RenderTransform).Angle"
243
                                                 Storyboard.TargetProperty="(UIElement.RenderTransform).Angle"
243 244
                                                 To="90" />
244 245
                            </Storyboard>
245 246
                        </VisualState>
......
268 269
                                </ObjectAnimationUsingKeyFrames>
269 270
                                <DoubleAnimation Duration="0:0:0"
270 271
                                                 Storyboard.TargetName="arrowPanel"
271
                                                 Storyboard.TargetProperty="(FrameworkElement.RenderTransform).Angle"
272
                                                 Storyboard.TargetProperty="(UIElement.RenderTransform).Angle"
272 273
                                                 To="-90" />
273 274
                            </Storyboard>
274 275
                        </VisualState>
......
297 298
                                </ObjectAnimationUsingKeyFrames>
298 299
                                <DoubleAnimation Duration="0:0:0"
299 300
                                                 Storyboard.TargetName="arrowPanel"
300
                                                 Storyboard.TargetProperty="(FrameworkElement.RenderTransform).Angle"
301
                                                 Storyboard.TargetProperty="(UIElement.RenderTransform).Angle"
301 302
                                                 To="180" />
302 303
                            </Storyboard>
303 304
                        </VisualState>
......
353 354
                                                 FontStyle="{TemplateBinding FontStyle}"
354 355
                                                 FontWeight="{TemplateBinding FontWeight}"
355 356
                                                 Foreground="{TemplateBinding Foreground}"
356
                                                 IsChecked="{Binding IsExpanded,
357
                                                                     Mode=TwoWay,
358
                                                                     RelativeSource={RelativeSource TemplatedParent}}"
357
                                                 IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
359 358
                                                 IsTabStop="{TemplateBinding IsTabStop}"
360 359
                                                 Padding="{TemplateBinding Padding}"
361 360
                                                 TabIndex="{TemplateBinding TabIndex}"
......
458 457
                                                           Margin="2" Foreground="White" Content="Show All Pages" x:Name="btnPanorama" Click="btnPanorama_Click" Background="#FF0054B9" HorizontalAlignment="Right"/>
459 458
                    <Border BorderThickness="1" Margin="1" Grid.Row="1" BorderBrush="#FFC9C9C9" Background="White">
460 459
                        <StackPanel>
461
                            <RadioButton Content="All Pages" IsChecked="True" telerik:StyleManager.Theme="Office2013" FontSize="10" Margin="5,3" Click="ShowPageChange" x:Name="rdoAllPages"/>
462
                            <RadioButton Content="Favorited Pages"  FontSize="10" Margin="5,3" x:Name="rdoFavoritePages" Click="ShowPageChange" />
463
                            <Grid Margin="4.5,0">
464
                                <telerik:RadExpander Name="expCommentPages"
465
                                                 Padding="2" 
466
                                                 telerik:StyleManager.Theme="Office2016"
467
                                                 Template="{StaticResource RadExpanderControlTemplate1}">
468
                                    <telerik:RadExpander.Header>
469
                                        <TextBlock Text="Commented Pages" FontSize="10"  Margin="3,0"/>
470
                                    </telerik:RadExpander.Header>
471
                                    <telerik:RadExpander.Content>
472
                                        <ListBox x:Name="lstSelectComment"
473
                                             BorderBrush="{DynamicResource KCOMColor_ActiveBrush}"
474
                                             BorderThickness="2"
475
                                             ItemTemplate="{StaticResource CommentSelectTemplate}"
476
                                             telerik:StyleManager.Theme="Office2016" />
477
                                    </telerik:RadExpander.Content>
478
                                </telerik:RadExpander>
460
                            <RadioButton GroupName="grpPages" Content="All Pages" IsChecked="True" telerik:StyleManager.Theme="Office2013" FontSize="10" Margin="5,3" Checked="ShowPageChange" x:Name="rdoAllPages"/>
461
                            <RadioButton GroupName="grpPages" Content="Favorited Pages" FontSize="10" Margin="5,3" x:Name="rdoFavoritePages" Checked="ShowPageChange" />
462
                            <RadioButton GroupName="grpPages" Content="Commented Pages" FontSize="10" Margin="5,3" x:Name="rdoCommentPages" Checked="ShowPageChange" />
463
                            <Grid Margin="4.5,0" Visibility="{Binding IsChecked, Converter={StaticResource BooleanToVisibilityConverter}, ElementName=rdoCommentPages}">
464
                                <ListBox x:Name="lstSelectComment"
465
                                            BorderBrush="{DynamicResource KCOMColor_ActiveBrush}"
466
                                            BorderThickness="2"
467
                                            ItemTemplate="{StaticResource CommentSelectTemplate}"
468
                                            telerik:StyleManager.Theme="Office2016" />
479 469
                                <!--  <telerik:RadComboBox ClearSelectionButtonVisibility="Visible" ClearSelectionButtonContent="Select All" FontSize="10" Margin="14,0,0,0" x:Name="cboSelectComment" telerik:StyleManager.Theme="Windows8" BorderBrush="#FFA09E9E" ItemTemplate="{StaticResource CommentSelectTemplate}" SelectAllTextEvent="SelectionChanged"/>  -->
480 470
                            </Grid>
481 471
                        </StackPanel>
......
510 500
                                        ScrollViewer.HorizontalScrollBarVisibility="Disabled"
511 501
                                        ScrollViewer.VerticalScrollBarVisibility="Auto"                                        
512 502
                                        ScrollViewer.CanContentScroll="True"
513
                                        telerik:StyleManager.Theme="Office2016" >
514
                        <telerik:RadListBox.ItemsPanel>
503
                                        telerik:StyleManager.Theme="Office2016" 
504
                                        ItemsSource="{Binding FilteredThumbnail.View, ElementName=userControl}" >
505
                        <!--<telerik:RadListBox.ItemsPanel>
515 506
                            <ItemsPanelTemplate>
516 507
                                <VirtualizingStackPanel/>
517 508
                            </ItemsPanelTemplate>
518
                        </telerik:RadListBox.ItemsPanel>
509
                        </telerik:RadListBox.ItemsPanel>-->
519 510
                        <telerik:RadListBox.ItemTemplate>
520 511
                            <DataTemplate>
521 512
                                <Grid x:Name="LayoutRoot">
......
536 527
                                        </Grid>
537 528
                                        <TextBlock Grid.Row="1" Text="{Binding PageNumber, FallbackValue=PageNo}" FontStyle="Italic" FontSize="14" VerticalAlignment="Bottom" HorizontalAlignment="Center"/>
538 529
                                    </Grid>
539
                                    <Border Width="30" Height="20" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="10,5">
540
                                        <controls:MarkupColorList  ColorList="{Binding DisplayColorItems,Mode=TwoWay}"  Opacity="90"/>
530
                                    <Border Width="30" Height="20" VerticalAlignment="Top" Opacity="90" HorizontalAlignment="Right" Margin="10,5"
531
                                            Background="{Binding DisplayColorItems, Converter={StaticResource ColorListToBrushConverter}}">
532
                                        <!--<controls:MarkupColorList  ColorList="{Binding DisplayColorItems}"  Opacity="90"/>-->
541 533
                                    </Border>
542 534
                                </Grid>
543 535
                            </DataTemplate>
KCOM/Controls/Sample.xaml.cs
13 13
using System.Threading.Tasks;
14 14
using System.Windows;
15 15
using System.Windows.Controls;
16
using System.Windows.Data;
16 17
using System.Windows.Input;
17 18
using System.Windows.Media;
18 19
using Telerik.Windows.Controls;
......
54 55
            if(!_Initialize)
55 56
            {
56 57
                _Initialize = true;
57

  
58
                this.SizeChanged += Sample_SizeChanged;
58 59
                this.lstSelectComment.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(lstSelectComment_SelectionChanged);
59 60
                this.ImgListbox.SelectionChanged += new SelectionChangedEventHandler(ImgListbox_SelectionChanged);                
60 61
            }            
61 62
        }
62 63

  
64
        private void Sample_SizeChanged(object sender, SizeChangedEventArgs e)
65
        {
66
            if(e.WidthChanged)
67
            {
68
                ImgListbox.UpdateLayout();
69
            }
70
        }
71

  
72
        public static readonly DependencyProperty FilteredThumbnailProperty =  DependencyProperty.Register("FilteredThumbnail", typeof(CollectionViewSource),typeof(Sample));
73
        public CollectionViewSource FilteredThumbnail
74
        {
75
            get { return (CollectionViewSource)GetValue(FilteredThumbnailProperty); }
76
            set { SetValue(FilteredThumbnailProperty, value); }
77
        }
78

  
79
        public static readonly DependencyProperty CurrentPageProperty 
80
            = DependencyProperty.Register("CurrentPage", typeof(ThumbnailItem), typeof(Sample),new PropertyMetadata(null,CurrentPageChnaged));
81

  
82
        private static void CurrentPageChnaged(DependencyObject d, DependencyPropertyChangedEventArgs e)
83
        {
84
            //var owner = d as Sample;
85

  
86
            //if (owner?.UsersCommentPagesList != null)
87
            //{
88
            //    owner.SetCommentPages();
89
            //}
90
        }
91

  
92
        public ThumbnailItem CurrentPage
93
        {
94
            get { return (ThumbnailItem)GetValue(CurrentPageProperty); }
95
            set { SetValue(CurrentPageProperty, value); }
96
        }
97

  
63 98
        public ObservableCollection<ThumbnailItem> _thumbnailItems;
64 99
        private List<DOCPAGE> _PageList = null;
65 100
        private string _DefaultUri = null;
66
        public ThumbnailItem CurrentPage = null;
67 101
        public int PageCount = 0;
68 102
        private bool _Initialize;
69 103

  
......
115 149
        {
116 150
            //rdoAllPages.Checked += new RoutedEventHandler(rdoCommented_Checked);
117 151
            //rdoFavoritePages.Checked += new RoutedEventHandler(rdoFavoritePages_Checked);
118
            expCommentPages.PreviewCollapsed += new Telerik.Windows.RadRoutedEventHandler(expCommentPages_PreviewCollapsed);
119
            expCommentPages.PreviewExpanded += new Telerik.Windows.RadRoutedEventHandler(expCommentPages_PreviewExpanded);
120 152

  
121 153
            this._PageList = PageList;
122 154
            this._DefaultUri = DefaultUri;
......
125 157

  
126 158
            //samplePageStorage = new PageManager.PageStorage(_DefaultUri, tempStoragePath,"jpg", _PageList.Count(), _PageList.Count());
127 159

  
128
            if (cts != null)
129
            {
130
                cts.CancelAfter(100);
131
            }
132

  
133
            cts = new CancellationTokenSource();
134

  
135
            await this.Dispatcher.InvokeAsync(()=> ThumbnailSetAsync(cts.Token));
160
            await this.Dispatcher.InvokeAsync(()=> ThumbnailSetAsync());
136 161
            
137 162
            this.PageCount = PageList.Count();
138 163

  
......
143 168
        void rdoCommented_Checked(object sender, RoutedEventArgs e)
144 169
        {
145 170
            Logger.sendCheckLog("rdoCommented_Checked", 1);
146
            if (rdoAllPages.IsChecked == true) expCommentPages.IsExpanded = false;
147 171
            SetCommentPages();
148 172
        }
149 173

  
150 174
        void rdoFavoritePages_Checked(object sender, RoutedEventArgs e)
151 175
        {
152 176
            Logger.sendCheckLog("rdoFavoritePages_Checked", 1);
153
            if (rdoFavoritePages.IsChecked == true)
154
                expCommentPages.IsExpanded = false;
177
            //if (rdoFavoritePages.IsChecked == true)
178
            //    expCommentPages.IsExpanded = false;
155 179

  
156
            _FavoriteSet = _FavoriteSet == null ? new List<FAVORITE_DOC>() : _FavoriteSet;
157
            if (_FavoriteSet.Count > 0)
158
            {
159
                SetCommentPages(); //수정    
160
            }
161
            else
162
            {
163
                rdoAllPages.IsChecked = true;
164
                rdoFavoritePages.IsChecked = false;
165
            }
180
            //_FavoriteSet = _FavoriteSet == null ? new List<FAVORITE_DOC>() : _FavoriteSet;
181
            //if (_FavoriteSet.Count > 0)
182
            //{
183
            //    SetCommentPages(); //수정    
184
            //}
185
            //else
186
            //{
187
            //    rdoAllPages.IsChecked = true;
188
            //    rdoFavoritePages.IsChecked = false;
189
            //}
166 190
        }
167 191

  
168 192
        private async void ShowPageChange(object sender, RoutedEventArgs e)
169 193
        {
170
            if (rdoAllPages.IsChecked == true) expCommentPages.IsExpanded = false;
171

  
172
            if (cts != null)
194
            if (_Initialize)
173 195
            {
174
                cts.CancelAfter(100);
196
                //if (rdoAllPages.IsChecked == true) expCommentPages.IsExpanded = false;
197
                await this.Dispatcher.InvokeAsync(() => ThumbnailSetAsync());
175 198
            }
176

  
177
            cts = new CancellationTokenSource();
178

  
179
            await this.Dispatcher.InvokeAsync(() => ThumbnailSetAsync(cts.Token));
180 199
        }
181 200

  
182 201
        void expCommentPages_PreviewCollapsed(object sender, Telerik.Windows.RadRoutedEventArgs e)
......
448 467
            {
449 468
                data.Angle = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString());
450 469

  
451
                instanceMain.dzMainMenu.pageNavigator.ImgListbox.ItemsSource = instanceMain.dzMainMenu.pageNavigator._thumbnailItems;
470
                //instanceMain.dzMainMenu.pageNavigator.ImgListbox.ItemsSource = instanceMain.dzMainMenu.pageNavigator._thumbnailItems;
452 471
                var instance = instanceMain.dzMainMenu.CurrentDoc.docInfo.DOCPAGE.Where(p => p.PAGE_NUMBER == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).FirstOrDefault();
453 472
                instance.PAGE_ANGLE = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString());
454 473

  
......
478 497

  
479 498
        public async void SetCommentPages()
480 499
        {
481
            if (cts != null)
482
            {
483
                cts.CancelAfter(100);
484
            }
485

  
486
            cts = new CancellationTokenSource();
487

  
488
            await this.Dispatcher.InvokeAsync(() => ThumbnailSetAsync(cts.Token));
489
            //SetCommentList(UsersCommentPagesList.ToList());
500
            await this.Dispatcher.InvokeAsync(() => ThumbnailSetAsync());
490 501
        }
491 502

  
492 503
        public void SetCommentList(List<UsersCommentPagesMember> UsersCommentPagesList)
......
556 567
            {
557 568
                item.DisplayColorItems = setColorMarkupItems.Where(color => color.Page == item.PageNumber).ToList();
558 569
            }
559
            
570

  
560 571
            Logger.sendCheckLog("SetCommentList_SelectComment.ItemsSource 설정", 1);
561 572
            var data = UsersCommentPagesList.OrderByDescending(p => p.isConSolidation == Convert.ToInt32(true)).ToList();
562 573
            if (data.Count() != 0)
......
586 597

  
587 598
        }
588 599

  
589
        CancellationTokenSource cts = null;
600
        List<int> FilterPages = null;
590 601

  
591
        private void ThumbnailSetAsync(CancellationToken ct)
602
        private void ThumbnailSetAsync()
592 603
        {
593 604
            Logger.sendCheckLog("ThumbnailSet", 1);
594 605

  
595
            _thumbnailItems = new ObservableCollection<ThumbnailItem>();
596
            ImgListbox.ItemsSource = null;
597

  
598
            IEnumerable<int> selectComment = null;
599
            IEnumerable<DOCPAGE> pageList = null;
600

  
601
            if (this.lstSelectComment.ItemsSource != null)
606
            if (FilteredThumbnail == null)
602 607
            {
603
                selectComment = (from commentPage in this.UsersCommentPagesList
604
                                 where commentPage.IsSelected == true
605
                                 select commentPage.PageNumber).SelectMany(x => x).Distinct();
606
            }
607

  
608
            var uri = _DefaultUri.Replace("{0}/{1}_{2}", "8/0_0");
608
                var uri = _DefaultUri.Replace("{0}/{1}_{2}", "8/0_0");
609 609

  
610
            if (rdoAllPages.IsChecked == true)
611
            {
612
                pageList = ViewerDataModel.Instance.Document_Info;
613
            }
614
            else if (expCommentPages.IsExpanded == true)
615
            {
616
                if (selectComment != null)
617
                {
618
                    pageList = ViewerDataModel.Instance.Document_Info
619
                                .Where(p => selectComment.Where(s => s == p.PAGE_NUMBER).Count() > 0);
620
                }
621
            }
622
            else if (rdoFavoritePages.IsChecked == true)
623
            {
624
                if (_FavoriteSet != null)
625
                {
626
                    pageList = ViewerDataModel.Instance.Document_Info
627
                                .Where(p => _FavoriteSet.Where(data => data.PAGE_NO == p.PAGE_NUMBER).FirstOrDefault() != null);
628
                }
629
            }
610
                var pageList = ViewerDataModel.Instance.Document_Info;
630 611

  
631
            if (pageList?.Count() > 0)
632
            {
633 612
                var items = from page in pageList
634 613
                            let pageLink = uri.Replace("{PageNo}", page.PAGE_NUMBER.ToString())
635 614
                            orderby page.PAGE_NUMBER
......
641 620
                                Angle = page.PAGE_ANGLE
642 621
                            };
643 622

  
623
                _thumbnailItems = new ObservableCollection<ThumbnailItem>(items);
624
                FilteredThumbnail = new CollectionViewSource();
625
                FilteredThumbnail.Source = _thumbnailItems;
626

  
627
                FilterPages = _thumbnailItems.Select(x=>x.PageNumber).ToList();
644 628

  
645
                if (items.Count() > 0)
629
                FilteredThumbnail.Filter += (snd,evt) =>
646 630
                {
647
                    try
631
                    if (FilterPages?.Count() > 0 && evt.Item != null)
648 632
                    {
649
                        //await this.Dispatcher.InvokeAsync(() =>
650
                        //{
651
                            foreach (var item in items.ToList())
652
                            {
653
                                if (!ct.IsCancellationRequested)
654
                                {
655
                                    _thumbnailItems.Add(item);
656
                                    System.Diagnostics.Debug.WriteLine("Page Set : " + item.PageNumber);
657
                                }
658
                            }
659
                        //}, System.Windows.Threading.DispatcherPriority.Background, ct);
633
                        evt.Accepted = FilterPages.Contains((evt.Item as ThumbnailItem).PageNumber);
660 634
                    }
661
                    catch (OperationCanceledException ex)
635
                    else
662 636
                    {
663

  
637
                        evt.Accepted = false;
664 638
                    }
665
                    
666
                    SetCommentList(UsersCommentPagesList.ToList());
639
                };
667 640

  
668
                    ImgListbox.ItemsSource = _thumbnailItems;
641
            }
669 642

  
670
                    if (_thumbnailItems.Count() > 0)
671
                    {
672
                        ImgListbox.SelectedItem = _thumbnailItems[0];
643
            FilterPages.Clear();
673 644

  
674
                        if (ThumbInitialized != null)
675
                        {
676
                            ThumbInitialized(this, new EventArgs());
677
                        }
645

  
646
            if (rdoAllPages.IsChecked == true)
647
            {
648
                FilterPages = _thumbnailItems.Select(x=>x.PageNumber).ToList();
649
            }
650
            else if (rdoFavoritePages.IsChecked == true)
651
            {
652
                if (_FavoriteSet != null)
653
                {
654
                    FilterPages = (from thumb in _thumbnailItems
655
                                where _FavoriteSet.Where(data => data.PAGE_NO == thumb.PageNumber).FirstOrDefault() != null
656
                                select thumb.PageNumber).ToList();
657
                }
658
            }
659
            else if (rdoCommentPages.IsChecked == true)
660
            {
661
                if (this.lstSelectComment.ItemsSource != null)
662
                {
663
                    var commentPages = (from commentPage in this.UsersCommentPagesList
664
                                        where commentPage.IsSelected == true
665
                                        select commentPage.PageNumber).SelectMany(x => x).Distinct();
666

  
667
                    if (commentPages?.Count() > 0)
668
                    {
669
                        FilterPages = (from thumb in _thumbnailItems
670
                                       where commentPages.Where(s => s == thumb.PageNumber).Count() > 0
671
                                       select thumb.PageNumber).ToList();
678 672
                    }
679
                    //ImgListbox.UpdateLayout();
673
                }
674
            }
675

  
676
            if (FilterPages != null)
677
            {
678
                FilteredThumbnail.View.Refresh();
679

  
680
                if (FilterPages.Count() > 0)
681
                {
682
                    ImgListbox.SelectedItem = _thumbnailItems.Where(x=>x.PageNumber == FilterPages.FirstOrDefault()).FirstOrDefault();
683
                    //SetCommentList(UsersCommentPagesList.ToList());
684
                }
685
                else
686
                {
687
                    ImgListbox.SelectedItem = null;
688
                }
689

  
690
                if (ThumbInitialized != null)
691
                {
692
                    ThumbInitialized(this, new EventArgs());
693
                    ThumbInitialized = null;
680 694
                }
681 695
            }
682 696
        }
KCOM/KCOM.csproj
410 410
    <Compile Include="Behaviors\ListViewColumnSizeAutoBehavior.cs" />
411 411
    <Compile Include="Behaviors\RadListBoxDragVisualProvider.cs" />
412 412
    <Compile Include="Behaviors\WindowBehavior.cs" />
413
    <Compile Include="Common\Converter\ColorListToBrushConverter.cs" />
413 414
    <Compile Include="Common\Converter\ZeroToCollapsedConverter.cs" />
414 415
    <Compile Include="Common\DataSaveTask.cs" />
415 416
    <Compile Include="Common\Check_Inferface.cs" />
KCOM/KCOM.csproj.user
13 13
    <VerifyUploadedFiles>false</VerifyUploadedFiles>
14 14
  </PropertyGroup>
15 15
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
16
    <StartArguments>eyJEb2N1bWVudEl0ZW1JRCI6IjMwMDAwMTUxIiwiYlBhcnRuZXIiOmZhbHNlLCJDcmVhdGVGaW5hbFBERlBlcm1pc3Npb24iOnRydWUsIk5ld0NvbW1lbnRQZXJtaXNzaW9uIjp0cnVlLCJQcm9qZWN0Tk8iOiIwMDAwMDAiLCJVc2VySUQiOiJkb2Z0ZWNoIiwiTW9kZSI6MH0=/</StartArguments>
16
    <StartArguments>eyJEb2N1bWVudEl0ZW1JRCI6IjUwMDAwMDEwIiwiYlBhcnRuZXIiOmZhbHNlLCJDcmVhdGVGaW5hbFBERlBlcm1pc3Npb24iOnRydWUsIk5ld0NvbW1lbnRQZXJtaXNzaW9uIjp0cnVlLCJQcm9qZWN0Tk8iOiIwMDAwMDAiLCJVc2VySUQiOiJkb2Z0ZWNoIiwiTW9kZSI6MH0=/</StartArguments>
17 17
  </PropertyGroup>
18 18
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
19 19
    <StartArguments>eyJEb2N1bWVudEl0ZW1JRCI6IjQwMDAwMTQ5IiwiYlBhcnRuZXIiOmZhbHNlLCJDcmVhdGVGaW5hbFBERlBlcm1pc3Npb24iOnRydWUsIk5ld0NvbW1lbnRQZXJtaXNzaW9uIjp0cnVlLCJQcm9qZWN0Tk8iOiIwMDAwMDAiLCJVc2VySUQiOiJhZG1pbiIsIk1vZGUiOjB9</StartArguments>
KCOM/Services/BaseServices.cs
580 580
                List<MarkupInfoItem> gridSelectionItem = gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업
581 581
                List<MarkupInfoItem> gridNonSelectionItem = gridItem.Except(gridSelectionItem).ToList(); //선택 되지 않은 마크업
582 582
                #region 코멘트 보기
583
                if (e.AddedItems.Count() > 0)
583
                if (e.AddedItems.Count() > 0 && this.pageNavigator.CurrentPage != null)
584 584
                {
585 585
                    foreach (var item in gridSelectionItem)
586 586
                    {
KCOM/Views/MainMenu.xaml.cs
912 912
                }                   
913 913
            }
914 914
            
915
            this.pageNavigator.SetCommentList(_pages.ToList());
915
           this.pageNavigator.SetCommentList(_pages.ToList());
916 916
        }
917 917

  
918 918
        public void MarkupitemViewUpdate(string markupinfo_id)

내보내기 Unified diff

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