개정판 d974f3f8
issue #721 화면 회전 후 M-TALK 코멘트 등록 시 Point를 찾지 못하는 현상 수정
KCOM/Controls/Sample.xaml.cs | ||
---|---|---|
196 | 196 |
this.ImgListbox.ScrollIntoView(_pageNumber - 1); |
197 | 197 |
} |
198 | 198 |
} |
199 |
} |
|
199 |
}
|
|
200 | 200 |
|
201 | 201 |
public void setPageChange(ThumbnailItem thumbnailItem) |
202 | 202 |
{ |
... | ... | |
222 | 222 |
} |
223 | 223 |
} |
224 | 224 |
|
225 |
public void GotoPageTALK(int _pageNumber, int _angle) |
|
226 |
{ |
|
227 |
int _PageNo = -1; |
|
228 |
|
|
229 |
if (int.TryParse(_pageNumber.ToString(), out _PageNo)) |
|
230 |
{ |
|
231 |
var _page = _thumbnailItems.Where(item => item.PageNumber == _PageNo); |
|
232 |
if (_page.Count() > 0) |
|
233 |
{ |
|
234 |
ThumbnailItem _item = _page.First(); |
|
235 |
setPageChangeTALK(_item, _angle); |
|
236 |
this.ImgListbox.SelectedIndex = _pageNumber - 1; |
|
237 |
this.ImgListbox.ScrollIntoView(_pageNumber - 1); |
|
238 |
} |
|
239 |
} |
|
240 |
} |
|
241 |
|
|
242 |
public void setPageChangeTALK(ThumbnailItem thumbnailItem, int _angle) |
|
243 |
{ |
|
244 |
if (thumbnailItem != null) |
|
245 |
{ |
|
246 |
if (PageChanging != null) |
|
247 |
{ |
|
248 |
this.CurrentPage = _NextPage; |
|
249 |
_NextPage = thumbnailItem; |
|
250 |
PageChanging(this, new PageChangeEventArgs |
|
251 |
{ |
|
252 |
CurrentPage = _PageList.Where(p => p.PAGE_NUMBER == thumbnailItem.PageNumber).First(), |
|
253 |
PageNumber = Convert.ToInt32(thumbnailItem.PageNumber), |
|
254 |
PageUri = null |
|
255 |
}); |
|
256 |
|
|
257 |
var instanceMain = this.ParentOfType<MainWindow>(); |
|
258 |
|
|
259 |
var rotationNum = (_angle - instanceMain.dzMainMenu.rotate.Angle) / 90; |
|
260 |
|
|
261 |
if (rotationNum > 0) // 1, 2, 3 |
|
262 |
{ |
|
263 |
for(int i = 0; i < rotationNum; i++) |
|
264 |
{ |
|
265 |
drawingPannelRotate(true); |
|
266 |
} |
|
267 |
} |
|
268 |
else if(rotationNum < 0)// -1, -2, -3 |
|
269 |
{ |
|
270 |
for (int i = 0; i < -rotationNum; i++) |
|
271 |
{ |
|
272 |
drawingPannelRotate(false); |
|
273 |
} |
|
274 |
} |
|
275 |
} |
|
276 |
} |
|
277 |
} |
|
278 |
|
|
279 |
public void drawingPannelRotate(bool Flag) |
|
280 |
{ |
|
281 |
var instanceMain = this.ParentOfType<MainWindow>(); |
|
282 |
|
|
283 |
if (Flag) |
|
284 |
{ |
|
285 |
if (instanceMain.dzMainMenu.rotate.Angle == 270) |
|
286 |
{ |
|
287 |
instanceMain.dzMainMenu.rotate.Angle = 0; |
|
288 |
} |
|
289 |
else |
|
290 |
{ |
|
291 |
instanceMain.dzMainMenu.rotate.Angle += 90; |
|
292 |
} |
|
293 |
} |
|
294 |
else |
|
295 |
{ |
|
296 |
if (instanceMain.dzMainMenu.rotate.Angle == 0) |
|
297 |
{ |
|
298 |
instanceMain.dzMainMenu.rotate.Angle = 270; |
|
299 |
} |
|
300 |
else |
|
301 |
{ |
|
302 |
instanceMain.dzMainMenu.rotate.Angle -= 90; |
|
303 |
} |
|
304 |
} |
|
305 |
|
|
306 |
if (instanceMain.dzMainMenu.zoomAndPanCanvas.Width == ViewerDataModel.Instance.ContentWidth) |
|
307 |
{ |
|
308 |
double emptySize = instanceMain.dzMainMenu.zoomAndPanCanvas.Width; |
|
309 |
instanceMain.dzMainMenu.zoomAndPanCanvas.Width = instanceMain.dzMainMenu.zoomAndPanCanvas.Height; |
|
310 |
instanceMain.dzMainMenu.zoomAndPanCanvas.Height = emptySize; |
|
311 |
} |
|
312 |
|
|
313 |
if (instanceMain.dzMainMenu.rotate.Angle == 0) |
|
314 |
{ |
|
315 |
instanceMain.dzMainMenu.translate.X = 0; |
|
316 |
instanceMain.dzMainMenu.translate.Y = 0; |
|
317 |
} |
|
318 |
else if (instanceMain.dzMainMenu.rotate.Angle == 90) |
|
319 |
{ |
|
320 |
instanceMain.dzMainMenu.translate.X = instanceMain.dzMainMenu.zoomAndPanCanvas.Width; |
|
321 |
instanceMain.dzMainMenu.translate.Y = 0; |
|
322 |
} |
|
323 |
else if (instanceMain.dzMainMenu.rotate.Angle == 180) |
|
324 |
{ |
|
325 |
instanceMain.dzMainMenu.translate.X = instanceMain.dzMainMenu.zoomAndPanCanvas.Width; |
|
326 |
instanceMain.dzMainMenu.translate.Y = instanceMain.dzMainMenu.zoomAndPanCanvas.Height; |
|
327 |
} |
|
328 |
else |
|
329 |
{ |
|
330 |
instanceMain.dzMainMenu.translate.X = 0; |
|
331 |
instanceMain.dzMainMenu.translate.Y = instanceMain.dzMainMenu.zoomAndPanCanvas.Height; |
|
332 |
} |
|
333 |
|
|
334 |
instanceMain.dzMainMenu.zoomAndPanControl.RotationAngle = instanceMain.dzMainMenu.rotate.Angle; |
|
335 |
ViewerDataModel.Instance.ContentWidth = instanceMain.dzMainMenu.zoomAndPanCanvas.Width; |
|
336 |
ViewerDataModel.Instance.ContentHeight = instanceMain.dzMainMenu.zoomAndPanCanvas.Height; |
|
337 |
ViewerDataModel.Instance.AngleOffsetX = instanceMain.dzMainMenu.translate.X; |
|
338 |
ViewerDataModel.Instance.AngleOffsetY = instanceMain.dzMainMenu.translate.Y; |
|
339 |
ViewerDataModel.Instance.Angle = instanceMain.dzMainMenu.rotate.Angle; |
|
340 |
|
|
341 |
instanceMain.dzMainMenu.pageNavigator._thumbnailItems.Where(info => info.PageNumber == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).ToList().ForEach(data => |
|
342 |
{ |
|
343 |
data.Angle = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString()); |
|
344 |
|
|
345 |
instanceMain.dzMainMenu.pageNavigator.ImgListbox.ItemsSource = instanceMain.dzMainMenu.pageNavigator._thumbnailItems; |
|
346 |
var instance = instanceMain.dzMainMenu.CurrentDoc.docInfo.DOCPAGE.Where(p => p.PAGE_NUMBER == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).FirstOrDefault(); |
|
347 |
instance.PAGE_ANGLE = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString()); |
|
348 |
|
|
349 |
var rotationdoc = ViewerDataModel.Instance.RotationDocs.Where(d => d.ID == instance.ID).FirstOrDefault(); |
|
350 |
if (rotationdoc != null) |
|
351 |
{ |
|
352 |
rotationdoc.PAGE_ANGLE = instance.PAGE_ANGLE; |
|
353 |
} |
|
354 |
else |
|
355 |
{ |
|
356 |
ViewerDataModel.Instance.RotationDocs.Add(instance); |
|
357 |
} |
|
358 |
instanceMain.dzMainMenu.pageNavigator.setPageChange(data); |
|
359 |
}); |
|
360 |
} |
|
361 |
|
|
225 | 362 |
public void SetNextPage() |
226 | 363 |
{ |
227 | 364 |
CurrentPage = _NextPage; |
KCOM/Messenger/ConversationView.xaml.cs | ||
---|---|---|
88 | 88 |
{ |
89 | 89 |
Controls.AdornerFinal finalItem = main.dzMainMenu.SelectLayer.Children[0] as Controls.AdornerFinal; |
90 | 90 |
Rect rect = new Rect(new Point(finalItem.BorderSize.Left - 100, finalItem.BorderSize.Top - 100), new Point(finalItem.BorderSize.Right + 100, finalItem.BorderSize.Bottom + 100)); |
91 |
|
|
92 |
var instanceMain = this.ParentOfType<MainWindow>(); |
|
93 |
if (instanceMain.dzMainMenu.rotate.Angle == 90) |
|
94 |
{ |
|
95 |
rect = new Rect(new Point(finalItem.BorderSize.Top - 100, finalItem.BorderSize.Right + 100), new Point(finalItem.BorderSize.Bottom + 100, finalItem.BorderSize.Left - 100)); |
|
96 |
double y = rect.Y; |
|
97 |
double x = rect.X; |
|
98 |
rect.X = instanceMain.dzMainMenu.zoomAndPanCanvas.Width - x - rect.Width; |
|
99 |
rect.Y = y; |
|
100 |
} |
|
101 |
else if(instanceMain.dzMainMenu.rotate.Angle == 180) |
|
102 |
{ |
|
103 |
rect = new Rect(new Point(finalItem.BorderSize.Right + 100, finalItem.BorderSize.Bottom + 100), new Point(finalItem.BorderSize.Left - 100, finalItem.BorderSize.Top - 100)); |
|
104 |
double y = rect.Y; |
|
105 |
double x = rect.X; |
|
106 |
rect.X = instanceMain.dzMainMenu.zoomAndPanCanvas.Width - x - rect.Width; |
|
107 |
rect.Y = instanceMain.dzMainMenu.zoomAndPanCanvas.Height - y - rect.Height; |
|
108 |
} |
|
109 |
else if(instanceMain.dzMainMenu.rotate.Angle == 270) |
|
110 |
{ |
|
111 |
rect = new Rect(new Point(finalItem.BorderSize.Bottom + 100, finalItem.BorderSize.Left - 100), new Point(finalItem.BorderSize.Top - 100, finalItem.BorderSize.Right + 100)); |
|
112 |
double y = rect.Y; |
|
113 |
double x = rect.X; |
|
114 |
rect.X = x; |
|
115 |
rect.Y = instanceMain.dzMainMenu.zoomAndPanCanvas.Height - y - rect.Height; |
|
116 |
} |
|
117 |
|
|
118 |
// Load 시 페이지 이동 없이 TALK 작성 시 Page값이 0으로 들어감, TALK TABLE에 PAGENUMBER가 0일 경우 Angle이 적용되지 않음. |
|
119 |
if (Common.ViewerDataModel.Instance.PageNumber == 0) |
|
120 |
{ |
|
121 |
Common.ViewerDataModel.Instance.PageNumber = 1; |
|
122 |
} |
|
123 |
|
|
91 | 124 |
KCOMDataModel.DataModel.TALK message = new KCOMDataModel.DataModel.TALK |
92 | 125 |
{ |
93 | 126 |
TEXT = args.PromptResult, |
... | ... | |
101 | 134 |
RECT_Y = rect.Y, |
102 | 135 |
RECT_WIDTH = rect.Width, |
103 | 136 |
RECT_HEIGHT = rect.Height, |
104 |
PAGENUMBER = Common.ViewerDataModel.Instance.PageNumber |
|
137 |
PAGENUMBER = Common.ViewerDataModel.Instance.PageNumber, |
|
138 |
ANGLE = (int)instanceMain.dzMainMenu.rotate.Angle |
|
105 | 139 |
}; |
106 | 140 |
|
107 | 141 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.AddMessage(App.ViewInfo.ProjectNO, message); |
... | ... | |
129 | 163 |
private void SaveAuthorization(object parameter) |
130 | 164 |
{ |
131 | 165 |
KCOMDataModel.DataModel.TALK instance = parameter as KCOMDataModel.DataModel.TALK; |
132 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.GotoPage(instance.PAGENUMBER.Value); |
|
133 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.zoomAndPanControl.ZoomTo(new Rect { X = instance.RECT_X.Value, Y = instance.RECT_Y.Value, Width = instance.RECT_WIDTH.Value, Height = instance.RECT_HEIGHT.Value }); |
|
166 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.rotate.Angle = instance.ANGLE; |
|
167 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.GotoPageTALK(instance.PAGENUMBER.Value, instance.ANGLE); |
|
168 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.zoomAndPanControl.ZoomToTalk(new Rect { X = instance.RECT_X.Value, Y = instance.RECT_Y.Value, Width = instance.RECT_WIDTH.Value, Height = instance.RECT_HEIGHT.Value } , instance.ANGLE); |
|
134 | 169 |
} |
135 | 170 |
|
136 | 171 |
public event PropertyChangedEventHandler PropertyChanged; |
KCOMDataModel/DataModel/CIModel.Designer.cs | ||
---|---|---|
3383 | 3383 |
/// <param name="mEMBER_ID">MEMBER_ID 속성의 초기 값입니다.</param> |
3384 | 3384 |
/// <param name="dOCUMENT_ID">DOCUMENT_ID 속성의 초기 값입니다.</param> |
3385 | 3385 |
/// <param name="mEMBER_NAME">MEMBER_NAME 속성의 초기 값입니다.</param> |
3386 |
public static TALK CreateTALK(global::System.Int32 id, global::System.String tEXT, global::System.DateTime tIMESTAMP, global::System.Byte mSGTYPE, global::System.Byte mSGSIDE, global::System.String mEMBER_ID, global::System.String dOCUMENT_ID, global::System.String mEMBER_NAME) |
|
3386 |
/// <param name="aNGLE">ANGLE 속성의 초기 값입니다.</param> |
|
3387 |
public static TALK CreateTALK(global::System.Int32 id, global::System.String tEXT, global::System.DateTime tIMESTAMP, global::System.Byte mSGTYPE, global::System.Byte mSGSIDE, global::System.String mEMBER_ID, global::System.String dOCUMENT_ID, global::System.String mEMBER_NAME, global::System.Int32 aNGLE) |
|
3387 | 3388 |
{ |
3388 | 3389 |
TALK tALK = new TALK(); |
3389 | 3390 |
tALK.ID = id; |
... | ... | |
3394 | 3395 |
tALK.MEMBER_ID = mEMBER_ID; |
3395 | 3396 |
tALK.DOCUMENT_ID = dOCUMENT_ID; |
3396 | 3397 |
tALK.MEMBER_NAME = mEMBER_NAME; |
3398 |
tALK.ANGLE = aNGLE; |
|
3397 | 3399 |
return tALK; |
3398 | 3400 |
} |
3399 | 3401 |
|
... | ... | |
3715 | 3717 |
private global::System.String _MEMBER_NAME; |
3716 | 3718 |
partial void OnMEMBER_NAMEChanging(global::System.String value); |
3717 | 3719 |
partial void OnMEMBER_NAMEChanged(); |
3720 |
|
|
3721 |
/// <summary> |
|
3722 |
/// 사용 가능한 메타데이터 설명서가 없습니다. |
|
3723 |
/// </summary> |
|
3724 |
[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)] |
|
3725 |
[DataMemberAttribute()] |
|
3726 |
public global::System.Int32 ANGLE |
|
3727 |
{ |
|
3728 |
get |
|
3729 |
{ |
|
3730 |
return _ANGLE; |
|
3731 |
} |
|
3732 |
set |
|
3733 |
{ |
|
3734 |
OnANGLEChanging(value); |
|
3735 |
ReportPropertyChanging("ANGLE"); |
|
3736 |
_ANGLE = StructuralObject.SetValidValue(value); |
|
3737 |
ReportPropertyChanged("ANGLE"); |
|
3738 |
OnANGLEChanged(); |
|
3739 |
} |
|
3740 |
} |
|
3741 |
private global::System.Int32 _ANGLE; |
|
3742 |
partial void OnANGLEChanging(global::System.Int32 value); |
|
3743 |
partial void OnANGLEChanged(); |
|
3718 | 3744 |
|
3719 | 3745 |
#endregion |
3720 | 3746 |
|
KCOMDataModel/DataModel/CIModel.edmx | ||
---|---|---|
169 | 169 |
<Property Name="MEMBER_ID" Type="nvarchar" MaxLength="50" Nullable="false" /> |
170 | 170 |
<Property Name="DOCUMENT_ID" Type="nvarchar" MaxLength="50" Nullable="false" /> |
171 | 171 |
<Property Name="MEMBER_NAME" Type="nvarchar" MaxLength="50" Nullable="false" /> |
172 |
<Property Name="ANGLE" Type="int" Nullable="false" /> |
|
172 | 173 |
</EntityType> |
173 | 174 |
<Association Name="FK_DOCINFODOFPAGE"> |
174 | 175 |
<End Role="DOCINFO" Type="Self.DOCINFO" Multiplicity="1" /> |
... | ... | |
491 | 492 |
<Property Name="MEMBER_ID" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" /> |
492 | 493 |
<Property Name="DOCUMENT_ID" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" /> |
493 | 494 |
<Property Name="MEMBER_NAME" Type="String" Nullable="false" MaxLength="50" FixedLength="false" Unicode="true" /> |
495 |
<Property Name="ANGLE" Type="Int32" Nullable="false" /> |
|
494 | 496 |
</EntityType> |
495 | 497 |
<EntityType Name="CHECK_LIST"> |
496 | 498 |
<Key> |
... | ... | |
657 | 659 |
<EntitySetMapping Name="TALK"> |
658 | 660 |
<EntityTypeMapping TypeName="CIModel.TALK"> |
659 | 661 |
<MappingFragment StoreEntitySet="TALK"> |
662 |
<ScalarProperty Name="ANGLE" ColumnName="ANGLE" /> |
|
660 | 663 |
<ScalarProperty Name="MEMBER_NAME" ColumnName="MEMBER_NAME" /> |
661 | 664 |
<ScalarProperty Name="DOCUMENT_ID" ColumnName="DOCUMENT_ID" /> |
662 | 665 |
<ScalarProperty Name="MEMBER_ID" ColumnName="MEMBER_ID" /> |
ZoomAndPan/ZoomAndPanControl.cs | ||
---|---|---|
1002 | 1002 |
(contentRect.Width), contentRect.Y + (contentRect.Height / 2))); |
1003 | 1003 |
} |
1004 | 1004 |
|
1005 |
public void ZoomToTalk(Rect contentRect, int Angle) |
|
1006 |
{ |
|
1007 |
double scaleX = ContentViewportWidth / contentRect.Width; |
|
1008 |
double scaleY = ContentViewportHeight / contentRect.Height; |
|
1009 |
double newScale = ContentScale * Math.Min(scaleX, scaleY); |
|
1010 |
|
|
1011 |
//각도가 변경 됨에 따라 해당 Width, Height가 변경이 되지 않아 조건에 맞춰 변경해줌 ,값이 소수 점이 생겨서 (int) . |
|
1012 |
if ((int)ConstrainedContentViewportWidth == (int)ConstrainedContentViewportHeight && (Angle == 180 || Angle == 0)) |
|
1013 |
{ |
|
1014 |
ConstrainedContentViewportWidth = unScaledExtent.Height; |
|
1015 |
ConstrainedContentViewportHeight = unScaledExtent.Width; |
|
1016 |
ContentViewportHeight = unScaledExtent.Width; |
|
1017 |
unScaledExtent.Height = ContentViewportHeight; |
|
1018 |
unScaledExtent.Width = ConstrainedContentViewportWidth; |
|
1019 |
} |
|
1020 |
else if ((int)ConstrainedContentViewportWidth == (int)ConstrainedContentViewportHeight && (Angle == 90 || Angle == 270)) |
|
1021 |
{ |
|
1022 |
double emptySize = unScaledExtent.Height; |
|
1023 |
ConstrainedContentViewportWidth = ConstrainedContentViewportHeight; |
|
1024 |
ConstrainedContentViewportHeight = emptySize; |
|
1025 |
unScaledExtent.Width = ConstrainedContentViewportWidth; |
|
1026 |
unScaledExtent.Height = ConstrainedContentViewportHeight; |
|
1027 |
} |
|
1028 |
else if ((int)ConstrainedContentViewportHeight == (int)ContentViewportHeight && (Angle == 90 || Angle == 270)) |
|
1029 |
{ |
|
1030 |
double emptySize = ConstrainedContentViewportWidth; |
|
1031 |
ConstrainedContentViewportWidth = ConstrainedContentViewportHeight; |
|
1032 |
ConstrainedContentViewportHeight = emptySize; |
|
1033 |
unScaledExtent.Width = ConstrainedContentViewportWidth; |
|
1034 |
unScaledExtent.Height = ConstrainedContentViewportHeight; |
|
1035 |
} |
|
1036 |
else if ((int)ConstrainedContentViewportHeight != (int)ContentViewportHeight && (Angle == 180 || Angle == 0)) |
|
1037 |
{ |
|
1038 |
double emptySize = ConstrainedContentViewportWidth; |
|
1039 |
ConstrainedContentViewportWidth = ConstrainedContentViewportHeight; |
|
1040 |
ConstrainedContentViewportHeight = emptySize; |
|
1041 |
unScaledExtent.Width = ConstrainedContentViewportWidth; |
|
1042 |
unScaledExtent.Height = ConstrainedContentViewportHeight; |
|
1043 |
} |
|
1044 |
|
|
1045 |
ZoomPointToViewportCenter(newScale, new Point(contentRect.X + (contentRect.Width / 2), contentRect.Y + (contentRect.Height / 2))); |
|
1046 |
} |
|
1047 |
|
|
1005 | 1048 |
public void ZoomTo(Rect contentRect) |
1006 | 1049 |
{ |
1007 | 1050 |
double scaleX = this.ContentViewportWidth / contentRect.Width; |
1008 | 1051 |
double scaleY = this.ContentViewportHeight / contentRect.Height; |
1009 | 1052 |
double newScale = this.ContentScale * Math.Min(scaleX, scaleY); |
1010 | 1053 |
|
1011 |
ZoomPointToViewportCenter(newScale, new Point(contentRect.X + |
|
1012 |
(contentRect.Width / 2), contentRect.Y + (contentRect.Height / 2))); |
|
1054 |
ZoomPointToViewportCenter(newScale, new Point(contentRect.X + (contentRect.Width / 2), contentRect.Y + (contentRect.Height / 2))); |
|
1013 | 1055 |
} |
1014 | 1056 |
|
1015 | 1057 |
public void ZoomPointToViewportCenter(double newContentScale, Point contentZoomFocus) |
1016 |
{ |
|
1058 |
{
|
|
1017 | 1059 |
newContentScale = Math.Min(Math.Max(newContentScale, MinContentScale), MaxContentScale); |
1018 | 1060 |
this.ContentScale = newContentScale; |
1019 | 1061 |
this.ContentOffsetX = contentZoomFocus.X - (ContentViewportWidth / 2); |
1020 | 1062 |
this.ContentOffsetY = contentZoomFocus.Y - (ContentViewportHeight / 2); |
1021 |
|
|
1022 |
} |
|
1063 |
} |
|
1023 | 1064 |
} |
1024 | 1065 |
} |
내보내기 Unified diff