Esempio n. 1
0
 public LanguageInfo(string sName, MyFontInfo NT, MyFontInfo Lex, MyFontInfo Gloss, bool fRTL, string cDecomp)
 {
     m_sLanguageName = sName;
     m_mfiNT         = NT;
     m_mfiLex        = Lex;
     m_mfiGloss      = Gloss;
     m_fUseRTL       = fRTL;
     m_cDecompChar   = cDecomp;
 }
Esempio n. 2
0
 public LanguageInfo(string sName, MyFontInfo NT, MyFontInfo Lex, MyFontInfo Gloss, bool fRTL, string cDecomp)
 {
     m_sLanguageName = sName;
     m_mfiNT = NT;
     m_mfiLex = Lex;
     m_mfiGloss = Gloss;
     m_fUseRTL = fRTL;
     m_cDecompChar = cDecomp;
 }
Esempio n. 3
0
        void doFont(ref MyFontInfo mfi, Label lbl)
        {
            FontDialog fontdlg = new FontDialog();

            fontdlg.ShowEffects = true;
            fontdlg.ShowColor   = true;
            fontdlg.Font        = mfi.Font;
            fontdlg.Color       = mfi.Color;
            if (fontdlg.ShowDialog() == DialogResult.OK)
            {
                // set the values
                mfi.Font  = fontdlg.Font;
                mfi.Color = fontdlg.Color;
                lbl.Text  = mfi.Font.Name;
            }
        }
Esempio n. 4
0
        public void LoadInfo(string sFileName)
        {
            XmlDocument doc = new XmlDocument();

            doc.Load(sFileName);
            LanguageName = GetNodeContent("LanguageInfo/LanguageName", doc);

            LexColorName = GetNodeContent("LanguageInfo/LexColorName", doc);
            LexFontFace  = GetNodeContent("LanguageInfo/LexFontFace", doc);
            LexFontSize  = (float)Convert.ToDouble(GetNodeContent("LanguageInfo/LexFontSize", doc));
            LexFontStyle = GetFontStyle("LanguageInfo/LexFontFace", doc);
            m_mfiLex     = new MyFontInfo(LexFontFace, LexFontSize, LexFontStyle, LexColorName);

            NTColorName = GetNodeContent("LanguageInfo/NTColorName", doc);
            NTFontFace  = GetNodeContent("LanguageInfo/NTFontFace", doc);
            NTFontSize  = (float)Convert.ToDouble(GetNodeContent("LanguageInfo/NTFontSize", doc));
            NTFontStyle = GetFontStyle("LanguageInfo/NTFontFace", doc);
            m_mfiNT     = new MyFontInfo(NTFontFace, NTFontSize, NTFontStyle, NTColorName);

            GlossColorName = GetNodeContent("LanguageInfo/GlossColorName", doc);
            GlossFontFace  = GetNodeContent("LanguageInfo/GlossFontFace", doc);
            GlossFontSize  = (float)Convert.ToDouble(GetNodeContent("LanguageInfo/GlossFontSize", doc));
            GlossFontStyle = GetFontStyle("LanguageInfo/GlossFontFace", doc);
            m_mfiGloss     = new MyFontInfo(GlossFontFace, GlossFontSize, GlossFontStyle, GlossColorName);

            DecompChar = GetNodeContent("LanguageInfo/DecompChar", doc);
            string s = GetNodeContent("LanguageInfo/UseRTL", doc);

            if (s == "true")
            {
                UseRTL = true;
            }
            else
            {
                UseRTL = false;
            }

            // did not work and I don't know why
            //XmlSerializer mySerializer = new XmlSerializer(m_language.GetType());
            //StreamReader myReader = new StreamReader(sFileName);
            //LanguageInfo lang = new LanguageInfo();
            //lang = (LanguageInfo)mySerializer.Deserialize(myReader);
            //myReader.Close();
        }
