markus / KCOM / Common / InitData.cs @ 3dbace4e
이력 | 보기 | 이력해설 | 다운로드 (2.99 KB)
1 | 78d91584 | ljiyeon | using System.Collections.Generic; |
---|---|---|---|
2 | 787a4489 | KangIngu | using System.Linq; |
3 | using System.Windows.Controls; |
||
4 | using System.Windows.Media; |
||
5 | 1ba2b03d | ljiyeon | using System.Drawing.Text; |
6 | e0cfc73c | ljiyeon | using KCOM.Common; |
7 | 24c5e56c | taeseongkim | using Markus.Fonts; |
8 | 1ba2b03d | ljiyeon | |
9 | 787a4489 | KangIngu | namespace KCOM.Views |
10 | { |
||
11 | public class DashStyle |
||
12 | { |
||
13 | public DoubleCollection dashData { get; set; } |
||
14 | } |
||
15 | |||
16 | public partial class TopMenu : UserControl |
||
17 | { |
||
18 | public List<DashStyle> dashSet; |
||
19 | |||
20 | public void InitDataSet() |
||
21 | { |
||
22 | e0cfc73c | ljiyeon | App.splashString(ISplashMessage.INITDATA); |
23 | 787a4489 | KangIngu | dashSet = new List<DashStyle>() |
24 | { |
||
25 | new DashStyle { dashData = new DoubleCollection{999999}}, |
||
26 | new DashStyle { dashData = new DoubleCollection{2,2}}, |
||
27 | new DashStyle { dashData = new DoubleCollection{4,4}}, |
||
28 | new DashStyle { dashData = new DoubleCollection{8,8}}, |
||
29 | new DashStyle { dashData = new DoubleCollection{20,0,0, 5,1.1,5}}, |
||
30 | new DashStyle { dashData = new DoubleCollection{10,10}}, |
||
31 | new DashStyle { dashData = new DoubleCollection{15,15}}, |
||
32 | new DashStyle { dashData = new DoubleCollection{15,3,3,0,3,3}}, |
||
33 | new DashStyle { dashData = new DoubleCollection{15,3,3,3,3,3}}, |
||
34 | }; |
||
35 | cbDashStyle.ItemsSource = dashSet.ToList(); |
||
36 | 1ba2b03d | ljiyeon | |
37 | 24c5e56c | taeseongkim | //List<string> fontList = new List<string>(); |
38 | //fontList.Add("Arial"); |
||
39 | ////fontList.Add("Calibri (Body)"); |
||
40 | ////fontList.Add("Tahoma"); |
||
41 | //fontList.Add("Verdana"); |
||
42 | //fontList.Add("Times New Roman"); |
||
43 | //fontList.Add("Cambria"); |
||
44 | ////fontList.Add("나눔바른펜"); |
||
45 | //List<string> fontSet = new List<string>(); |
||
46 | //foreach (var font in fontList) |
||
47 | //{ |
||
48 | // if (IsFontInstalled(font)) |
||
49 | // { |
||
50 | // fontSet.Add(font.ToString()); |
||
51 | // } |
||
52 | //} |
||
53 | var fontsItems = Markus.Fonts.FontDictionary.GetMarkusFonts(); |
||
54 | comboFontFamily.ItemsSource = fontsItems; |
||
55 | c5519c44 | taeseongkim | |
56 | 24c5e56c | taeseongkim | comboFontFamily.SelectedItem = fontsItems.FirstOrDefault(x => x.IsDefault); |
57 | c206d293 | taeseongkim | } |
58 | |||
59 | public void SetFont(FontFamily fontFamily) |
||
60 | { |
||
61 | foreach (var item in comboFontFamily.Items) |
||
62 | { |
||
63 | 24c5e56c | taeseongkim | if((item as Markus.Fonts.MarkusFont).FontFamily.FontName() == fontFamily.FontName()) |
64 | c206d293 | taeseongkim | { |
65 | comboFontFamily.SelectedItem = item; |
||
66 | return; |
||
67 | } |
||
68 | } |
||
69 | } |
||
70 | 1ba2b03d | ljiyeon | |
71 | /// <summary> |
||
72 | /// 폰트 설치 여부 구하기 |
||
73 | /// </summary> |
||
74 | public bool IsFontInstalled(string fontName) |
||
75 | { |
||
76 | InstalledFontCollection collection = new InstalledFontCollection(); |
||
77 | 78d91584 | ljiyeon | foreach (System.Drawing.FontFamily fontFamily in collection.Families) |
78 | 1ba2b03d | ljiyeon | { |
79 | 78d91584 | ljiyeon | if (fontFamily.Name.Equals(fontName)) |
80 | 1ba2b03d | ljiyeon | { |
81 | return true; |
||
82 | } |
||
83 | } |
||
84 | return false; |
||
85 | 78d91584 | ljiyeon | } |
86 | 1ba2b03d | ljiyeon | } |
87 | 787a4489 | KangIngu | } |