개정판 632b257e
issue #00000 imageinfo 추가
Change-Id: I89948546d39b87ee3561c28a0b71a27b2edf4fff
ID2.Manager/ID2.Manager/Controls/BriefAndImages.Designer.cs | ||
---|---|---|
126 | 126 |
this.LayoutDoftech.RowCount = 3; |
127 | 127 |
this.LayoutDoftech.RowStyles.Add(new System.Windows.Forms.RowStyle()); |
128 | 128 |
this.LayoutDoftech.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); |
129 |
this.LayoutDoftech.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 60F));
|
|
129 |
this.LayoutDoftech.RowStyles.Add(new System.Windows.Forms.RowStyle()); |
|
130 | 130 |
this.LayoutDoftech.Size = new System.Drawing.Size(280, 105); |
131 | 131 |
this.LayoutDoftech.TabIndex = 0; |
132 | 132 |
// |
... | ... | |
164 | 164 |
// lstToImages |
165 | 165 |
// |
166 | 166 |
this.lstToImages.AllowArbitraryItemHeight = true; |
167 |
this.lstToImages.AllowEdit = false; |
|
168 |
this.lstToImages.AutoScroll = true; |
|
167 | 169 |
this.lstToImages.Dock = System.Windows.Forms.DockStyle.Fill; |
168 | 170 |
this.lstToImages.FullRowSelect = false; |
169 | 171 |
this.lstToImages.ItemSize = new System.Drawing.Size(57, 57); |
170 | 172 |
this.lstToImages.Location = new System.Drawing.Point(3, 48); |
171 | 173 |
this.lstToImages.Name = "lstToImages"; |
174 |
// |
|
175 |
// |
|
176 |
// |
|
177 |
this.lstToImages.RootElement.MaxSize = new System.Drawing.Size(0, 60); |
|
172 | 178 |
this.lstToImages.ShowItemToolTips = false; |
173 | 179 |
this.lstToImages.Size = new System.Drawing.Size(274, 54); |
174 | 180 |
this.lstToImages.TabIndex = 4; |
... | ... | |
197 | 203 |
// lstFrImages |
198 | 204 |
// |
199 | 205 |
this.lstFrImages.AllowArbitraryItemHeight = true; |
206 |
this.lstFrImages.AllowEdit = false; |
|
200 | 207 |
this.lstFrImages.Dock = System.Windows.Forms.DockStyle.Fill; |
201 | 208 |
this.lstFrImages.FullRowSelect = false; |
202 | 209 |
this.lstFrImages.ItemSize = new System.Drawing.Size(57, 57); |
ID2.Manager/ID2.Manager/Controls/BriefAndImages.cs | ||
---|---|---|
1 |
using System; |
|
1 |
using ID2.Manager.Data.Models; |
|
2 |
using System; |
|
2 | 3 |
using System.Collections.Generic; |
3 | 4 |
using System.ComponentModel; |
4 | 5 |
using System.Data; |
... | ... | |
17 | 18 |
public partial class BriefAndImages : UserControl |
18 | 19 |
{ |
19 | 20 |
const int TextMinHeight = 30; |
21 |
public event EventHandler<AttImageInfo> RemoveImage; |
|
20 | 22 |
|
21 | 23 |
public BriefAndImages() |
22 | 24 |
{ |
... | ... | |
37 | 39 |
selectImage.MouseWheel += SelectImage_MouseWheel; |
38 | 40 |
|
39 | 41 |
lstToImages.SelectedItemChanged += LstImages_SelectedItemChanged; |
42 |
lstToImages.ItemRemoved += LstToImages_ItemRemoved; |
|
40 | 43 |
lstToImages.VisualItemFormatting += LstImages_VisualItemFormatting; |
41 | 44 |
lstFrImages.SelectedItemChanged += LstImages_SelectedItemChanged; |
45 |
lstFrImages.ItemRemoved += LstFrImages_ItemRemoved; |
|
42 | 46 |
lstFrImages.VisualItemFormatting += LstImages_VisualItemFormatting; |
47 |
} |
|
43 | 48 |
|
49 |
private void LstFrImages_ItemRemoved(object sender, ListViewItemEventArgs e) |
|
50 |
{ |
|
51 |
if(RemoveImage != null) |
|
52 |
{ |
|
53 |
RemoveImage(this, e.Item.DataBoundItem as AttImageInfo); |
|
54 |
} |
|
55 |
} |
|
56 |
|
|
57 |
private void LstToImages_ItemRemoved(object sender, ListViewItemEventArgs e) |
|
58 |
{ |
|
59 |
if (RemoveImage != null) |
|
60 |
{ |
|
61 |
RemoveImage(this, e.Item.DataBoundItem as AttImageInfo); |
|
62 |
} |
|
44 | 63 |
} |
45 | 64 |
|
46 | 65 |
private void TextBoxItemDoftech_LostFocus(object sender, EventArgs e) |
... | ... | |
116 | 135 |
//selectImage.ContextMenuProperties.EditItem.Visibility = ElementVisibility.Collapsed; |
117 | 136 |
} |
118 | 137 |
|
119 |
public void SetToImages(List<Byte[]> images)
|
|
138 |
public void SetToImages(List<AttImageInfo> images)
|
|
120 | 139 |
{ |
121 | 140 |
foreach (var image in images) |
122 | 141 |
{ |
... | ... | |
129 | 148 |
} |
130 | 149 |
} |
131 | 150 |
|
132 |
public void AddToImage(Byte[] image,bool SelectItem = false)
|
|
151 |
public void AddToImage(AttImageInfo image,bool SelectItem = false)
|
|
133 | 152 |
{ |
134 |
ListViewDataItem item = new ListViewDataItem(Guid.NewGuid().ToString());
|
|
153 |
ListViewDataItem item = new ListViewDataItem(image);
|
|
135 | 154 |
item.ImageAlignment = ContentAlignment.MiddleCenter; |
136 | 155 |
item.Text = ""; |
137 |
item.Image = GetImage(image); |
|
156 |
item.Image = GetImage(image.Data);
|
|
138 | 157 |
item.TextImageRelation = TextImageRelation.Overlay; |
139 | 158 |
lstToImages.Items.Add(item); |
140 | 159 |
|
... | ... | |
144 | 163 |
} |
145 | 164 |
} |
146 | 165 |
|
147 |
public void SetFrImages(List<Byte[]> images)
|
|
166 |
public void SetFrImages(List<AttImageInfo> images)
|
|
148 | 167 |
{ |
149 | 168 |
foreach (var image in images) |
150 | 169 |
{ |
... | ... | |
158 | 177 |
} |
159 | 178 |
|
160 | 179 |
|
161 |
public void AddFrImage(Byte[] image, bool SelectItem = false)
|
|
180 |
public void AddFrImage(AttImageInfo image, bool SelectItem = false)
|
|
162 | 181 |
{ |
163 |
ListViewDataItem item = new ListViewDataItem(Guid.NewGuid().ToString());
|
|
182 |
ListViewDataItem item = new ListViewDataItem(image);
|
|
164 | 183 |
item.ImageAlignment = ContentAlignment.MiddleCenter; |
165 | 184 |
item.Text = ""; |
166 |
item.Image = GetImage(image); |
|
185 |
item.Image = GetImage(image.Data);
|
|
167 | 186 |
item.TextImageRelation = TextImageRelation.Overlay; |
168 | 187 |
lstFrImages.Items.Add(item); |
169 | 188 |
|
... | ... | |
237 | 256 |
} |
238 | 257 |
|
239 | 258 |
} |
259 |
|
|
260 |
} |
|
261 |
|
|
262 |
public class AttImageInfo |
|
263 |
{ |
|
264 |
public string ID { get; set; } |
|
265 |
public byte[] Data { get; set; } |
|
240 | 266 |
} |
ID2.Manager/ID2.Manager/Main.cs | ||
---|---|---|
56 | 56 |
BriefAndImages briefAndImagesReview = new BriefAndImages { Dock = DockStyle.Fill }; |
57 | 57 |
BriefAndImages briefAndImagesValidation = new BriefAndImages { Dock = DockStyle.Fill }; |
58 | 58 |
|
59 |
Telerik.WinControls.RadControlSpy.RadControlSpyForm radControlSpyForm = new Telerik.WinControls.RadControlSpy.RadControlSpyForm(); |
|
59 | 60 |
private readonly Color _SummaryColor = Color.FromArgb(255, 108, 55); |
60 | 61 |
|
61 | 62 |
public Main() |
... | ... | |
64 | 65 |
|
65 | 66 |
ID2.Manager.Common.Helpers.TableLayoutPanelHelper.SetDoubleBuffered(this); |
66 | 67 |
|
67 |
Telerik.WinControls.RadControlSpy.RadControlSpyForm radControlSpyForm = new Telerik.WinControls.RadControlSpy.RadControlSpyForm(); |
|
68 |
radControlSpyForm.Show(); |
|
69 |
|
|
70 | 68 |
this.FormClosing += Main_FormClosing; |
71 | 69 |
this.radButtonElementRefreshCommand.Click += RadButtonElementRefreshCommand_Click; |
72 | 70 |
this.radButtonElementSaveCommand.Click += RadButtonElementSaveCommand_Click; |
... | ... | |
149 | 147 |
|
150 | 148 |
protected override bool ProcessCmdKey(ref Message msg, Keys keyData) |
151 | 149 |
{ |
150 |
if (keyData == (Keys.F10 | Keys.Control)) |
|
151 |
{ |
|
152 |
radControlSpyForm.Show(); |
|
153 |
} |
|
154 |
|
|
152 | 155 |
if (keyData == (Keys.V | Keys.Control)) |
153 | 156 |
{ |
154 | 157 |
System.Diagnostics.Debug.WriteLine("KeyDown CTRL + V"); |
... | ... | |
217 | 220 |
}; |
218 | 221 |
|
219 | 222 |
doc.AttFiles.Add(newFile); |
223 |
|
|
224 |
var imageInfo = new AttImageInfo { ID = newFile.FileID, Data = newFile.FileData }; |
|
220 | 225 |
|
221 |
switch(category) |
|
226 |
switch (category)
|
|
222 | 227 |
{ |
223 | 228 |
case "toreview": |
224 |
briefAndImagesReview.AddToImage(newFile.FileData, true);
|
|
229 |
briefAndImagesReview.AddToImage(imageInfo, true);
|
|
225 | 230 |
break; |
226 | 231 |
case "frreview": |
227 |
briefAndImagesReview.AddFrImage(newFile.FileData, true);
|
|
232 |
briefAndImagesReview.AddFrImage(imageInfo, true);
|
|
228 | 233 |
break; |
229 | 234 |
case "prodvalidation": |
230 |
briefAndImagesValidation.AddToImage(newFile.FileData, true);
|
|
235 |
briefAndImagesValidation.AddToImage(imageInfo, true);
|
|
231 | 236 |
break; |
232 | 237 |
case "clientvalidation": |
233 |
briefAndImagesValidation.AddFrImage(newFile.FileData, true);
|
|
238 |
briefAndImagesValidation.AddFrImage(imageInfo, true);
|
|
234 | 239 |
break; |
235 | 240 |
} |
236 | 241 |
|
... | ... | |
348 | 353 |
{ |
349 | 354 |
if (doc.AttFiles.Count(x => x.Category == "toreview") > 0) |
350 | 355 |
{ |
351 |
var images = doc.AttFiles.Where(x => x.Category == "toreview").Select(x => x.FileData);
|
|
356 |
var images = doc.AttFiles.Where(x => x.Category == "toreview").Select(x =>new AttImageInfo { ID = x.FileID, Data = x.FileData });
|
|
352 | 357 |
briefAndImagesReview.SetToImages(images.ToList()); |
353 | 358 |
} |
354 | 359 |
|
355 | 360 |
if (doc.AttFiles.Count(x => x.Category == "frreview") > 0) |
356 | 361 |
{ |
357 |
var images = doc.AttFiles.Where(x => x.Category == "frreview").Select(x => x.FileData);
|
|
362 |
var images = doc.AttFiles.Where(x => x.Category == "frreview").Select(x => new AttImageInfo { ID = x.FileID, Data = x.FileData });
|
|
358 | 363 |
briefAndImagesReview.SetFrImages(images.ToList()); |
359 | 364 |
} |
360 | 365 |
|
361 | 366 |
if (doc.AttFiles.Count(x => x.Category == "prodvalidation") > 0) |
362 | 367 |
{ |
363 |
var images = doc.AttFiles.Where(x => x.Category == "prodvalidation").Select(x => x.FileData);
|
|
368 |
var images = doc.AttFiles.Where(x => x.Category == "prodvalidation").Select(x => new AttImageInfo { ID = x.FileID, Data = x.FileData });
|
|
364 | 369 |
briefAndImagesValidation.SetToImages(images.ToList()); |
365 | 370 |
} |
366 | 371 |
|
367 | 372 |
if (doc.AttFiles.Count(x => x.Category == "clientvalidation") > 0) |
368 | 373 |
{ |
369 |
var images = doc.AttFiles.Where(x => x.Category == "clientvalidation").Select(x => x.FileData);
|
|
374 |
var images = doc.AttFiles.Where(x => x.Category == "clientvalidation").Select(x => new AttImageInfo { ID = x.FileID, Data = x.FileData });
|
|
370 | 375 |
briefAndImagesValidation.SetFrImages(images.ToList()); |
371 | 376 |
} |
372 | 377 |
} |
내보내기 Unified diff