개정판 a36a37c3
issue #923: create PreviewUserMarkupInfoItem if there is no markupinfo or all of markupinfo are avoided
Change-Id: I541878f97686be22a3634baf991d3d98653faa28
KCOM/Services/BaseServices.cs | ||
---|---|---|
252 | 252 |
|
253 | 253 |
/// <summary> |
254 | 254 |
/// get markupinfo and markupitem from database |
255 |
/// - 1. called when document is loaded |
|
256 |
/// - 2. called when user do consolidation |
|
255 | 257 |
/// </summary> |
256 | 258 |
/// <param name="sender"></param> |
257 | 259 |
/// <param name="e"></param> |
... | ... | |
264 | 266 |
if (e.Result != null) |
265 | 267 |
{ |
266 | 268 |
ViewerDataModel.Instance._markupInfoList.Clear(); |
267 |
var pureItem = e.Result; |
|
268 |
if (pureItem.Count > 0) |
|
269 |
if (e.Result.Count > 0) |
|
269 | 270 |
{ |
270 | 271 |
ViewerDataModel.Instance.MyMarkupList.Clear(); |
271 | 272 |
} |
... | ... | |
284 | 285 |
ViewerDataModel.Instance._markupInfoList.Add(info); |
285 | 286 |
} |
286 | 287 |
|
287 |
pureItem.ToList().ForEach(d => d.MarkupList.ForEach(p =>
|
|
288 |
e.Result.ToList().ForEach(d => d.MarkupList.ForEach(p =>
|
|
288 | 289 |
{ |
289 | 290 |
if (d.UserID == App.ViewInfo.UserID) |
290 | 291 |
{ |
... | ... | |
329 | 330 |
} |
330 | 331 |
})); |
331 | 332 |
|
332 |
var currentUser = e.Result.Where(data => data.UserID == userData.ID).FirstOrDefault();
|
|
333 |
var currentUser = e.Result.Where(data => data.UserID == App.ViewInfo.UserID && data.AvoidConsolidate == 0).FirstOrDefault();
|
|
333 | 334 |
if (currentUser == null) |
334 | 335 |
{ |
336 |
/// create a new markupinfo to do comments |
|
335 | 337 |
var infoId = Commons.shortGuid(); |
336 | 338 |
PreviewUserMarkupInfoItem = new MarkupInfoItem |
337 | 339 |
{ |
... | ... | |
361 | 363 |
App.Custom_ViewInfoId = currentUser.MarkupInfoID; |
362 | 364 |
} |
363 | 365 |
|
364 |
foreach(var info in pureItem)
|
|
366 |
foreach(var info in e.Result)
|
|
365 | 367 |
{ |
366 | 368 |
if (info.UserID == App.ViewInfo.UserID) info.DisplayColor = "#FFFF0000"; |
367 | 369 |
} |
368 | 370 |
|
369 |
//Consolidation 된 데이터가 최상단에 올 수 있도록 변경 |
|
371 |
/// Consolidation 된 데이터가 최상단에 올 수 있도록 변경
|
|
370 | 372 |
var markupItem = ViewerDataModel.Instance._markupInfoList.OrderByDescending(p => p.Consolidate == Convert.ToInt32(true)).ToList(); |
371 |
|
|
372 | 373 |
markupItem.ForEach(data => |
373 | 374 |
{ |
374 | 375 |
if (data.Depatment == null) data.Depatment = "Unknown"; |
... | ... | |
376 | 377 |
gridViewMarkup.ItemsSource = ViewerDataModel.Instance._markupInfoList; |
377 | 378 |
SetCommentPages(); |
378 | 379 |
|
379 |
var select_item = ViewerDataModel.Instance._markupInfoList.Where(info => info.UserID == App.ViewInfo.UserID).OrderByDescending(order => order.Consolidate == Convert.ToInt32(true)).FirstOrDefault();
|
|
380 |
this.gridViewMarkup.SelectedItem = select_item;
|
|
380 |
var SelectedItem = ViewerDataModel.Instance._markupInfoList.Where(info => info.UserID == App.ViewInfo.UserID).OrderByDescending(order => order.UpdateTime).FirstOrDefault();
|
|
381 |
this.gridViewMarkup.SelectedItem = (PreviewUserMarkupInfoItem != null) ? PreviewUserMarkupInfoItem : SelectedItem;
|
|
381 | 382 |
|
383 |
/// create a group descriptor |
|
382 | 384 |
gridViewMarkup.GroupDescriptors.Clear(); |
383 | 385 |
GroupDescriptor descriptor = new GroupDescriptor(); |
384 | 386 |
descriptor.Member = "Depatment"; |
385 | 387 |
descriptor.DisplayContent = "DEPT"; |
386 | 388 |
descriptor.SortDirection = ListSortDirection.Ascending; |
387 | 389 |
gridViewMarkup.GroupDescriptors.Add(descriptor); |
390 |
/// up to here |
|
388 | 391 |
} |
389 | 392 |
} |
390 | 393 |
|
KCOM/Views/MainMenu.xaml.cs | ||
---|---|---|
1232 | 1232 |
} |
1233 | 1233 |
|
1234 | 1234 |
getCurrentPoint = e.GetPosition(drawingRotateCanvas); |
1235 |
#region 주석 |
|
1236 |
//if (mouseButtonDown == MouseButton.Middle) |
|
1237 |
//{ |
|
1238 |
// SetCursor(); |
|
1239 |
// Point currentCanvasDrawingMouseMovePoint = e.GetPosition(drawingRotateCanvas); |
|
1240 |
// Point currentCanvasZoomPanningMouseMovePoint = e.GetPosition(zoomAndPanCanvas); |
|
1241 |
|
|
1242 |
// Vector dragOffset = currentCanvasZoomPanningMouseMovePoint - canvasZoommovingMouseDownPoint; |
|
1243 |
// zoomAndPanControl.ContentOffsetX -= dragOffset.X; |
|
1244 |
// zoomAndPanControl.ContentOffsetY -= dragOffset.Y; |
|
1245 |
|
|
1246 |
// //SetCursor(); |
|
1247 |
// //Point currentCanvasDrawingMouseMovePoint = e.GetPosition(drawingRotateCanvas); |
|
1248 |
// //Point currentCanvasZoomPanningMouseMovePoint = e.GetPosition(zoomAndPanCanvas); |
|
1249 |
|
|
1250 |
// //Vector dragOffset = currentCanvasZoomPanningMouseMovePoint - canvasZoommovingMouseDownPoint; |
|
1251 |
|
|
1252 |
// //zoomAndPanControl.ContentOffsetX += 1; |
|
1253 |
// //zoomAndPanControl.ContentOffsetY += 1; |
|
1254 |
|
|
1255 |
// //zoomAndPanControl.ContentOffsetX += dragOffset.X; |
|
1256 |
// //zoomAndPanControl.ContentOffsetY += dragOffset.Y; |
|
1257 |
//} |
|
1258 |
#endregion |
|
1259 |
|
|
1235 |
|
|
1260 | 1236 |
if ((e.MiddleButton == MouseButtonState.Pressed) || (e.RightButton == MouseButtonState.Pressed)) |
1261 | 1237 |
{ |
1262 | 1238 |
SetCursor(); |
내보내기 Unified diff