Horizon – Blame information for rev 12
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
12 | office | 1 | using System; |
2 | using System.Collections.Generic; |
||
3 | using System.ComponentModel; |
||
4 | using System.Drawing; |
||
5 | using System.Drawing.Imaging; |
||
6 | using System.Globalization; |
||
7 | using System.IO; |
||
8 | using System.Linq; |
||
9 | using System.Runtime.InteropServices; |
||
10 | using System.Text; |
||
11 | using System.Threading.Tasks; |
||
12 | using Org.BouncyCastle.Utilities; |
||
13 | |||
14 | namespace Horizon.Snapshots |
||
15 | { |
||
16 | public class TransferSnapshot |
||
17 | { |
||
18 | private DateTime _time; |
||
19 | |||
20 | public string Note { get; set; } |
||
21 | public byte[] Data { get; set; } |
||
22 | |||
23 | public int Color { get; set; } |
||
24 | |||
25 | public string Name { get; set; } |
||
26 | |||
27 | public string Path { get; set; } |
||
28 | |||
29 | public string Time |
||
30 | { |
||
31 | get => _time.ToString(CultureInfo.InvariantCulture); |
||
32 | set |
||
33 | { |
||
34 | if (DateTime.TryParse(value, out var dateTime)) |
||
35 | { |
||
36 | _time = dateTime; |
||
37 | } |
||
38 | } |
||
39 | } |
||
40 | |||
41 | public byte[] Shot { get; set; } |
||
42 | |||
43 | public string Hash { get; set; } |
||
44 | |||
45 | public TransferSnapshot() |
||
46 | { |
||
47 | |||
48 | } |
||
49 | |||
50 | public TransferSnapshot(string name, string path, string time, string hash, Color color, Bitmap shot, string note, byte[] data) |
||
51 | { |
||
52 | Name = name; |
||
53 | Path = path; |
||
54 | Time = time; |
||
55 | Hash = hash; |
||
56 | |||
57 | Color = color.ToArgb(); |
||
58 | |||
59 | using (var memoryStream = new MemoryStream()) |
||
60 | { |
||
61 | shot.Save(memoryStream, ImageFormat.Bmp); |
||
62 | memoryStream.Position = 0L; |
||
63 | Shot = memoryStream.ToArray(); |
||
64 | } |
||
65 | |||
66 | Note = note; |
||
67 | Data = data; |
||
68 | } |
||
69 | } |
||
70 | } |