Esempio n. 5
0
        private void btnGlossFont_Click(object sender, System.EventArgs e)
        {
            MyFontInfo mfi = m_language.GlossInfo;

            doFont(ref mfi, lblGlossFont);
        }
Esempio n. 6
0
        private void btnLexFont_Click(object sender, System.EventArgs e)
        {
            MyFontInfo mfi = m_language.LexInfo;

            doFont(ref mfi, lblLexFont);
        }
Esempio n. 7
0
        public void LoadInfo(string sFileName)
        {
            XmlDocument doc = new XmlDocument();
            doc.Load(sFileName);
            LanguageName = GetNodeContent("LanguageInfo/LanguageName", doc);

            LexColorName = GetNodeContent("LanguageInfo/LexColorName", doc);
            LexFontFace = GetNodeContent("LanguageInfo/LexFontFace", doc);
            LexFontSize = (float)Convert.ToDouble(GetNodeContent("LanguageInfo/LexFontSize", doc));
            LexFontStyle = GetFontStyle("LanguageInfo/LexFontFace", doc);
            m_mfiLex = new MyFontInfo(LexFontFace, LexFontSize, LexFontStyle, LexColorName);

            NTColorName = GetNodeContent("LanguageInfo/NTColorName", doc);
            NTFontFace = GetNodeContent("LanguageInfo/NTFontFace", doc);
            NTFontSize = (float)Convert.ToDouble(GetNodeContent("LanguageInfo/NTFontSize", doc));
            NTFontStyle = GetFontStyle("LanguageInfo/NTFontFace", doc);
            m_mfiNT = new MyFontInfo(NTFontFace, NTFontSize, NTFontStyle, NTColorName);

            GlossColorName = GetNodeContent("LanguageInfo/GlossColorName", doc);
            GlossFontFace = GetNodeContent("LanguageInfo/GlossFontFace", doc);
            GlossFontSize = (float)Convert.ToDouble(GetNodeContent("LanguageInfo/GlossFontSize", doc));
            GlossFontStyle = GetFontStyle("LanguageInfo/GlossFontFace", doc);
            m_mfiGloss = new MyFontInfo(GlossFontFace, GlossFontSize, GlossFontStyle, GlossColorName);

            DecompChar = GetNodeContent("LanguageInfo/DecompChar", doc);
            string s = GetNodeContent("LanguageInfo/UseRTL", doc);
            if (s == "true")
                UseRTL = true;
            else
                UseRTL = false;

            // did not work and I don't know why
            //XmlSerializer mySerializer = new XmlSerializer(m_language.GetType());
            //StreamReader myReader = new StreamReader(sFileName);
            //LanguageInfo lang = new LanguageInfo();
            //lang = (LanguageInfo)mySerializer.Deserialize(myReader);
            //myReader.Close();
        }
Esempio n. 8
0
        private void InitLanguageInfo()
        {
            MyFontInfo nt = new MyFontInfo(new Font("Times New Roman", 14.0f), Color.Black);
            MyFontInfo lex = new MyFontInfo(new Font("Courier New", 12.0f), Color.Blue);
            MyFontInfo gloss = new MyFontInfo(new Font("Times New Roman", 12.0f), Color.Green);
            m_language = new LanguageInfo("Default Language", nt, lex, gloss, false, "-");

            RetrieveRegistryInfo();
        }
Esempio n. 9
0
 void doFont(ref MyFontInfo mfi, Label lbl)
 {
     FontDialog fontdlg = new FontDialog();
     fontdlg.ShowEffects = true;
     fontdlg.ShowColor = true;
     fontdlg.Font = mfi.Font;
     fontdlg.Color = mfi.Color;
     if (fontdlg.ShowDialog() == DialogResult.OK)
     {
         // set the values
         mfi.Font = fontdlg.Font;
         mfi.Color = fontdlg.Color;
         lbl.Text = mfi.Font.Name;
     }
 }