markus / MarkupToPDF / Controls / Parsing / MarkupCopy.cs @ 036650a0
이력 | 보기 | 이력해설 | 다운로드 (1.68 KB)
1 |
using System; |
---|---|
2 |
using System.Net; |
3 |
using System.Windows; |
4 |
using System.Windows.Controls; |
5 |
using System.Windows.Documents; |
6 |
using System.Windows.Ink; |
7 |
using System.Windows.Input; |
8 |
using System.Windows.Media; |
9 |
using System.Windows.Media.Animation; |
10 |
using System.Windows.Shapes; |
11 |
using MarkupToPDF.Controls; |
12 |
using MarkupToPDF.Controls.Line; |
13 |
using MarkupToPDF.Controls.Shape; |
14 |
using MarkupToPDF.Controls.Polygon; |
15 |
using MarkupToPDF.Controls.Text; |
16 |
using MarkupToPDF.Controls.Etc; |
17 |
using MarkupToPDF.Controls.Common.ValueConverter; |
18 |
using MarkupToPDF.Serialize.S_Control; |
19 |
using MarkupToPDF.Serialize.Core; |
20 |
using System.Collections.Generic; |
21 |
using System.Collections.ObjectModel; |
22 |
using System.Text; |
23 |
using MarkupToPDF.Controls.Common; |
24 |
using MarkupToPDF.Common; |
25 |
using MarkupToPDF.Controls.Cad; |
26 |
|
27 |
namespace MarkupToPDF.Controls.Parsing |
28 |
{ |
29 |
public partial class LayerControl : Control |
30 |
{ |
31 |
//GUID생성 |
32 |
//안쓰는 내용 |
33 |
public Guid GetUniqueGuid() |
34 |
{ |
35 |
char[] chars = "ABCDEF1234567890".ToCharArray(); |
36 |
byte[] data = new byte[1]; |
37 |
System.Security.Cryptography.RNGCryptoServiceProvider crypto = new System.Security.Cryptography.RNGCryptoServiceProvider(); |
38 |
crypto.GetNonZeroBytes(data); |
39 |
data = new byte[32]; |
40 |
crypto.GetNonZeroBytes(data); |
41 |
StringBuilder result = new StringBuilder(32); |
42 |
|
43 |
foreach (byte b in data) |
44 |
{ |
45 |
result.Append(chars[b % (chars.Length - 1)]); |
46 |
} |
47 |
|
48 |
return Guid.ParseExact(result.ToString(0, 8) + "-" + result.ToString(8, 4) + "-" + result.ToString(11, 4) + "-" |
49 |
+ result.ToString(16, 4) + "-" + result.ToString(20, 12), "D"); |
50 |
} |
51 |
} |
52 |
} |