1 |
787a4489
|
KangIngu
|
using IKCOM;
|
2 |
|
|
using KCOM.Common;
|
3 |
|
|
using KCOMDataModel.DataModel;
|
4 |
4eb052e4
|
ljiyeon
|
using MarkupToPDF.Common;
|
5 |
5529d2a2
|
humkyung
|
using MarkupToPDF.Controls.Parsing;
|
6 |
787a4489
|
KangIngu
|
using System;
|
7 |
|
|
using System.Collections.Generic;
|
8 |
|
|
using System.Collections.ObjectModel;
|
9 |
|
|
using System.ComponentModel;
|
10 |
0c997b99
|
ljiyeon
|
using System.Diagnostics;
|
11 |
787a4489
|
KangIngu
|
using System.Linq;
|
12 |
6c687be8
|
taeseongkim
|
using System.Threading;
|
13 |
54a28343
|
taeseongkim
|
using System.Threading.Tasks;
|
14 |
787a4489
|
KangIngu
|
using System.Windows;
|
15 |
|
|
using System.Windows.Controls;
|
16 |
d18ea2bd
|
taeseongkim
|
using System.Windows.Data;
|
17 |
787a4489
|
KangIngu
|
using System.Windows.Input;
|
18 |
83a98e96
|
송근호
|
using System.Windows.Media;
|
19 |
787a4489
|
KangIngu
|
using Telerik.Windows.Controls;
|
20 |
4eb052e4
|
ljiyeon
|
using static MarkupToPDF.Controls.Parsing.MarkupParser;
|
21 |
787a4489
|
KangIngu
|
|
22 |
|
|
namespace KCOM.Controls
|
23 |
|
|
{
|
24 |
|
|
/// <summary>
|
25 |
|
|
/// Interaction logic for PageNavigator.xaml
|
26 |
|
|
/// </summary>
|
27 |
|
|
public partial class Sample : UserControl, INotifyPropertyChanged
|
28 |
|
|
{
|
29 |
992a98b4
|
KangIngu
|
public List<FAVORITE_DOC> _FavoriteSet { get; set; }
|
30 |
787a4489
|
KangIngu
|
public event PropertyChangedEventHandler PropertyChanged;
|
31 |
c5519c44
|
taeseongkim
|
public DelegateCommand SelectCommentCommand { get; private set; }
|
32 |
54a28343
|
taeseongkim
|
|
33 |
6c687be8
|
taeseongkim
|
//PageManager.PageStorage samplePageStorage;
|
34 |
54a28343
|
taeseongkim
|
|
35 |
787a4489
|
KangIngu
|
public Sample()
|
36 |
f65e6c02
|
taeseongkim
|
{
|
37 |
|
|
InitializeComponent();
|
38 |
|
|
|
39 |
|
|
if (App.IsDesignMode)
|
40 |
2089959a
|
taeseongkim
|
{
|
41 |
|
|
return;
|
42 |
|
|
}
|
43 |
|
|
|
44 |
f65e6c02
|
taeseongkim
|
//App.splashString(ISplashMessage.SAMPLE);
|
45 |
0c997b99
|
ljiyeon
|
this.Loaded += Sample_Loaded;
|
46 |
d97dbc7f
|
taeseongkim
|
this.Unloaded += Sample_Unloaded;
|
47 |
|
|
}
|
48 |
|
|
|
49 |
|
|
private void Sample_Unloaded(object sender, RoutedEventArgs e)
|
50 |
|
|
{
|
51 |
6c687be8
|
taeseongkim
|
|
52 |
0c997b99
|
ljiyeon
|
}
|
53 |
|
|
|
54 |
|
|
private void Sample_Loaded(object sender, RoutedEventArgs e)
|
55 |
|
|
{
|
56 |
afaa7c92
|
djkim
|
if(!_Initialize)
|
57 |
|
|
{
|
58 |
|
|
_Initialize = true;
|
59 |
c5519c44
|
taeseongkim
|
|
60 |
|
|
SelectCommentCommand = new DelegateCommand(SetCommentPages);
|
61 |
|
|
|
62 |
d18ea2bd
|
taeseongkim
|
this.SizeChanged += Sample_SizeChanged;
|
63 |
afaa7c92
|
djkim
|
this.lstSelectComment.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(lstSelectComment_SelectionChanged);
|
64 |
|
|
this.ImgListbox.SelectionChanged += new SelectionChangedEventHandler(ImgListbox_SelectionChanged);
|
65 |
|
|
}
|
66 |
787a4489
|
KangIngu
|
}
|
67 |
|
|
|
68 |
d18ea2bd
|
taeseongkim
|
private void Sample_SizeChanged(object sender, SizeChangedEventArgs e)
|
69 |
|
|
{
|
70 |
|
|
if(e.WidthChanged)
|
71 |
|
|
{
|
72 |
|
|
ImgListbox.UpdateLayout();
|
73 |
|
|
}
|
74 |
|
|
}
|
75 |
|
|
|
76 |
|
|
public static readonly DependencyProperty FilteredThumbnailProperty = DependencyProperty.Register("FilteredThumbnail", typeof(CollectionViewSource),typeof(Sample));
|
77 |
|
|
public CollectionViewSource FilteredThumbnail
|
78 |
|
|
{
|
79 |
|
|
get { return (CollectionViewSource)GetValue(FilteredThumbnailProperty); }
|
80 |
|
|
set { SetValue(FilteredThumbnailProperty, value); }
|
81 |
|
|
}
|
82 |
|
|
|
83 |
|
|
public static readonly DependencyProperty CurrentPageProperty
|
84 |
|
|
= DependencyProperty.Register("CurrentPage", typeof(ThumbnailItem), typeof(Sample),new PropertyMetadata(null,CurrentPageChnaged));
|
85 |
|
|
|
86 |
|
|
private static void CurrentPageChnaged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
87 |
|
|
{
|
88 |
|
|
//var owner = d as Sample;
|
89 |
|
|
|
90 |
|
|
//if (owner?.UsersCommentPagesList != null)
|
91 |
|
|
//{
|
92 |
|
|
// owner.SetCommentPages();
|
93 |
|
|
//}
|
94 |
|
|
}
|
95 |
|
|
|
96 |
|
|
public ThumbnailItem CurrentPage
|
97 |
|
|
{
|
98 |
|
|
get { return (ThumbnailItem)GetValue(CurrentPageProperty); }
|
99 |
|
|
set { SetValue(CurrentPageProperty, value); }
|
100 |
|
|
}
|
101 |
|
|
|
102 |
787a4489
|
KangIngu
|
public ObservableCollection<ThumbnailItem> _thumbnailItems;
|
103 |
|
|
private List<DOCPAGE> _PageList = null;
|
104 |
|
|
private string _DefaultUri = null;
|
105 |
|
|
public int PageCount = 0;
|
106 |
|
|
private bool _Initialize;
|
107 |
54a28343
|
taeseongkim
|
|
108 |
|
|
public event EventHandler<EventArgs> ThumbInitialized;
|
109 |
787a4489
|
KangIngu
|
public event EventHandler<PageChangeEventArgs> PageChanged;
|
110 |
|
|
public event EventHandler<PageChangeEventArgs> PageChanging;
|
111 |
f65e6c02
|
taeseongkim
|
|
112 |
c5519c44
|
taeseongkim
|
private ObservableCollection<UsersCommentPagesMember> _UsersCommentPagesList;
|
113 |
f65e6c02
|
taeseongkim
|
|
114 |
c5519c44
|
taeseongkim
|
public ObservableCollection<UsersCommentPagesMember> UsersCommentPagesList
|
115 |
f65e6c02
|
taeseongkim
|
{
|
116 |
|
|
get {
|
117 |
|
|
if(_UsersCommentPagesList == null)
|
118 |
|
|
{
|
119 |
c5519c44
|
taeseongkim
|
_UsersCommentPagesList = new ObservableCollection<UsersCommentPagesMember>();
|
120 |
f65e6c02
|
taeseongkim
|
}
|
121 |
|
|
|
122 |
|
|
return _UsersCommentPagesList; }
|
123 |
|
|
set { _UsersCommentPagesList = value; }
|
124 |
|
|
}
|
125 |
|
|
|
126 |
787a4489
|
KangIngu
|
public class PageChangeEventArgs : EventArgs
|
127 |
|
|
{
|
128 |
|
|
public DOCPAGE CurrentPage { get; set; }
|
129 |
|
|
public string PageUri { get; set; }
|
130 |
|
|
public int PageNumber { get; set; }
|
131 |
|
|
}
|
132 |
|
|
private bool _IsFitOn { get; set; }
|
133 |
|
|
public bool IsFitOn
|
134 |
|
|
{
|
135 |
|
|
get
|
136 |
|
|
{
|
137 |
|
|
return _IsFitOn;
|
138 |
|
|
}
|
139 |
|
|
set
|
140 |
|
|
{
|
141 |
|
|
_IsFitOn = value;
|
142 |
|
|
RaisePropertyChanged("IsFitOn");
|
143 |
|
|
}
|
144 |
|
|
}
|
145 |
|
|
|
146 |
|
|
public void RaisePropertyChanged(string propName)
|
147 |
|
|
{
|
148 |
|
|
if (PropertyChanged != null)
|
149 |
|
|
PropertyChanged(this, new PropertyChangedEventArgs(propName));
|
150 |
|
|
}
|
151 |
|
|
|
152 |
54a28343
|
taeseongkim
|
public async Task SetPageNaviAsync(List<DOCPAGE> PageList, string DefaultUri)
|
153 |
787a4489
|
KangIngu
|
{
|
154 |
6c687be8
|
taeseongkim
|
//rdoAllPages.Checked += new RoutedEventHandler(rdoCommented_Checked);
|
155 |
|
|
//rdoFavoritePages.Checked += new RoutedEventHandler(rdoFavoritePages_Checked);
|
156 |
|
|
|
157 |
787a4489
|
KangIngu
|
this._PageList = PageList;
|
158 |
|
|
this._DefaultUri = DefaultUri;
|
159 |
54a28343
|
taeseongkim
|
|
160 |
|
|
string tempStoragePath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "MARKUS", System.IO.Path.GetRandomFileName());
|
161 |
|
|
|
162 |
6c687be8
|
taeseongkim
|
//samplePageStorage = new PageManager.PageStorage(_DefaultUri, tempStoragePath,"jpg", _PageList.Count(), _PageList.Count());
|
163 |
54a28343
|
taeseongkim
|
|
164 |
d18ea2bd
|
taeseongkim
|
await this.Dispatcher.InvokeAsync(()=> ThumbnailSetAsync());
|
165 |
54a28343
|
taeseongkim
|
|
166 |
787a4489
|
KangIngu
|
this.PageCount = PageList.Count();
|
167 |
54a28343
|
taeseongkim
|
|
168 |
787a4489
|
KangIngu
|
//ThumbNmailSet();
|
169 |
6c687be8
|
taeseongkim
|
|
170 |
787a4489
|
KangIngu
|
}
|
171 |
39f0624f
|
ljiyeon
|
|
172 |
787a4489
|
KangIngu
|
void rdoCommented_Checked(object sender, RoutedEventArgs e)
|
173 |
|
|
{
|
174 |
548c696e
|
ljiyeon
|
Logger.sendCheckLog("rdoCommented_Checked", 1);
|
175 |
787a4489
|
KangIngu
|
SetCommentPages();
|
176 |
|
|
}
|
177 |
|
|
|
178 |
|
|
void rdoFavoritePages_Checked(object sender, RoutedEventArgs e)
|
179 |
|
|
{
|
180 |
548c696e
|
ljiyeon
|
Logger.sendCheckLog("rdoFavoritePages_Checked", 1);
|
181 |
d18ea2bd
|
taeseongkim
|
//if (rdoFavoritePages.IsChecked == true)
|
182 |
|
|
// expCommentPages.IsExpanded = false;
|
183 |
992a98b4
|
KangIngu
|
|
184 |
d18ea2bd
|
taeseongkim
|
//_FavoriteSet = _FavoriteSet == null ? new List<FAVORITE_DOC>() : _FavoriteSet;
|
185 |
|
|
//if (_FavoriteSet.Count > 0)
|
186 |
|
|
//{
|
187 |
|
|
// SetCommentPages(); //수정
|
188 |
|
|
//}
|
189 |
|
|
//else
|
190 |
|
|
//{
|
191 |
|
|
// rdoAllPages.IsChecked = true;
|
192 |
|
|
// rdoFavoritePages.IsChecked = false;
|
193 |
|
|
//}
|
194 |
992a98b4
|
KangIngu
|
}
|
195 |
|
|
|
196 |
6c687be8
|
taeseongkim
|
private async void ShowPageChange(object sender, RoutedEventArgs e)
|
197 |
992a98b4
|
KangIngu
|
{
|
198 |
d18ea2bd
|
taeseongkim
|
if (_Initialize)
|
199 |
6c687be8
|
taeseongkim
|
{
|
200 |
d18ea2bd
|
taeseongkim
|
//if (rdoAllPages.IsChecked == true) expCommentPages.IsExpanded = false;
|
201 |
|
|
await this.Dispatcher.InvokeAsync(() => ThumbnailSetAsync());
|
202 |
6c687be8
|
taeseongkim
|
}
|
203 |
787a4489
|
KangIngu
|
}
|
204 |
992a98b4
|
KangIngu
|
|
205 |
787a4489
|
KangIngu
|
void expCommentPages_PreviewCollapsed(object sender, Telerik.Windows.RadRoutedEventArgs e)
|
206 |
|
|
{
|
207 |
|
|
//txtThumbCount.Visibility = Visibility.Collapsed;
|
208 |
|
|
}
|
209 |
|
|
|
210 |
|
|
void expCommentPages_PreviewExpanded(object sender, Telerik.Windows.RadRoutedEventArgs e)
|
211 |
|
|
{
|
212 |
548c696e
|
ljiyeon
|
Logger.sendCheckLog("expCommentPages_PreviewExpanded", 1);
|
213 |
787a4489
|
KangIngu
|
rdoAllPages.IsChecked = false;
|
214 |
|
|
rdoFavoritePages.IsChecked = false;
|
215 |
|
|
//txtThumbCount.Visibility = Visibility.Visible;
|
216 |
|
|
SetCommentPages();
|
217 |
|
|
}
|
218 |
|
|
|
219 |
129ca191
|
humkyung
|
/// <summary>
|
220 |
|
|
/// called when image list box's selection is changed
|
221 |
|
|
/// </summary>
|
222 |
|
|
/// <param name="sender"></param>
|
223 |
|
|
/// <param name="e"></param>
|
224 |
ac4f1e13
|
taeseongkim
|
private async void ImgListbox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
|
225 |
eeb0a39c
|
taeseongkim
|
{
|
226 |
|
|
if(e.AddedItems.Count > 0)
|
227 |
787a4489
|
KangIngu
|
{
|
228 |
ac4f1e13
|
taeseongkim
|
await ImgListbox.Dispatcher.InvokeAsync(() =>
|
229 |
|
|
{
|
230 |
|
|
var number = (e.AddedItems[0] as KCOM.Common.ThumbnailItem).PageNumber;
|
231 |
eeb0a39c
|
taeseongkim
|
|
232 |
ac4f1e13
|
taeseongkim
|
ViewerDataModel.Instance.SystemMain.dzTopMenu._SaveEvent(null, null); /// save controls
|
233 |
787a4489
|
KangIngu
|
|
234 |
ac4f1e13
|
taeseongkim
|
this.CurrentPage = e.AddedItems[0] as KCOM.Common.ThumbnailItem;
|
235 |
|
|
|
236 |
|
|
PageChanging(this, new PageChangeEventArgs
|
237 |
|
|
{
|
238 |
|
|
CurrentPage = this._PageList.Where(p => p.PAGE_NUMBER == number).First(),
|
239 |
|
|
PageNumber = number,
|
240 |
|
|
PageUri = null
|
241 |
|
|
});
|
242 |
eeb0a39c
|
taeseongkim
|
|
243 |
|
|
});
|
244 |
787a4489
|
KangIngu
|
}
|
245 |
eeb0a39c
|
taeseongkim
|
|
246 |
|
|
|
247 |
|
|
//if (ImgListbox.SelectedItem != null)
|
248 |
|
|
//{
|
249 |
|
|
// int _CurrentPageNo = -1;
|
250 |
|
|
// if (this.CurrentPage != null)
|
251 |
|
|
// {
|
252 |
|
|
// ViewerDataModel.Instance.SystemMain.dzTopMenu._SaveEvent(null, null); /// save controls
|
253 |
|
|
|
254 |
|
|
// _CurrentPageNo = this.CurrentPage.PageNumber;
|
255 |
|
|
// }
|
256 |
|
|
|
257 |
|
|
// this.CurrentPage = ImgListbox.SelectedItem as ThumbnailItem;
|
258 |
|
|
// int iPageNo = this.CurrentPage.PageNumber;
|
259 |
|
|
// if(_CurrentPageNo != iPageNo)
|
260 |
|
|
// {
|
261 |
|
|
// PageChanging(this, new PageChangeEventArgs
|
262 |
|
|
// {
|
263 |
|
|
// CurrentPage = this._PageList.Where(p => p.PAGE_NUMBER == iPageNo).First(),
|
264 |
|
|
// PageNumber = iPageNo,
|
265 |
|
|
// PageUri = null
|
266 |
|
|
// });
|
267 |
|
|
// }
|
268 |
|
|
//}
|
269 |
3908a575
|
humkyung
|
|
270 |
2d584f1a
|
djkim
|
//var border = VisualTreeHelper.GetChild(ImgListbox, 0);
|
271 |
|
|
//if (border != null)
|
272 |
|
|
//{
|
273 |
|
|
// IEnumerable<ScrollViewer> scrollViewer = border.ChildrenOfType<ScrollViewer>();
|
274 |
|
|
|
275 |
|
|
//}
|
276 |
|
|
//ScrollViewer scrollViewer = (sender as RadListBox) as ScrollViewer;
|
277 |
|
|
|
278 |
|
|
|
279 |
|
|
//System.Diagnostics.Debug.WriteLine("page:"+ImgListbox.SelectedIndex);
|
280 |
787a4489
|
KangIngu
|
}
|
281 |
|
|
|
282 |
|
|
public bool GotoPageFlag = false;
|
283 |
|
|
|
284 |
b2a6b24a
|
humkyung
|
/// <summary>
|
285 |
|
|
/// 해당 썸네일로 이동
|
286 |
|
|
/// </summary>
|
287 |
3908a575
|
humkyung
|
/// <param name="_pageNumber">이동할 페이지 번호</param>
|
288 |
787a4489
|
KangIngu
|
public void GotoPage(int _pageNumber)
|
289 |
|
|
{
|
290 |
90e7968d
|
ljiyeon
|
try
|
291 |
787a4489
|
KangIngu
|
{
|
292 |
a1142a6b
|
taeseongkim
|
System.Threading.Tasks.Task.Factory.StartNew(() => {
|
293 |
|
|
|
294 |
|
|
var _page = _thumbnailItems.Where(item => item.PageNumber == _pageNumber);
|
295 |
|
|
if (_page.Count() > 0)
|
296 |
90e7968d
|
ljiyeon
|
{
|
297 |
a1142a6b
|
taeseongkim
|
ThumbnailItem thumbnailitem = _page.First();
|
298 |
|
|
if (PageChanging != null)
|
299 |
|
|
{
|
300 |
|
|
|
301 |
|
|
ImgListbox.Dispatcher.InvokeAsync(() => {
|
302 |
|
|
var _itemIndex = this._thumbnailItems.IndexOf(thumbnailitem);
|
303 |
|
|
ImgListbox.SelectedItem = thumbnailitem;
|
304 |
|
|
});
|
305 |
|
|
//ImgListbox.Items.MoveCurrentTo(thumbnailitem);
|
306 |
|
|
//if (_itemIndex < _thumbnailItems.Count() - 1)
|
307 |
|
|
// ImgListbox.ScrollIntoView(_itemIndex);
|
308 |
|
|
//else
|
309 |
|
|
// ImgListbox.ScrollIntoView(this._thumbnailItems.Count() - 1);
|
310 |
|
|
}
|
311 |
90e7968d
|
ljiyeon
|
}
|
312 |
a1142a6b
|
taeseongkim
|
|
313 |
|
|
}).ConfigureAwait(true);
|
314 |
787a4489
|
KangIngu
|
}
|
315 |
90e7968d
|
ljiyeon
|
catch(Exception ex)
|
316 |
|
|
{
|
317 |
|
|
Logger.sendResLog("GotoPage", ex.Message, 0);
|
318 |
|
|
}
|
319 |
|
|
}
|
320 |
787a4489
|
KangIngu
|
|
321 |
3908a575
|
humkyung
|
/// <summary>
|
322 |
|
|
/// 주어진 페이지로 변경한다
|
323 |
|
|
/// </summary>
|
324 |
|
|
/// <param name="iPageNo">변경할 페이지 번호</param>
|
325 |
|
|
public void ChangePage(int iPageNo)
|
326 |
787a4489
|
KangIngu
|
{
|
327 |
3908a575
|
humkyung
|
var thumbitem = this._thumbnailItems.Where(item => item.PageNumber == iPageNo).FirstOrDefault();
|
328 |
|
|
if ((PageChanged != null) && (thumbitem != null))
|
329 |
787a4489
|
KangIngu
|
{
|
330 |
d48260a2
|
djkim
|
var uri = thumbitem.PageUri.ToString();
|
331 |
|
|
//_DefaultUri.Replace("{PageNo}", thumbitem.PageNumber.ToString());
|
332 |
3908a575
|
humkyung
|
|
333 |
d48260a2
|
djkim
|
var _DocPages = _PageList.Where(p => p.PAGE_NUMBER == thumbitem.PageNumber).FirstOrDefault();
|
334 |
|
|
if (_DocPages != null)
|
335 |
3908a575
|
humkyung
|
{
|
336 |
|
|
PageChanged(this, new PageChangeEventArgs
|
337 |
787a4489
|
KangIngu
|
{
|
338 |
d48260a2
|
djkim
|
CurrentPage = _DocPages,
|
339 |
3908a575
|
humkyung
|
PageUri = uri,
|
340 |
|
|
PageNumber = thumbitem.PageNumber
|
341 |
787a4489
|
KangIngu
|
});
|
342 |
2d584f1a
|
djkim
|
//ImgListbox.SelectedItem = thumbitem;
|
343 |
|
|
//ImgListbox.Items.MoveCurrentTo(thumbitem);
|
344 |
|
|
|
345 |
944be2fa
|
djkim
|
this.CurrentPage = thumbitem;
|
346 |
3908a575
|
humkyung
|
}
|
347 |
|
|
else
|
348 |
|
|
{
|
349 |
|
|
//System.Diagnostics.Debug.WriteLine("페이지 정보가 없습니다");
|
350 |
787a4489
|
KangIngu
|
}
|
351 |
|
|
}
|
352 |
|
|
}
|
353 |
64f6713a
|
humkyung
|
|
354 |
d974f3f8
|
ljiyeon
|
public void GotoPageTALK(int _pageNumber, int _angle)
|
355 |
|
|
{
|
356 |
|
|
int _PageNo = -1;
|
357 |
|
|
|
358 |
|
|
if (int.TryParse(_pageNumber.ToString(), out _PageNo))
|
359 |
|
|
{
|
360 |
|
|
var _page = _thumbnailItems.Where(item => item.PageNumber == _PageNo);
|
361 |
|
|
if (_page.Count() > 0)
|
362 |
|
|
{
|
363 |
|
|
ThumbnailItem _item = _page.First();
|
364 |
|
|
setPageChangeTALK(_item, _angle);
|
365 |
|
|
this.ImgListbox.SelectedIndex = _pageNumber - 1;
|
366 |
6443ebfe
|
djkim
|
//this.ImgListbox.ScrollIntoView(_pageNumber - 1);
|
367 |
d974f3f8
|
ljiyeon
|
}
|
368 |
|
|
}
|
369 |
|
|
}
|
370 |
|
|
|
371 |
|
|
public void setPageChangeTALK(ThumbnailItem thumbnailItem, int _angle)
|
372 |
|
|
{
|
373 |
|
|
if (thumbnailItem != null)
|
374 |
|
|
{
|
375 |
|
|
if (PageChanging != null)
|
376 |
90e7968d
|
ljiyeon
|
{
|
377 |
3908a575
|
humkyung
|
///this.CurrentPage = _NextPage;
|
378 |
|
|
///_NextPage = thumbnailItem;
|
379 |
d974f3f8
|
ljiyeon
|
PageChanging(this, new PageChangeEventArgs
|
380 |
|
|
{
|
381 |
|
|
CurrentPage = _PageList.Where(p => p.PAGE_NUMBER == thumbnailItem.PageNumber).First(),
|
382 |
|
|
PageNumber = Convert.ToInt32(thumbnailItem.PageNumber),
|
383 |
|
|
PageUri = null
|
384 |
|
|
});
|
385 |
|
|
|
386 |
|
|
var instanceMain = this.ParentOfType<MainWindow>();
|
387 |
|
|
|
388 |
|
|
var rotationNum = (_angle - instanceMain.dzMainMenu.rotate.Angle) / 90;
|
389 |
|
|
|
390 |
|
|
if (rotationNum > 0) // 1, 2, 3
|
391 |
|
|
{
|
392 |
90e7968d
|
ljiyeon
|
for (int i = 0; i < rotationNum; i++)
|
393 |
d974f3f8
|
ljiyeon
|
{
|
394 |
|
|
drawingPannelRotate(true);
|
395 |
|
|
}
|
396 |
|
|
}
|
397 |
90e7968d
|
ljiyeon
|
else if (rotationNum < 0)// -1, -2, -3
|
398 |
d974f3f8
|
ljiyeon
|
{
|
399 |
|
|
for (int i = 0; i < -rotationNum; i++)
|
400 |
|
|
{
|
401 |
|
|
drawingPannelRotate(false);
|
402 |
|
|
}
|
403 |
90e7968d
|
ljiyeon
|
}
|
404 |
d974f3f8
|
ljiyeon
|
}
|
405 |
|
|
}
|
406 |
|
|
}
|
407 |
90e7968d
|
ljiyeon
|
|
408 |
d974f3f8
|
ljiyeon
|
public void drawingPannelRotate(bool Flag)
|
409 |
|
|
{
|
410 |
|
|
var instanceMain = this.ParentOfType<MainWindow>();
|
411 |
|
|
|
412 |
|
|
if (Flag)
|
413 |
|
|
{
|
414 |
|
|
if (instanceMain.dzMainMenu.rotate.Angle == 270)
|
415 |
|
|
{
|
416 |
|
|
instanceMain.dzMainMenu.rotate.Angle = 0;
|
417 |
|
|
}
|
418 |
|
|
else
|
419 |
|
|
{
|
420 |
|
|
instanceMain.dzMainMenu.rotate.Angle += 90;
|
421 |
|
|
}
|
422 |
|
|
}
|
423 |
|
|
else
|
424 |
|
|
{
|
425 |
|
|
if (instanceMain.dzMainMenu.rotate.Angle == 0)
|
426 |
|
|
{
|
427 |
|
|
instanceMain.dzMainMenu.rotate.Angle = 270;
|
428 |
|
|
}
|
429 |
|
|
else
|
430 |
|
|
{
|
431 |
|
|
instanceMain.dzMainMenu.rotate.Angle -= 90;
|
432 |
|
|
}
|
433 |
|
|
}
|
434 |
|
|
|
435 |
|
|
if (instanceMain.dzMainMenu.zoomAndPanCanvas.Width == ViewerDataModel.Instance.ContentWidth)
|
436 |
|
|
{
|
437 |
|
|
double emptySize = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
|
438 |
|
|
instanceMain.dzMainMenu.zoomAndPanCanvas.Width = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
|
439 |
|
|
instanceMain.dzMainMenu.zoomAndPanCanvas.Height = emptySize;
|
440 |
|
|
}
|
441 |
90e7968d
|
ljiyeon
|
|
442 |
d974f3f8
|
ljiyeon
|
if (instanceMain.dzMainMenu.rotate.Angle == 0)
|
443 |
|
|
{
|
444 |
|
|
instanceMain.dzMainMenu.translate.X = 0;
|
445 |
|
|
instanceMain.dzMainMenu.translate.Y = 0;
|
446 |
|
|
}
|
447 |
|
|
else if (instanceMain.dzMainMenu.rotate.Angle == 90)
|
448 |
|
|
{
|
449 |
|
|
instanceMain.dzMainMenu.translate.X = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
|
450 |
|
|
instanceMain.dzMainMenu.translate.Y = 0;
|
451 |
|
|
}
|
452 |
|
|
else if (instanceMain.dzMainMenu.rotate.Angle == 180)
|
453 |
|
|
{
|
454 |
|
|
instanceMain.dzMainMenu.translate.X = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
|
455 |
|
|
instanceMain.dzMainMenu.translate.Y = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
|
456 |
|
|
}
|
457 |
|
|
else
|
458 |
|
|
{
|
459 |
|
|
instanceMain.dzMainMenu.translate.X = 0;
|
460 |
|
|
instanceMain.dzMainMenu.translate.Y = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
|
461 |
|
|
}
|
462 |
|
|
|
463 |
|
|
instanceMain.dzMainMenu.zoomAndPanControl.RotationAngle = instanceMain.dzMainMenu.rotate.Angle;
|
464 |
|
|
ViewerDataModel.Instance.ContentWidth = instanceMain.dzMainMenu.zoomAndPanCanvas.Width;
|
465 |
|
|
ViewerDataModel.Instance.ContentHeight = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
|
466 |
|
|
ViewerDataModel.Instance.AngleOffsetX = instanceMain.dzMainMenu.translate.X;
|
467 |
|
|
ViewerDataModel.Instance.AngleOffsetY = instanceMain.dzMainMenu.translate.Y;
|
468 |
|
|
ViewerDataModel.Instance.Angle = instanceMain.dzMainMenu.rotate.Angle;
|
469 |
|
|
|
470 |
|
|
instanceMain.dzMainMenu.pageNavigator._thumbnailItems.Where(info => info.PageNumber == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).ToList().ForEach(data =>
|
471 |
|
|
{
|
472 |
|
|
data.Angle = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString());
|
473 |
|
|
|
474 |
d18ea2bd
|
taeseongkim
|
//instanceMain.dzMainMenu.pageNavigator.ImgListbox.ItemsSource = instanceMain.dzMainMenu.pageNavigator._thumbnailItems;
|
475 |
d974f3f8
|
ljiyeon
|
var instance = instanceMain.dzMainMenu.CurrentDoc.docInfo.DOCPAGE.Where(p => p.PAGE_NUMBER == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).FirstOrDefault();
|
476 |
|
|
instance.PAGE_ANGLE = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString());
|
477 |
|
|
|
478 |
|
|
var rotationdoc = ViewerDataModel.Instance.RotationDocs.Where(d => d.ID == instance.ID).FirstOrDefault();
|
479 |
|
|
if (rotationdoc != null)
|
480 |
|
|
{
|
481 |
|
|
rotationdoc.PAGE_ANGLE = instance.PAGE_ANGLE;
|
482 |
|
|
}
|
483 |
|
|
else
|
484 |
|
|
{
|
485 |
|
|
ViewerDataModel.Instance.RotationDocs.Add(instance);
|
486 |
|
|
}
|
487 |
3908a575
|
humkyung
|
instanceMain.dzMainMenu.pageNavigator.GotoPage(data.PageNumber);
|
488 |
d974f3f8
|
ljiyeon
|
});
|
489 |
|
|
}
|
490 |
|
|
|
491 |
787a4489
|
KangIngu
|
void lstSelectComment_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
|
492 |
|
|
{
|
493 |
|
|
SetCommentPages();
|
494 |
|
|
}
|
495 |
39f0624f
|
ljiyeon
|
|
496 |
c5519c44
|
taeseongkim
|
public async void SetCommentPages(object obj = null)
|
497 |
787a4489
|
KangIngu
|
{
|
498 |
d18ea2bd
|
taeseongkim
|
await this.Dispatcher.InvokeAsync(() => ThumbnailSetAsync());
|
499 |
787a4489
|
KangIngu
|
}
|
500 |
|
|
|
501 |
|
|
public void SetCommentList(List<UsersCommentPagesMember> UsersCommentPagesList)
|
502 |
|
|
{
|
503 |
548c696e
|
ljiyeon
|
Logger.sendCheckLog("SetCommentList", 1);
|
504 |
122914ba
|
ljiyeon
|
Logger.sendCheckLog("SetCommentList_기존 Comment 색상 제거", 1);
|
505 |
787a4489
|
KangIngu
|
#region 기존 색상 제거 작업
|
506 |
6c687be8
|
taeseongkim
|
|
507 |
787a4489
|
KangIngu
|
foreach (var item in this._thumbnailItems)
|
508 |
|
|
{
|
509 |
6c687be8
|
taeseongkim
|
if (item.DisplayColorItems != null)
|
510 |
|
|
{
|
511 |
|
|
item.DisplayColorItems.Clear();
|
512 |
|
|
}
|
513 |
122914ba
|
ljiyeon
|
}
|
514 |
787a4489
|
KangIngu
|
#endregion
|
515 |
|
|
|
516 |
122914ba
|
ljiyeon
|
Logger.sendCheckLog("SetCommentList_delItem select 및 remove", 1);
|
517 |
787a4489
|
KangIngu
|
List<UsersCommentPagesMember> _delItem = new List<UsersCommentPagesMember>();
|
518 |
|
|
|
519 |
f65e6c02
|
taeseongkim
|
this.UsersCommentPagesList.ToList().ForEach(item =>
|
520 |
787a4489
|
KangIngu
|
{
|
521 |
|
|
var _comm = UsersCommentPagesList.Where(a => a.MarkupInfoID == item.MarkupInfoID);
|
522 |
|
|
|
523 |
|
|
if (_comm.Count() == 0)
|
524 |
|
|
{
|
525 |
|
|
_delItem.Add(item);
|
526 |
|
|
}
|
527 |
|
|
});
|
528 |
|
|
|
529 |
f65e6c02
|
taeseongkim
|
_delItem.ForEach(f => this.UsersCommentPagesList.Remove(f));
|
530 |
787a4489
|
KangIngu
|
|
531 |
122914ba
|
ljiyeon
|
Logger.sendCheckLog("SetCommentList_UsersCommentPagesMember_PropertyChanged", 1);
|
532 |
81e3a60f
|
송근호
|
List<SetColorMarkupItem> setColorMarkupItems = new List<SetColorMarkupItem>();
|
533 |
|
|
|
534 |
787a4489
|
KangIngu
|
UsersCommentPagesList.ForEach(user =>
|
535 |
|
|
{
|
536 |
c5519c44
|
taeseongkim
|
//user.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(user_PropertyChanged);
|
537 |
|
|
//user.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(user_PropertyChanged);
|
538 |
787a4489
|
KangIngu
|
|
539 |
f65e6c02
|
taeseongkim
|
var _commLst = this.UsersCommentPagesList.Where(o => o.MarkupInfoID == user.MarkupInfoID);
|
540 |
787a4489
|
KangIngu
|
|
541 |
|
|
if (_commLst.Count() == 0)
|
542 |
|
|
{
|
543 |
f65e6c02
|
taeseongkim
|
this.UsersCommentPagesList.Add(user);
|
544 |
787a4489
|
KangIngu
|
}
|
545 |
|
|
else
|
546 |
|
|
{
|
547 |
|
|
if (_commLst.First().PageNumber != user.PageNumber)
|
548 |
|
|
_commLst.First().PageNumber = user.PageNumber;
|
549 |
|
|
}
|
550 |
|
|
|
551 |
|
|
user.PageNumber.ForEach(page =>
|
552 |
|
|
{
|
553 |
|
|
var _items = this._thumbnailItems.Where(item => item.PageNumber == page);
|
554 |
|
|
|
555 |
|
|
if (_items.Count() > 0)
|
556 |
81e3a60f
|
송근호
|
{
|
557 |
|
|
setColorMarkupItems.Add(new SetColorMarkupItem { DisplayColor = user.SetColor, markupID = user.MarkupInfoID, Page = page });
|
558 |
|
|
|
559 |
|
|
}
|
560 |
|
|
|
561 |
787a4489
|
KangIngu
|
});
|
562 |
|
|
});
|
563 |
|
|
|
564 |
81e3a60f
|
송근호
|
foreach (var item in this._thumbnailItems)
|
565 |
|
|
{
|
566 |
8ff1bf3a
|
송근호
|
item.DisplayColorItems = setColorMarkupItems.Where(color => color.Page == item.PageNumber).ToList();
|
567 |
81e3a60f
|
송근호
|
}
|
568 |
d18ea2bd
|
taeseongkim
|
|
569 |
122914ba
|
ljiyeon
|
Logger.sendCheckLog("SetCommentList_SelectComment.ItemsSource 설정", 1);
|
570 |
f65e6c02
|
taeseongkim
|
var data = UsersCommentPagesList.OrderByDescending(p => p.isConSolidation == Convert.ToInt32(true)).ToList();
|
571 |
c5519c44
|
taeseongkim
|
|
572 |
787a4489
|
KangIngu
|
if (data.Count() != 0)
|
573 |
|
|
{
|
574 |
|
|
if (Convert.ToBoolean(data.First().isConSolidation))
|
575 |
|
|
{
|
576 |
|
|
data.Where(p => p.isConSolidation == Convert.ToInt32(true)).FirstOrDefault().UserName = "Consolidated";
|
577 |
|
|
data.Where(p => p.isConSolidation == Convert.ToInt32(true)).FirstOrDefault().Depart = "";
|
578 |
|
|
this.lstSelectComment.ItemsSource = data;
|
579 |
|
|
}
|
580 |
|
|
}
|
581 |
f65e6c02
|
taeseongkim
|
|
582 |
c5519c44
|
taeseongkim
|
this.lstSelectComment.ItemsSource = this.UsersCommentPagesList; //섬네일
|
583 |
|
|
|
584 |
81e3a60f
|
송근호
|
Logger.sendCheckLog("SetComme6ntList_ImgListbox 설정", 1);
|
585 |
90e7968d
|
ljiyeon
|
|
586 |
2d584f1a
|
djkim
|
|
587 |
81e3a60f
|
송근호
|
//var template = this.ImgListbox.ItemTemplate;
|
588 |
|
|
//this.ImgListbox.ItemTemplate = null;
|
589 |
|
|
//this.ImgListbox.ItemTemplate = template;
|
590 |
2d584f1a
|
djkim
|
|
591 |
787a4489
|
KangIngu
|
}
|
592 |
|
|
|
593 |
d18ea2bd
|
taeseongkim
|
List<int> FilterPages = null;
|
594 |
6c687be8
|
taeseongkim
|
|
595 |
d18ea2bd
|
taeseongkim
|
private void ThumbnailSetAsync()
|
596 |
787a4489
|
KangIngu
|
{
|
597 |
548c696e
|
ljiyeon
|
Logger.sendCheckLog("ThumbnailSet", 1);
|
598 |
787a4489
|
KangIngu
|
|
599 |
d18ea2bd
|
taeseongkim
|
if (FilteredThumbnail == null)
|
600 |
6c687be8
|
taeseongkim
|
{
|
601 |
d18ea2bd
|
taeseongkim
|
var uri = _DefaultUri.Replace("{0}/{1}_{2}", "8/0_0");
|
602 |
787a4489
|
KangIngu
|
|
603 |
d18ea2bd
|
taeseongkim
|
var pageList = ViewerDataModel.Instance.Document_Info;
|
604 |
54a28343
|
taeseongkim
|
|
605 |
6c687be8
|
taeseongkim
|
var items = from page in pageList
|
606 |
|
|
let pageLink = uri.Replace("{PageNo}", page.PAGE_NUMBER.ToString())
|
607 |
|
|
select new ThumbnailItem
|
608 |
|
|
{
|
609 |
|
|
ImageUri = new Uri(pageLink),
|
610 |
|
|
PageUri = new Uri(pageLink.Replace("jpg", "png")),
|
611 |
|
|
PageNumber = page.PAGE_NUMBER,
|
612 |
|
|
Angle = page.PAGE_ANGLE
|
613 |
|
|
};
|
614 |
54a28343
|
taeseongkim
|
|
615 |
d18ea2bd
|
taeseongkim
|
_thumbnailItems = new ObservableCollection<ThumbnailItem>(items);
|
616 |
|
|
FilteredThumbnail = new CollectionViewSource();
|
617 |
c5519c44
|
taeseongkim
|
FilteredThumbnail.SortDescriptions.Add(new SortDescription { Direction = ListSortDirection.Ascending, PropertyName = "PageNumber" });
|
618 |
|
|
|
619 |
d18ea2bd
|
taeseongkim
|
FilteredThumbnail.Source = _thumbnailItems;
|
620 |
787a4489
|
KangIngu
|
|
621 |
d18ea2bd
|
taeseongkim
|
FilterPages = _thumbnailItems.Select(x=>x.PageNumber).ToList();
|
622 |
|
|
|
623 |
|
|
FilteredThumbnail.Filter += (snd,evt) =>
|
624 |
787a4489
|
KangIngu
|
{
|
625 |
d18ea2bd
|
taeseongkim
|
if (FilterPages?.Count() > 0 && evt.Item != null)
|
626 |
787a4489
|
KangIngu
|
{
|
627 |
d18ea2bd
|
taeseongkim
|
evt.Accepted = FilterPages.Contains((evt.Item as ThumbnailItem).PageNumber);
|
628 |
276fdd9b
|
KangIngu
|
}
|
629 |
d18ea2bd
|
taeseongkim
|
else
|
630 |
787a4489
|
KangIngu
|
{
|
631 |
d18ea2bd
|
taeseongkim
|
evt.Accepted = false;
|
632 |
6c687be8
|
taeseongkim
|
}
|
633 |
d18ea2bd
|
taeseongkim
|
};
|
634 |
54a28343
|
taeseongkim
|
|
635 |
d18ea2bd
|
taeseongkim
|
}
|
636 |
787a4489
|
KangIngu
|
|
637 |
d18ea2bd
|
taeseongkim
|
FilterPages.Clear();
|
638 |
448c5399
|
taeseongkim
|
|
639 |
d18ea2bd
|
taeseongkim
|
|
640 |
|
|
if (rdoAllPages.IsChecked == true)
|
641 |
|
|
{
|
642 |
|
|
FilterPages = _thumbnailItems.Select(x=>x.PageNumber).ToList();
|
643 |
|
|
}
|
644 |
|
|
else if (rdoFavoritePages.IsChecked == true)
|
645 |
|
|
{
|
646 |
|
|
if (_FavoriteSet != null)
|
647 |
|
|
{
|
648 |
|
|
FilterPages = (from thumb in _thumbnailItems
|
649 |
|
|
where _FavoriteSet.Where(data => data.PAGE_NO == thumb.PageNumber).FirstOrDefault() != null
|
650 |
|
|
select thumb.PageNumber).ToList();
|
651 |
|
|
}
|
652 |
|
|
}
|
653 |
|
|
else if (rdoCommentPages.IsChecked == true)
|
654 |
|
|
{
|
655 |
|
|
if (this.lstSelectComment.ItemsSource != null)
|
656 |
|
|
{
|
657 |
|
|
var commentPages = (from commentPage in this.UsersCommentPagesList
|
658 |
|
|
where commentPage.IsSelected == true
|
659 |
|
|
select commentPage.PageNumber).SelectMany(x => x).Distinct();
|
660 |
|
|
|
661 |
|
|
if (commentPages?.Count() > 0)
|
662 |
|
|
{
|
663 |
|
|
FilterPages = (from thumb in _thumbnailItems
|
664 |
|
|
where commentPages.Where(s => s == thumb.PageNumber).Count() > 0
|
665 |
|
|
select thumb.PageNumber).ToList();
|
666 |
787a4489
|
KangIngu
|
}
|
667 |
d18ea2bd
|
taeseongkim
|
}
|
668 |
|
|
}
|
669 |
|
|
|
670 |
|
|
if (FilterPages != null)
|
671 |
|
|
{
|
672 |
|
|
FilteredThumbnail.View.Refresh();
|
673 |
|
|
|
674 |
|
|
if (FilterPages.Count() > 0)
|
675 |
|
|
{
|
676 |
|
|
ImgListbox.SelectedItem = _thumbnailItems.Where(x=>x.PageNumber == FilterPages.FirstOrDefault()).FirstOrDefault();
|
677 |
|
|
//SetCommentList(UsersCommentPagesList.ToList());
|
678 |
|
|
}
|
679 |
|
|
else
|
680 |
|
|
{
|
681 |
|
|
ImgListbox.SelectedItem = null;
|
682 |
|
|
}
|
683 |
|
|
|
684 |
|
|
if (ThumbInitialized != null)
|
685 |
|
|
{
|
686 |
|
|
ThumbInitialized(this, new EventArgs());
|
687 |
|
|
ThumbInitialized = null;
|
688 |
787a4489
|
KangIngu
|
}
|
689 |
54a28343
|
taeseongkim
|
}
|
690 |
787a4489
|
KangIngu
|
}
|
691 |
|
|
|
692 |
ac4f1e13
|
taeseongkim
|
private async void Border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
693 |
787a4489
|
KangIngu
|
{
|
694 |
|
|
if (e.ClickCount >= 2)
|
695 |
|
|
{
|
696 |
39f0624f
|
ljiyeon
|
var selectItem = MarkupList.SelectedItem as IKCOM.MarkupItem;
|
697 |
ac4f1e13
|
taeseongkim
|
|
698 |
787a4489
|
KangIngu
|
GotoPage(selectItem.PageNumber);
|
699 |
ac4f1e13
|
taeseongkim
|
|
700 |
|
|
var result = await MarkupParser.GetBaseControlAsync(selectItem.Data);
|
701 |
|
|
|
702 |
90e7968d
|
ljiyeon
|
Rect rect = new Rect(new Point(result.StartPoint.X - 100, result.StartPoint.Y - 100), new Point(result.EndPoint.X + 100, result.EndPoint.Y + 100));
|
703 |
787a4489
|
KangIngu
|
this.ParentOfType<KCOM.Views.MainMenu>().zoomAndPanControl.ZoomTo(rect);
|
704 |
|
|
//bool isGO = false;
|
705 |
|
|
|
706 |
|
|
//var imageViewer = this.ParentOfType<KCOM.Views.MainMenu>().imageViewer;
|
707 |
|
|
//imageViewer.SizeMode = Leadtools.Windows.Controls.SizeMode.Fit;
|
708 |
|
|
//imageViewer.InteractiveMode = Leadtools.Windows.Controls.InteractiveMode.UserRectangle;
|
709 |
|
|
//imageViewer.InteractiveUserRectangle += (sen, ea) =>
|
710 |
|
|
//{
|
711 |
|
|
// System.Diagnostics.Debug.WriteLine(ea.Bounds);
|
712 |
|
|
// if (ea.Status == Leadtools.Windows.Controls.InteractiveModeStatus.End)
|
713 |
|
|
// {
|
714 |
|
|
// this.ParentOfType<KCOM.Views.MainMenu>().zoomAndPanControl.ZoomTo(ea.Bounds);
|
715 |
|
|
// }
|
716 |
|
|
|
717 |
|
|
//};
|
718 |
|
|
//imageViewer.SizeMode = Leadtools.Windows.Controls.SizeMode.Normal;
|
719 |
|
|
|
720 |
39f0624f
|
ljiyeon
|
//GotoPage(MarkupList.SelectedItem as MarkupList)
|
721 |
787a4489
|
KangIngu
|
}
|
722 |
|
|
}
|
723 |
|
|
|
724 |
|
|
public class MarkupInfoItemSmall
|
725 |
|
|
{
|
726 |
|
|
public string Id { get; set; }
|
727 |
|
|
public string UserName { get; set; }
|
728 |
|
|
public string UserID { get; set; }
|
729 |
|
|
public int PageNumber { get; set; }
|
730 |
|
|
public string Data { get; set; }
|
731 |
|
|
public int Data_Type { get; set; }
|
732 |
eeb0a39c
|
taeseongkim
|
public bool IsConsolidate { get; set; }
|
733 |
787a4489
|
KangIngu
|
}
|
734 |
|
|
|
735 |
|
|
private List<MarkupInfoItemSmall> _MarkupInfoSmallList { get; set; }
|
736 |
|
|
public List<MarkupInfoItemSmall> MarkupInfoSmallList
|
737 |
|
|
{
|
738 |
|
|
get
|
739 |
|
|
{
|
740 |
|
|
if (_MarkupInfoSmallList == null)
|
741 |
|
|
{
|
742 |
|
|
_MarkupInfoSmallList = new List<MarkupInfoItemSmall>();
|
743 |
|
|
}
|
744 |
|
|
return _MarkupInfoSmallList;
|
745 |
|
|
}
|
746 |
|
|
set
|
747 |
|
|
{
|
748 |
90e7968d
|
ljiyeon
|
|
749 |
787a4489
|
KangIngu
|
_MarkupInfoSmallList = value;
|
750 |
|
|
RaisePropertyChanged("MarkupInfoSmallList");
|
751 |
|
|
}
|
752 |
|
|
}
|
753 |
|
|
|
754 |
2aaf9645
|
humkyung
|
/// <summary>
|
755 |
|
|
/// goto page and select item selected by user
|
756 |
|
|
/// </summary>
|
757 |
|
|
/// <param name="sender"></param>
|
758 |
|
|
/// <param name="e"></param>
|
759 |
ac4f1e13
|
taeseongkim
|
private async void RadButton_Click_OLD(object sender, RoutedEventArgs e)
|
760 |
787a4489
|
KangIngu
|
{
|
761 |
|
|
var clickButtonItem = sender as RadButton;
|
762 |
|
|
if (clickButtonItem != null && clickButtonItem.CommandParameter != null)
|
763 |
|
|
{
|
764 |
|
|
try
|
765 |
|
|
{
|
766 |
|
|
Rect rect = new Rect();
|
767 |
|
|
Point s_point = new Point();
|
768 |
|
|
Point e_point = new Point();
|
769 |
|
|
|
770 |
|
|
MarkupInfoItemSmall gaza = clickButtonItem.CommandParameter as MarkupInfoItemSmall;
|
771 |
|
|
GotoPage(Convert.ToInt32(gaza.PageNumber));
|
772 |
2aaf9645
|
humkyung
|
|
773 |
ac4f1e13
|
taeseongkim
|
var data = await MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressStringAsync(gaza.Data.ToString()); //언패킹작업
|
774 |
787a4489
|
KangIngu
|
switch (Enum.Parse(typeof(MarkupToPDF.Controls.Common.ControlType), gaza.Data_Type.ToString()))
|
775 |
|
|
{
|
776 |
|
|
case MarkupToPDF.Controls.Common.ControlType.TextControl:
|
777 |
|
|
{
|
778 |
|
|
MarkupToPDF.Serialize.S_Control.S_TextControl instance = MarkupToPDF.Serialize.Core.JsonSerializerHelper.JsonDeserialize<MarkupToPDF.Serialize.S_Control.S_TextControl>(data);
|
779 |
|
|
rect = new Rect(new Point(instance.StartPoint.X - 100, instance.StartPoint.Y - 100), new Point(instance.StartPoint.X + instance.BoxW + 100, instance.StartPoint.Y + instance.BoxW + 100));
|
780 |
|
|
}
|
781 |
|
|
break;
|
782 |
|
|
case MarkupToPDF.Controls.Common.ControlType.TextBorder:
|
783 |
|
|
{
|
784 |
|
|
MarkupToPDF.Serialize.S_Control.S_TextControl instance = MarkupToPDF.Serialize.Core.JsonSerializerHelper.JsonDeserialize<MarkupToPDF.Serialize.S_Control.S_TextControl>(data);
|
785 |
|
|
rect = new Rect(new Point(instance.StartPoint.X - 100, instance.StartPoint.Y - 100), new Point(instance.StartPoint.X + instance.BoxW + 100, instance.StartPoint.Y + instance.BoxW + 100));
|
786 |
|
|
}
|
787 |
|
|
break;
|
788 |
|
|
case MarkupToPDF.Controls.Common.ControlType.TextCloud:
|
789 |
|
|
{
|
790 |
|
|
MarkupToPDF.Serialize.S_Control.S_TextControl instance = MarkupToPDF.Serialize.Core.JsonSerializerHelper.JsonDeserialize<MarkupToPDF.Serialize.S_Control.S_TextControl>(data);
|
791 |
|
|
rect = new Rect(new Point(instance.StartPoint.X - 100, instance.StartPoint.Y - 100), new Point(instance.StartPoint.X + instance.BoxW + 100, instance.StartPoint.Y + instance.BoxW + 100));
|
792 |
|
|
}
|
793 |
|
|
break;
|
794 |
|
|
case MarkupToPDF.Controls.Common.ControlType.PolygonControl:
|
795 |
|
|
{
|
796 |
|
|
MarkupToPDF.Serialize.S_Control.S_BaseControl instance = MarkupToPDF.Serialize.Core.JsonSerializerHelper.JsonDeserialize<MarkupToPDF.Serialize.S_Control.S_BaseControl>(data);
|
797 |
|
|
|
798 |
|
|
foreach (Point A in instance.PointSet)
|
799 |
|
|
{
|
800 |
|
|
if (s_point == new Point())
|
801 |
|
|
{
|
802 |
|
|
s_point = A;
|
803 |
|
|
e_point = A;
|
804 |
|
|
}
|
805 |
|
|
s_point.X = Math.Min(s_point.X, A.X);
|
806 |
|
|
s_point.Y = Math.Min(s_point.Y, A.Y);
|
807 |
|
|
e_point.X = Math.Max(e_point.X, A.X);
|
808 |
|
|
e_point.Y = Math.Max(e_point.Y, A.Y);
|
809 |
|
|
}
|
810 |
|
|
rect = new Rect(new Point(s_point.X - 100, s_point.Y - 100), new Point(e_point.X + 100, e_point.Y + 100));
|
811 |
|
|
}
|
812 |
|
|
break;
|
813 |
|
|
case MarkupToPDF.Controls.Common.ControlType.PolygonCloud:
|
814 |
|
|
{
|
815 |
|
|
MarkupToPDF.Serialize.S_Control.S_BaseControl instance = MarkupToPDF.Serialize.Core.JsonSerializerHelper.JsonDeserialize<MarkupToPDF.Serialize.S_Control.S_BaseControl>(data);
|
816 |
|
|
|
817 |
|
|
foreach (Point A in instance.PointSet)
|
818 |
|
|
{
|
819 |
|
|
if (s_point == new Point())
|
820 |
|
|
{
|
821 |
|
|
s_point = A;
|
822 |
|
|
e_point = A;
|
823 |
|
|
}
|
824 |
|
|
s_point.X = Math.Min(s_point.X, A.X);
|
825 |
|
|
s_point.Y = Math.Min(s_point.Y, A.Y);
|
826 |
|
|
e_point.X = Math.Max(e_point.X, A.X);
|
827 |
|
|
e_point.Y = Math.Max(e_point.Y, A.Y);
|
828 |
|
|
}
|
829 |
|
|
rect = new Rect(new Point(s_point.X - 100, s_point.Y - 100), new Point(e_point.X + 100, e_point.Y + 100));
|
830 |
|
|
}
|
831 |
|
|
break;
|
832 |
|
|
case MarkupToPDF.Controls.Common.ControlType.ChainLine:
|
833 |
|
|
{
|
834 |
|
|
MarkupToPDF.Serialize.S_Control.S_BaseControl instance = MarkupToPDF.Serialize.Core.JsonSerializerHelper.JsonDeserialize<MarkupToPDF.Serialize.S_Control.S_BaseControl>(data);
|
835 |
|
|
|
836 |
|
|
foreach (Point A in instance.PointSet)
|
837 |
|
|
{
|
838 |
|
|
if (s_point == new Point())
|
839 |
|
|
{
|
840 |
|
|
s_point = A;
|
841 |
|
|
e_point = A;
|
842 |
|
|
}
|
843 |
|
|
s_point.X = Math.Min(s_point.X, A.X);
|
844 |
|
|
s_point.Y = Math.Min(s_point.Y, A.Y);
|
845 |
|
|
e_point.X = Math.Max(e_point.X, A.X);
|
846 |
|
|
e_point.Y = Math.Max(e_point.Y, A.Y);
|
847 |
|
|
}
|
848 |
|
|
rect = new Rect(new Point(s_point.X - 100, s_point.Y - 100), new Point(e_point.X + 100, e_point.Y + 100));
|
849 |
|
|
}
|
850 |
|
|
break;
|
851 |
|
|
case MarkupToPDF.Controls.Common.ControlType.Ink:
|
852 |
|
|
{
|
853 |
|
|
MarkupToPDF.Serialize.S_Control.S_BaseControl instance = MarkupToPDF.Serialize.Core.JsonSerializerHelper.JsonDeserialize<MarkupToPDF.Serialize.S_Control.S_BaseControl>(data);
|
854 |
|
|
|
855 |
|
|
foreach (Point A in instance.PointSet)
|
856 |
|
|
{
|
857 |
|
|
if (s_point == new Point())
|
858 |
|
|
{
|
859 |
|
|
s_point = A;
|
860 |
|
|
e_point = A;
|
861 |
|
|
}
|
862 |
|
|
s_point.X = Math.Min(s_point.X, A.X);
|
863 |
|
|
s_point.Y = Math.Min(s_point.Y, A.Y);
|
864 |
|
|
e_point.X = Math.Max(e_point.X, A.X);
|
865 |
|
|
e_point.Y = Math.Max(e_point.Y, A.Y);
|
866 |
|
|
}
|
867 |
|
|
rect = new Rect(new Point(s_point.X - 100, s_point.Y - 100), new Point(e_point.X + 100, e_point.Y + 100));
|
868 |
|
|
}
|
869 |
|
|
break;
|
870 |
|
|
default:
|
871 |
|
|
MarkupToPDF.Serialize.S_Control.S_BaseControl item = MarkupToPDF.Serialize.Core.JsonSerializerHelper.JsonDeserialize<MarkupToPDF.Serialize.S_Control.S_BaseControl>(data);
|
872 |
|
|
rect = new Rect(new Point(item.StartPoint.X - 100, item.StartPoint.Y - 100), new Point(item.EndPoint.X + 100, item.EndPoint.Y + 100));
|
873 |
|
|
break;
|
874 |
|
|
}
|
875 |
|
|
|
876 |
077896be
|
humkyung
|
SelectionSet.Instance.SelectItemByRect(rect, this.ParentOfType<KCOM.Views.MainMenu>());
|
877 |
787a4489
|
KangIngu
|
this.ParentOfType<KCOM.Views.MainMenu>().zoomAndPanControl.ZoomTo(rect);
|
878 |
|
|
}
|
879 |
|
|
catch (Exception ex)
|
880 |
|
|
{
|
881 |
2aaf9645
|
humkyung
|
this.ParentOfType<KCOM.Views.MainMenu>().DialogMessage_Alert(ex.Message, "Error");
|
882 |
787a4489
|
KangIngu
|
}
|
883 |
|
|
}
|
884 |
|
|
}
|
885 |
|
|
|
886 |
2089959a
|
taeseongkim
|
|
887 |
|
|
private void btGotoMarkup_Click(object sender, RoutedEventArgs e)
|
888 |
|
|
{
|
889 |
|
|
var clickButtonItem = sender as RadButton;
|
890 |
|
|
if (clickButtonItem != null && clickButtonItem.CommandParameter != null)
|
891 |
|
|
{
|
892 |
|
|
try
|
893 |
|
|
{
|
894 |
|
|
|
895 |
|
|
|
896 |
|
|
MarkupInfoItemSmall gaza = clickButtonItem.CommandParameter as MarkupInfoItemSmall;
|
897 |
|
|
MarkupList.SelectedItem = gaza;
|
898 |
|
|
|
899 |
c7fde400
|
taeseongkim
|
MarkupHelper.GotoMarkup(new[] { gaza.Id });
|
900 |
2089959a
|
taeseongkim
|
}
|
901 |
|
|
catch (Exception ex)
|
902 |
|
|
{
|
903 |
|
|
this.ParentOfType<KCOM.Views.MainMenu>().DialogMessage_Alert(ex.Message, "Error");
|
904 |
|
|
}
|
905 |
|
|
}
|
906 |
|
|
}
|
907 |
|
|
|
908 |
c7fde400
|
taeseongkim
|
///// <summary>
|
909 |
|
|
///// 선택된 마크업의 ID리스트를 받아 해당 페이지로 이동 후 GotoSelectedMarkup 호출
|
910 |
|
|
///// </summary>
|
911 |
|
|
///// <param name="CommentIdList"></param>
|
912 |
|
|
//private void GotoMarkup(IEnumerable<string> CommentIdList)
|
913 |
|
|
//{
|
914 |
|
|
// var instance = Common.ViewerDataModel.Instance;
|
915 |
|
|
|
916 |
|
|
// SelectionSet.Instance.UnSelect(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu);
|
917 |
|
|
|
918 |
|
|
// var commentList = instance._markupInfoList.Where(x => x.MarkupList != null).SelectMany(x => x.MarkupList).Where(f => f.ID == CommentIdList.First());
|
919 |
|
|
|
920 |
|
|
// if (commentList.Count() > 0)
|
921 |
|
|
// {
|
922 |
|
|
// //하단 그리드의 markup list에서 commentid가 포함된 markupinfo를 선택되게 한다.
|
923 |
|
|
// #region markup list grid select items
|
924 |
|
|
|
925 |
|
|
// var infoItem = instance._markupInfoList.Where(x => x.MarkupList != null).Where(f => f.MarkupList.Count(y => y == commentList.First()) > 0);
|
926 |
|
|
|
927 |
|
|
// if (infoItem.Count() > 0)
|
928 |
|
|
// {
|
929 |
|
|
|
930 |
|
|
// var gridMarkup = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.gridViewMarkup;
|
931 |
|
|
// gridMarkup.SelectedItems.Clear();
|
932 |
|
|
// gridMarkup.SelectedItems.Add(infoItem.First());
|
933 |
|
|
// }
|
934 |
|
|
|
935 |
|
|
// #endregion
|
936 |
|
|
|
937 |
|
|
// var pageNavigator = instance.SystemMain.dzMainMenu.pageNavigator;
|
938 |
|
|
|
939 |
|
|
// if (pageNavigator.CurrentPage.PageNumber == commentList.First().PageNumber)
|
940 |
|
|
// {
|
941 |
|
|
// GotoSelectedMarkup(CommentIdList);
|
942 |
|
|
// }
|
943 |
|
|
// else
|
944 |
|
|
// {
|
945 |
|
|
// EventHandler<Sample.PageChangeEventArgs> handler = null;
|
946 |
|
|
|
947 |
|
|
// handler = (snd, evt) =>
|
948 |
|
|
// {
|
949 |
|
|
// GotoSelectedMarkup(CommentIdList);
|
950 |
|
|
// pageNavigator.PageChanged -= handler;
|
951 |
|
|
// };
|
952 |
|
|
|
953 |
|
|
// pageNavigator.PageChanged += handler;
|
954 |
|
|
|
955 |
|
|
// pageNavigator.GotoPage(commentList.First().PageNumber);
|
956 |
|
|
// }
|
957 |
|
|
// }
|
958 |
|
|
//}
|
959 |
|
|
|
960 |
|
|
///// <summary>
|
961 |
|
|
///// 페이지 이동 후 마크업을 선택하고 Zoom을 한다.
|
962 |
|
|
///// 마크업이 페이지보다 크면 Zoom을 하지 않음.
|
963 |
|
|
///// </summary>
|
964 |
|
|
///// <param name="CommentIdList"></param>
|
965 |
|
|
//private void GotoSelectedMarkup(IEnumerable<string> CommentIdList)
|
966 |
|
|
//{
|
967 |
|
|
// var instance = Common.ViewerDataModel.Instance;
|
968 |
|
|
|
969 |
|
|
// var selectOrderComments = instance.MarkupControls.Where(x => CommentIdList.Count(y => y == x.CommentID) > 0).ToList();
|
970 |
|
|
// var commentUserInfo = instance.MarkupControls_USER.Where(x => CommentIdList.Count(y => y == x.CommentID) > 0).ToList();
|
971 |
|
|
|
972 |
|
|
// if (commentUserInfo.Count() > 0 || selectOrderComments.Count() > 0)
|
973 |
|
|
// {
|
974 |
|
|
// commentUserInfo.ForEach(x => x.IsSelected = true);
|
975 |
|
|
// commentUserInfo.AddRange(selectOrderComments);
|
976 |
|
|
|
977 |
|
|
// if (commentUserInfo?.Count() > 0)
|
978 |
|
|
// {
|
979 |
|
|
// var main = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu;
|
980 |
|
|
|
981 |
|
|
// try
|
982 |
|
|
// {
|
983 |
|
|
// if(Common.ViewerDataModel.Instance.Angle != 0)
|
984 |
|
|
// {
|
985 |
|
|
// for (int i = 0; i < (Common.ViewerDataModel.Instance.Angle / 90); i++)
|
986 |
|
|
// {
|
987 |
|
|
// Common.ViewerDataModel.Instance.SystemMain.dzTopMenu.drawingPannelRotate(true);
|
988 |
|
|
// }
|
989 |
5beaf28e
|
taeseongkim
|
|
990 |
c7fde400
|
taeseongkim
|
// //Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.rotate.Angle = 0;
|
991 |
|
|
// //Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.translate.X = 0;
|
992 |
|
|
// //Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.translate.Y = 0;
|
993 |
|
|
// }
|
994 |
5beaf28e
|
taeseongkim
|
|
995 |
c7fde400
|
taeseongkim
|
// Rect rect = commentUserInfo.First().ItemRect;
|
996 |
2089959a
|
taeseongkim
|
|
997 |
c7fde400
|
taeseongkim
|
// foreach (var UserInfo in commentUserInfo)
|
998 |
|
|
// {
|
999 |
|
|
// rect = Rect.Union(rect, UserInfo.ItemRect);
|
1000 |
|
|
// }
|
1001 |
2089959a
|
taeseongkim
|
|
1002 |
c7fde400
|
taeseongkim
|
// SelectionSet.Instance.SelectItemByRect(rect, main);
|
1003 |
2089959a
|
taeseongkim
|
|
1004 |
c7fde400
|
taeseongkim
|
// var center = new Vector(Common.ViewerDataModel.Instance.ImageViewWidth / 2, Common.ViewerDataModel.Instance.ImageViewHeight / 2);
|
1005 |
|
|
// //var matrix = MatrixHelper.Rotation(Common.ViewerDataModel.Instance.Angle);
|
1006 |
|
|
// //rect.Transform(matrix);
|
1007 |
2089959a
|
taeseongkim
|
|
1008 |
c7fde400
|
taeseongkim
|
// double scaleX = Common.ViewerDataModel.Instance.ImageViewWidth / rect.Width;
|
1009 |
|
|
// double scaleY = Common.ViewerDataModel.Instance.ImageViewHeight / rect.Height;
|
1010 |
|
|
// double newScale = main.zoomAndPanControl.ContentScale * Math.Min(scaleX, scaleY);
|
1011 |
|
|
// double positionX = 0;
|
1012 |
|
|
// double positionY = 0;
|
1013 |
2089959a
|
taeseongkim
|
|
1014 |
c7fde400
|
taeseongkim
|
// if (Common.ViewerDataModel.Instance.Angle == 90)
|
1015 |
|
|
// {
|
1016 |
|
|
// positionX = Common.ViewerDataModel.Instance.ImageViewHeight + rect.X;
|
1017 |
|
|
// positionY = Common.ViewerDataModel.Instance.ImageViewWidth + rect.Y;
|
1018 |
|
|
// }
|
1019 |
2089959a
|
taeseongkim
|
|
1020 |
c7fde400
|
taeseongkim
|
// main.zoomAndPanControl.ContentScale = newScale;
|
1021 |
|
|
// main.zoomAndPanControl.ContentOffsetX = positionX;
|
1022 |
|
|
// main.zoomAndPanControl.ContentOffsetY = positionY;
|
1023 |
2089959a
|
taeseongkim
|
|
1024 |
|
|
|
1025 |
c7fde400
|
taeseongkim
|
// var pageSize = new Size(main.pageNavigator.CurrentPage.Width, main.pageNavigator.CurrentPage.Height);
|
1026 |
|
|
|
1027 |
|
|
// double pageAngle = Common.ViewerDataModel.Instance.Angle;
|
1028 |
|
|
|
1029 |
|
|
// if (pageAngle == 90)
|
1030 |
|
|
// {
|
1031 |
|
|
// pageAngle = 270;
|
1032 |
|
|
// }
|
1033 |
|
|
// else
|
1034 |
|
|
// {
|
1035 |
|
|
// pageAngle = 90;
|
1036 |
|
|
// }
|
1037 |
|
|
|
1038 |
|
|
// if ((rect.Size.Width + rect.Size.Height) > (pageSize.Width + pageSize.Height))
|
1039 |
|
|
// {
|
1040 |
|
|
// var matrix = MatrixHelper.Rotation(Common.ViewerDataModel.Instance.Angle);
|
1041 |
|
|
// rect.Transform(matrix);
|
1042 |
|
|
|
1043 |
|
|
// main.zoomAndPanControl.ZoomTo(rect);
|
1044 |
|
|
// }
|
1045 |
|
|
// else
|
1046 |
|
|
// {
|
1047 |
|
|
// rect.Inflate(rect.Width * 3, rect.Height * 3);
|
1048 |
|
|
|
1049 |
|
|
// var matrix = MatrixHelper.Rotation(Common.ViewerDataModel.Instance.Angle);
|
1050 |
|
|
// rect.Transform(matrix);
|
1051 |
|
|
|
1052 |
|
|
|
1053 |
|
|
// main.zoomAndPanControl.ZoomTo(rect);
|
1054 |
|
|
// }
|
1055 |
|
|
// }
|
1056 |
|
|
// catch (Exception ex)
|
1057 |
|
|
// {
|
1058 |
|
|
// main.DialogMessage_Alert(ex.Message, "Error");
|
1059 |
|
|
// }
|
1060 |
|
|
// }
|
1061 |
|
|
// }
|
1062 |
|
|
//}
|
1063 |
2089959a
|
taeseongkim
|
|
1064 |
39f0624f
|
ljiyeon
|
private void MarkupList_Loaded(object sender, RoutedEventArgs e)
|
1065 |
787a4489
|
KangIngu
|
{
|
1066 |
|
|
if (MarkupInfoSmallList.Count == 0)
|
1067 |
|
|
{
|
1068 |
|
|
ViewerDataModel.Instance._markupInfoList.ToList().ForEach(d =>
|
1069 |
|
|
{
|
1070 |
|
|
if (d.MarkupList != null)
|
1071 |
|
|
{
|
1072 |
|
|
d.MarkupList.ForEach(b =>
|
1073 |
|
|
{
|
1074 |
eeb0a39c
|
taeseongkim
|
bool isConsolidate = false;
|
1075 |
|
|
|
1076 |
|
|
if(d.Consolidate == 1 && d.AvoidConsolidate == 0)
|
1077 |
|
|
{
|
1078 |
|
|
isConsolidate = true;
|
1079 |
|
|
}
|
1080 |
|
|
|
1081 |
|
|
System.Diagnostics.Debug.WriteLine($"UserID : {d.UserID} Consolidate : {d.Consolidate} AvoidConsolidate : {d.AvoidConsolidate}");
|
1082 |
|
|
|
1083 |
787a4489
|
KangIngu
|
MarkupInfoSmallList.Add(new MarkupInfoItemSmall
|
1084 |
|
|
{
|
1085 |
|
|
Id = b.ID,
|
1086 |
|
|
Data = b.Data,
|
1087 |
|
|
Data_Type = b.Data_Type,
|
1088 |
|
|
PageNumber = b.PageNumber,
|
1089 |
|
|
UserID = d.UserID,
|
1090 |
|
|
UserName = d.UserName,
|
1091 |
eeb0a39c
|
taeseongkim
|
IsConsolidate = isConsolidate
|
1092 |
|
|
|
1093 |
787a4489
|
KangIngu
|
});
|
1094 |
|
|
});
|
1095 |
|
|
}
|
1096 |
|
|
});
|
1097 |
39f0624f
|
ljiyeon
|
MarkupList.ItemsSource = null;
|
1098 |
|
|
MarkupList.ItemsSource = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
|
1099 |
787a4489
|
KangIngu
|
|
1100 |
eeb0a39c
|
taeseongkim
|
FilterUpdate();
|
1101 |
787a4489
|
KangIngu
|
}
|
1102 |
|
|
}
|
1103 |
|
|
|
1104 |
39f0624f
|
ljiyeon
|
public void MarkupListUpdate(MarkupReturn res, Event_Type eventType, string CommentID, MarkupInfoItem item)
|
1105 |
4eb052e4
|
ljiyeon
|
{
|
1106 |
|
|
if (MarkupInfoSmallList.Count == 0)
|
1107 |
|
|
{
|
1108 |
|
|
ViewerDataModel.Instance._markupInfoList.ToList().ForEach(d =>
|
1109 |
|
|
{
|
1110 |
|
|
if (d.MarkupList != null)
|
1111 |
|
|
{
|
1112 |
|
|
d.MarkupList.ForEach(b =>
|
1113 |
|
|
{
|
1114 |
|
|
MarkupInfoSmallList.Add(new MarkupInfoItemSmall
|
1115 |
|
|
{
|
1116 |
|
|
Id = b.ID,
|
1117 |
|
|
Data = b.Data,
|
1118 |
|
|
Data_Type = b.Data_Type,
|
1119 |
|
|
PageNumber = b.PageNumber,
|
1120 |
|
|
UserID = d.UserID,
|
1121 |
|
|
UserName = d.UserName,
|
1122 |
|
|
});
|
1123 |
|
|
});
|
1124 |
|
|
}
|
1125 |
|
|
});
|
1126 |
39f0624f
|
ljiyeon
|
MarkupList.ItemsSource = null;
|
1127 |
|
|
MarkupList.ItemsSource = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
|
1128 |
4eb052e4
|
ljiyeon
|
}
|
1129 |
|
|
|
1130 |
|
|
switch (eventType)
|
1131 |
|
|
{
|
1132 |
|
|
case Event_Type.Create:
|
1133 |
|
|
MarkupInfoSmallList.Add(new MarkupInfoItemSmall
|
1134 |
|
|
{
|
1135 |
|
|
Id = res.CommentID,
|
1136 |
|
|
Data = res.ConvertData,
|
1137 |
|
|
Data_Type = res.DATA_TYPE,
|
1138 |
|
|
PageNumber = CurrentPage.PageNumber,
|
1139 |
|
|
UserID = App.ViewInfo.UserID,
|
1140 |
|
|
UserName = App.UserName,
|
1141 |
|
|
});
|
1142 |
|
|
break;
|
1143 |
|
|
case Event_Type.Delete:
|
1144 |
|
|
if(CommentID == null) //user information list delete btn
|
1145 |
|
|
{
|
1146 |
|
|
foreach (var delItem in item.MarkupList)
|
1147 |
|
|
{
|
1148 |
|
|
MarkupInfoSmallList.RemoveAll(p => p.Id == delItem.ID);
|
1149 |
|
|
}
|
1150 |
|
|
}
|
1151 |
|
|
else //delete, cut,
|
1152 |
|
|
{
|
1153 |
|
|
MarkupInfoSmallList.RemoveAll(p => p.Id.Equals(CommentID));
|
1154 |
|
|
}
|
1155 |
|
|
break;
|
1156 |
39f0624f
|
ljiyeon
|
case Event_Type.Thumb://이동 회전
|
1157 |
4eb052e4
|
ljiyeon
|
MarkupInfoSmallList.RemoveAll(p => p.Id.Equals(res.CommentID));
|
1158 |
|
|
MarkupInfoSmallList.Add(new MarkupInfoItemSmall
|
1159 |
|
|
{
|
1160 |
|
|
Id = res.CommentID,
|
1161 |
|
|
Data = res.ConvertData,
|
1162 |
|
|
Data_Type = res.DATA_TYPE,
|
1163 |
|
|
PageNumber = CurrentPage.PageNumber,
|
1164 |
|
|
UserID = App.ViewInfo.UserID,
|
1165 |
|
|
UserName = App.UserName,
|
1166 |
|
|
});
|
1167 |
|
|
break;
|
1168 |
|
|
default:
|
1169 |
|
|
break;
|
1170 |
|
|
}
|
1171 |
|
|
|
1172 |
39f0624f
|
ljiyeon
|
List<MarkupInfoItemSmall> TempMarkupInfoSmallList = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
|
1173 |
4eb052e4
|
ljiyeon
|
|
1174 |
eeb0a39c
|
taeseongkim
|
bool IsConsolidation = false;
|
1175 |
|
|
string UserId = null;
|
1176 |
|
|
|
1177 |
|
|
if (commentUser.SelectedValue != null)
|
1178 |
|
|
{
|
1179 |
|
|
if (((KCOM.Common.UsersCommentPagesMember)commentUser.SelectedValue).UserName != "Consolidated")
|
1180 |
|
|
{
|
1181 |
|
|
UserId = ((KCOM.Common.UsersCommentPagesMember)commentUser.SelectedValue).UserName;
|
1182 |
|
|
}
|
1183 |
|
|
else
|
1184 |
|
|
{
|
1185 |
|
|
IsConsolidation = true;
|
1186 |
|
|
}
|
1187 |
|
|
}
|
1188 |
|
|
|
1189 |
|
|
var filterItems = TempMarkupInfoSmallList.WhereIf(commentType.SelectedValue != null, d => d.Data_Type == Convert.ToInt32(commentType.SelectedValue))
|
1190 |
|
|
.WhereIf(UserId != null, d => d.UserName == ((KCOM.Common.UsersCommentPagesMember)commentUser.SelectedValue).ToString())
|
1191 |
|
|
.WhereIf(commentPage.SelectedValue != null, d => d.PageNumber == Convert.ToInt32(commentPage.SelectedValue));
|
1192 |
4eb052e4
|
ljiyeon
|
|
1193 |
eeb0a39c
|
taeseongkim
|
MarkupList.ItemsSource = TempMarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
|
1194 |
39f0624f
|
ljiyeon
|
|
1195 |
eeb0a39c
|
taeseongkim
|
FilterUpdate();
|
1196 |
4eb052e4
|
ljiyeon
|
}
|
1197 |
|
|
|
1198 |
eeb0a39c
|
taeseongkim
|
private void FilterUpdate(string selectUser = null)
|
1199 |
787a4489
|
KangIngu
|
{
|
1200 |
eeb0a39c
|
taeseongkim
|
//var items = MarkupList.ItemsSource as List<MarkupInfoItemSmall>;
|
1201 |
4eb052e4
|
ljiyeon
|
|
1202 |
eeb0a39c
|
taeseongkim
|
//commentType.ItemsSource = items.Select(d => d.Data_Type).Distinct().OrderBy(d => d).ToList();
|
1203 |
|
|
//commentPage.ItemsSource = items.Select(d => d.PageNumber).Distinct().OrderBy(d => d).ToList();
|
1204 |
0cda2a88
|
taeseongkim
|
|
1205 |
b2c6901f
|
swate0609
|
|
1206 |
eeb0a39c
|
taeseongkim
|
var items = MarkupList.ItemsSource as List<MarkupInfoItemSmall>;
|
1207 |
|
|
|
1208 |
|
|
var filterUsers = MarkupInfoSmallList.WhereIf(commentType.SelectedValue != null, d => d.Data_Type == Convert.ToInt32(commentType.SelectedValue))
|
1209 |
|
|
.WhereIf(commentPage.SelectedValue != null, d => d.PageNumber == Convert.ToInt32(commentPage.SelectedValue));
|
1210 |
|
|
|
1211 |
|
|
var filterTypes = MarkupInfoSmallList.WhereIf(selectUser != null, d => d.UserName == selectUser)
|
1212 |
|
|
.WhereIf(commentPage.SelectedValue != null, d => d.PageNumber == Convert.ToInt32(commentPage.SelectedValue));
|
1213 |
|
|
|
1214 |
|
|
var filterPages = MarkupInfoSmallList.WhereIf(commentType.SelectedValue != null, d => d.Data_Type == Convert.ToInt32(commentType.SelectedValue))
|
1215 |
|
|
.WhereIf(selectUser != null, d => d.UserName == selectUser);
|
1216 |
|
|
|
1217 |
|
|
commentUser.ItemsSource = filterUsers.Select(d => d.UserName).Distinct().OrderBy(d => d).ToList();
|
1218 |
|
|
commentType.ItemsSource = filterTypes.Select(d => d.Data_Type).Distinct().OrderBy(d => d).ToList();
|
1219 |
|
|
commentPage.ItemsSource = filterPages.Select(d => d.PageNumber).Distinct().OrderBy(d => d).ToList();
|
1220 |
b2c6901f
|
swate0609
|
}
|
1221 |
|
|
|
1222 |
eeb0a39c
|
taeseongkim
|
|
1223 |
|
|
|
1224 |
|
|
private void commentFilter_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
1225 |
b2c6901f
|
swate0609
|
{
|
1226 |
|
|
MarkupList.ItemsSource = null;
|
1227 |
|
|
txtSearch.Text = string.Empty;
|
1228 |
|
|
|
1229 |
|
|
List<MarkupInfoItemSmall> TempMarkupInfoSmallList = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList();
|
1230 |
|
|
|
1231 |
eeb0a39c
|
taeseongkim
|
bool IsConsolidation = false;
|
1232 |
|
|
string userName = null;
|
1233 |
4eb052e4
|
ljiyeon
|
|
1234 |
eeb0a39c
|
taeseongkim
|
if (commentUser.SelectedValue != null)
|
1235 |
|
|
{
|
1236 |
|
|
if(commentUser.SelectedValue?.ToString() != "Consolidated")
|
1237 |
|
|
{
|
1238 |
|
|
userName = commentUser.SelectedValue.ToString();
|
1239 |
|
|
}
|
1240 |
|
|
else
|
1241 |
|
|
{
|
1242 |
|
|
IsConsolidation = true;
|
1243 |
|
|
}
|
1244 |
|
|
}
|
1245 |
4eb052e4
|
ljiyeon
|
|
1246 |
eeb0a39c
|
taeseongkim
|
var filterItems = TempMarkupInfoSmallList.WhereIf(commentType.SelectedValue != null, d => d.Data_Type == Convert.ToInt32(commentType.SelectedValue))
|
1247 |
|
|
.WhereIf(userName != null, d => d.UserName == userName)
|
1248 |
|
|
.WhereIf(IsConsolidation,d=>d.IsConsolidate == IsConsolidation)
|
1249 |
|
|
.WhereIf(commentPage.SelectedValue != null, d => d.PageNumber == Convert.ToInt32(commentPage.SelectedValue));
|
1250 |
|
|
|
1251 |
|
|
MarkupList.ItemsSource = filterItems.OrderBy(d => d.PageNumber).ToList();
|
1252 |
|
|
|
1253 |
|
|
FilterUpdate();
|
1254 |
787a4489
|
KangIngu
|
}
|
1255 |
|
|
|
1256 |
|
|
private void btnPanorama_Click(object sender, RoutedEventArgs e)
|
1257 |
|
|
{
|
1258 |
|
|
ViewerDataModel.Instance.SystemMain.dzTopMenu.PanoramaShow();
|
1259 |
|
|
}
|
1260 |
79f3f21a
|
djkim
|
|
1261 |
ac4f1e13
|
taeseongkim
|
private async void btnSearch_Click(object sender, RoutedEventArgs e)
|
1262 |
79f3f21a
|
djkim
|
{
|
1263 |
2089959a
|
taeseongkim
|
string search_str = txtSearch.Text;
|
1264 |
|
|
|
1265 |
|
|
if(string.IsNullOrWhiteSpace(search_str))
|
1266 |
|
|
{
|
1267 |
|
|
return;
|
1268 |
|
|
}
|
1269 |
|
|
|
1270 |
79f3f21a
|
djkim
|
var sel_type = commentType.SelectedItem;
|
1271 |
|
|
var sel_user = commentUser.SelectedItem;
|
1272 |
|
|
var sel_page = commentPage.SelectedItem;
|
1273 |
|
|
List<MarkupInfoItemSmall> small_list = new List<MarkupInfoItemSmall>();
|
1274 |
|
|
List<MarkupInfoItemSmall> list = MarkupInfoSmallList;
|
1275 |
90e7968d
|
ljiyeon
|
if (sel_page != null)
|
1276 |
79f3f21a
|
djkim
|
{
|
1277 |
|
|
list = list.Where(d => d.PageNumber == Convert.ToInt32(sel_page)).ToList();
|
1278 |
|
|
}
|
1279 |
90e7968d
|
ljiyeon
|
if (sel_type != null)
|
1280 |
79f3f21a
|
djkim
|
{
|
1281 |
|
|
list = list.Where(d => d.Data_Type == Convert.ToInt32(sel_type)).ToList();
|
1282 |
|
|
}
|
1283 |
|
|
if (sel_user != null)
|
1284 |
|
|
{
|
1285 |
|
|
list = list.Where(d => d.UserID == (sel_user as MarkupInfoItem).UserID).ToList();
|
1286 |
|
|
}
|
1287 |
|
|
foreach (var item in list)
|
1288 |
|
|
{
|
1289 |
ac4f1e13
|
taeseongkim
|
var data = await MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressStringAsync(item.Data.ToString());
|
1290 |
90e7968d
|
ljiyeon
|
|
1291 |
79f3f21a
|
djkim
|
switch (Enum.Parse(typeof(MarkupToPDF.Controls.Common.ControlType), item.Data_Type.ToString()))
|
1292 |
90e7968d
|
ljiyeon
|
{
|
1293 |
79f3f21a
|
djkim
|
case MarkupToPDF.Controls.Common.ControlType.TextControl:
|
1294 |
|
|
case MarkupToPDF.Controls.Common.ControlType.TextBorder:
|
1295 |
|
|
case MarkupToPDF.Controls.Common.ControlType.TextCloud:
|
1296 |
|
|
{
|
1297 |
|
|
MarkupToPDF.Serialize.S_Control.S_TextControl instance = MarkupToPDF.Serialize.Core.JsonSerializerHelper.JsonDeserialize<MarkupToPDF.Serialize.S_Control.S_TextControl>(data);
|
1298 |
2089959a
|
taeseongkim
|
|
1299 |
|
|
if (!string.IsNullOrWhiteSpace(instance.Text))
|
1300 |
90e7968d
|
ljiyeon
|
{
|
1301 |
2089959a
|
taeseongkim
|
if (instance.Text.ToLower().Contains(search_str.ToLower()))
|
1302 |
|
|
{
|
1303 |
|
|
small_list.Add(item);
|
1304 |
|
|
}
|
1305 |
79f3f21a
|
djkim
|
}
|
1306 |
|
|
}
|
1307 |
|
|
break;
|
1308 |
|
|
case MarkupToPDF.Controls.Common.ControlType.ArrowTextBorderControl:
|
1309 |
|
|
case MarkupToPDF.Controls.Common.ControlType.ArrowTextCloudControl:
|
1310 |
|
|
case MarkupToPDF.Controls.Common.ControlType.ArrowTextControl:
|
1311 |
|
|
case MarkupToPDF.Controls.Common.ControlType.ArrowTransTextBorderControl:
|
1312 |
|
|
case MarkupToPDF.Controls.Common.ControlType.ArrowTransTextCloudControl:
|
1313 |
|
|
case MarkupToPDF.Controls.Common.ControlType.ArrowTransTextControl:
|
1314 |
|
|
{
|
1315 |
|
|
MarkupToPDF.Serialize.S_Control.S_ArrowTextControl instance = MarkupToPDF.Serialize.Core.JsonSerializerHelper.JsonDeserialize<MarkupToPDF.Serialize.S_Control.S_ArrowTextControl>(data);
|
1316 |
2089959a
|
taeseongkim
|
|
1317 |
|
|
if (!string.IsNullOrWhiteSpace(instance.ArrowText))
|
1318 |
79f3f21a
|
djkim
|
{
|
1319 |
2089959a
|
taeseongkim
|
if (instance.ArrowText.Contains(search_str))
|
1320 |
|
|
{
|
1321 |
|
|
small_list.Add(item);
|
1322 |
|
|
}
|
1323 |
79f3f21a
|
djkim
|
}
|
1324 |
|
|
}
|
1325 |
|
|
break;
|
1326 |
|
|
}
|
1327 |
|
|
}
|
1328 |
90e7968d
|
ljiyeon
|
|
1329 |
39f0624f
|
ljiyeon
|
MarkupList.ItemsSource = null;
|
1330 |
|
|
MarkupList.ItemsSource = small_list.OrderBy(d => d.PageNumber).ToList();
|
1331 |
2089959a
|
taeseongkim
|
}
|
1332 |
|
|
|
1333 |
|
|
private void TxtSearch_KeyDown(object sender, KeyEventArgs e)
|
1334 |
|
|
{
|
1335 |
|
|
if(e.Key == Key.Enter || e.Key == Key.Return)
|
1336 |
|
|
{
|
1337 |
|
|
btnSearch_Click(sender, new RoutedEventArgs());
|
1338 |
|
|
}
|
1339 |
79f3f21a
|
djkim
|
}
|
1340 |
6c687be8
|
taeseongkim
|
|
1341 |
787a4489
|
KangIngu
|
}
|
1342 |
|
|
} |