Example #1
0
        /**
         * MakeFormattedText
         */
        private FormattedText MakeFormattedText(string text, Brush foreground)
        {
            FormattedText ret = null;

            ApplicationConfigValues values = ApplicationConfig.GetInstance().GetValues();

            ret = new FormattedText(((text == null) ? "" : text),
                                    CultureInfo.CurrentUICulture, FlowDirection.LeftToRight,
                                    new Typeface(values.FontName), values.FontSize,
                                    ((foreground == null) ? Brushes.White : foreground));

            return(ret);
        }
Example #2
0
        /**
         * Init
         */
        public void Init()
        {
            string basePath = ApplicationPaths.GetApplicationPath();

            configPath = basePath + "\\fmps_settings.xml";
            FileInfo config = new FileInfo(configPath);

            if (config.Exists == true)
            {
                StreamReader  reader     = new StreamReader(configPath, new UTF8Encoding(false));
                XmlSerializer serializer = new XmlSerializer(typeof(ApplicationConfigValues));
                values = (ApplicationConfigValues)serializer.Deserialize(reader);
                reader.Close();
            }
        }