프로젝트

일반

사용자정보

통계
| 브랜치(Branch): | 개정판:

markus / KCOM / Common / InitData.cs @ 285635d3

이력 | 보기 | 이력해설 | 다운로드 (2.42 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 1ba2b03d ljiyeon
8 787a4489 KangIngu
namespace KCOM.Views
9
{
10
    public class DashStyle
11
    {
12
        public DoubleCollection dashData { get; set; }
13
    }
14
15
    public partial class TopMenu : UserControl
16
    {
17
        public List<DashStyle> dashSet;
18
19
        public void InitDataSet()
20
        {
21 e0cfc73c ljiyeon
            App.splashString(ISplashMessage.INITDATA);
22 787a4489 KangIngu
            dashSet = new List<DashStyle>()
23
            {
24
                new DashStyle { dashData = new DoubleCollection{999999}},
25
                new DashStyle { dashData = new DoubleCollection{2,2}},
26
                new DashStyle { dashData = new DoubleCollection{4,4}},
27
                new DashStyle { dashData = new DoubleCollection{8,8}},
28
                new DashStyle { dashData = new DoubleCollection{20,0,0, 5,1.1,5}},
29
                new DashStyle { dashData = new DoubleCollection{10,10}},
30
                new DashStyle { dashData = new DoubleCollection{15,15}},
31
                new DashStyle { dashData = new DoubleCollection{15,3,3,0,3,3}},
32
                new DashStyle { dashData = new DoubleCollection{15,3,3,3,3,3}},
33
            };
34
            cbDashStyle.ItemsSource = dashSet.ToList();
35 1ba2b03d ljiyeon
36 78d91584 ljiyeon
            List<string> fontList = new List<string>();
37
            fontList.Add("Arial");
38
            fontList.Add("Calibri (Body)");
39
            fontList.Add("Tahoma");
40
            fontList.Add("Verdana");
41
            fontList.Add("Times New Roman");
42
            fontList.Add("Cambria");
43
            //fontList.Add("나눔바른펜");
44
            List<string> fontSet = new List<string>();
45
            foreach (var font in fontList)
46 1ba2b03d ljiyeon
            {
47 78d91584 ljiyeon
                if (IsFontInstalled(font))
48
                {
49
                    fontSet.Add(font.ToString());
50
                }
51
            }
52 1ba2b03d ljiyeon
            comboFontFamily.ItemsSource = fontSet.ToList();
53 78d91584 ljiyeon
        }        
54 1ba2b03d ljiyeon
        
55
        /// <summary>
56
        /// 폰트 설치 여부 구하기
57
        /// </summary>
58
        public bool IsFontInstalled(string fontName)
59
        {
60
            InstalledFontCollection collection = new InstalledFontCollection();
61 78d91584 ljiyeon
            foreach (System.Drawing.FontFamily fontFamily in collection.Families)
62 1ba2b03d ljiyeon
            {
63 78d91584 ljiyeon
                if (fontFamily.Name.Equals(fontName))
64 1ba2b03d ljiyeon
                {
65
                    return true;
66
                }
67
            }
68
            return false;
69 78d91584 ljiyeon
        }        
70 1ba2b03d ljiyeon
    }    
71 787a4489 KangIngu
}
클립보드 이미지 추가 (최대 크기: 500 MB)