개정판 77475d87
dev issue #1227 : mapping form image
Change-Id: Ie92fcf47aa16202ad02cf25b70d0b3abbc4653c2
DTI_PID/APIDConverter/Form/MappingForm.cs | ||
---|---|---|
145 | 145 |
|
146 | 146 |
private void btnSave_Click(object sender, EventArgs e) |
147 | 147 |
{ |
148 |
ClearImage(); |
|
148 | 149 |
DialogResult = DialogResult.OK; |
149 | 150 |
} |
150 | 151 |
|
151 | 152 |
private void btnClose_Click(object sender, EventArgs e) |
152 | 153 |
{ |
154 |
ClearImage(); |
|
153 | 155 |
DialogResult = DialogResult.Cancel; |
154 | 156 |
} |
155 | 157 |
|
... | ... | |
201 | 203 |
Cursor = Cursors.WaitCursor; |
202 | 204 |
try |
203 | 205 |
{ |
206 |
if (pictureEditMapped.Image != null) |
|
207 |
pictureEditMapped.Image.Dispose(); |
|
208 |
pictureEditMapped.Image = null; |
|
209 |
|
|
204 | 210 |
while (galleryControlAvevaSymbols.Gallery.Groups[0].Items.Count > 0) |
205 | 211 |
{ |
206 | 212 |
DevExpress.XtraBars.Ribbon.GalleryItem item = galleryControlAvevaSymbols.Gallery.Groups[0].Items[0]; |
... | ... | |
301 | 307 |
string result = ""; |
302 | 308 |
GetNodeLoopText(treeListAvevaSymbol.FocusedNode, ref result); |
303 | 309 |
gridViewSymbol.SetRowCellValue(gridViewSymbol.FocusedRowHandle, "APID_SYMBOL", result + @"\" + e.Item.Caption); |
310 |
|
|
311 |
Project_Info info = Project_Info.GetInstance(); |
|
312 |
string fullPath = gridViewSymbol.GetRowCellDisplayText(gridViewSymbol.FocusedRowHandle, "APID_SYMBOL"); |
|
313 |
string _ID2ImagePath = info.AVEVA_ImageDirPath + fullPath + ".png"; |
|
314 |
if (pictureEditMapped.Image != null) |
|
315 |
{ |
|
316 |
pictureEditMapped.Image.Dispose(); |
|
317 |
pictureEditMapped.Image = null; |
|
318 |
} |
|
319 |
if (File.Exists(_ID2ImagePath)) |
|
320 |
pictureEditMapped.Image = Image.FromFile(_ID2ImagePath); |
|
304 | 321 |
} |
305 | 322 |
} |
306 | 323 |
#endregion |
... | ... | |
311 | 328 |
if (node.ParentNode != null) |
312 | 329 |
GetNodeLoopText(node.ParentNode, ref result); |
313 | 330 |
} |
331 |
|
|
332 |
private void ClearImage() |
|
333 |
{ |
|
334 |
while (galleryControlAvevaSymbols.Gallery.Groups[0].Items.Count > 0) |
|
335 |
{ |
|
336 |
DevExpress.XtraBars.Ribbon.GalleryItem item = galleryControlAvevaSymbols.Gallery.Groups[0].Items[0]; |
|
337 |
galleryControlAvevaSymbols.Gallery.Groups[0].Items.Remove(item); |
|
338 |
item.ImageOptions.Image.Dispose(); |
|
339 |
item.ImageOptions.Dispose(); |
|
340 |
} |
|
341 |
|
|
342 |
if (pictureEditMapped.Image != null) |
|
343 |
pictureEditMapped.Image.Dispose(); |
|
344 |
pictureEditMapped.Image = null; |
|
345 |
|
|
346 |
if (pictureEditID2Symbol.Image != null) |
|
347 |
pictureEditID2Symbol.Image.Dispose(); |
|
348 |
pictureEditID2Symbol.Image = null; |
|
349 |
} |
|
314 | 350 |
} |
315 | 351 |
} |
내보내기 Unified diff