Example #1
0
        //////////////////////////////////////////////////////////////////////////
        private void OnFormLoad(object sender, EventArgs e)
        {
            CmbInputCodepage.Items.Clear();
            CmbHtmlOutputCodepage.Items.Clear();

            EncodingInfo[] Encodings = Encoding.GetEncodings();
            foreach (EncodingInfo EI in Encodings)
            {
                CmbInputCodepage.Items.Add(EI.DisplayName);
                if (EI.GetEncoding() == Encoding.Default)
                {
                    CmbInputCodepage.SelectedItem = EI.DisplayName;
                }

                CmbHtmlOutputCodepage.Items.Add(EI.DisplayName);
                if (EI.GetEncoding() == Encoding.Default)
                {
                    CmbHtmlOutputCodepage.SelectedItem = EI.DisplayName;
                }
            }
            IsDirty = false;

            RegistryKey Key = Registry.CurrentUser.OpenSubKey(@"Software\DEAD:CODE\DocMaker2");

            if (Key != null)
            {
                string LastFile = Key.GetValue("LastFile").ToString();
                Key.Close();

                if (File.Exists(LastFile))
                {
                    LoadSettings(LastFile);
                }
            }
        }
Example #2
0
 //////////////////////////////////////////////////////////////////////////
 private static Encoding GetEncodingByName(string EncName)
 {
     EncodingInfo[] Encodings = Encoding.GetEncodings();
     foreach (EncodingInfo EI in Encodings)
     {
         if (EI.DisplayName == EncName)
         {
             return(EI.GetEncoding());
         }
     }
     return(Encoding.Default);
 }