Пример #1
0
        public AppearanceList GetAppearance()
        {
            AppearanceList list = new AppearanceList();

            list.Add(new Appearance("Header", "Tahoma", 10f, FontStyle.Regular, Color.Black, Color.Transparent));
            list.Add(new Appearance("SubHeader", "Tahoma", 10f, FontStyle.Regular, Color.Black, Color.Transparent));
            list.Add(new Appearance("Data", "Tahoma", 10f, FontStyle.Regular, Color.Black, Color.Blue));
            list.Add(new Appearance("DataReadOnly", "Tahoma", 10f, FontStyle.Regular, Color.Black, Color.Transparent));

            return(list);
        }
Пример #2
0
        private static AppearanceList ConvertDataTableToAppearanceList(DataTable dtView)
        {
            AppearanceList list = new AppearanceList();

            for (int i = 0; i < dtView.Rows.Count; i++)
            {
                Appearance apr = new Appearance(
                    dtView.Rows[i]["Name"].ToString(),
                    dtView.Rows[i]["FontName"].ToString(),
                    Convert.ToSingle(dtView.Rows[i]["FontSize"]),
                    ConvertStringToFontStyle(dtView.Rows[i]["FontStyle"].ToString()),
                    ConvertStringToColor(dtView.Rows[i]["ForeColor"].ToString()),
                    ConvertStringToColor(dtView.Rows[i]["BackColor"].ToString())
                    );

                list.Add(apr);
            }
            return(list);
        }