Esempio n. 1
0
 /// <summary>
 /// reaction for click on menu -> file -> change name
 /// </summary>
 private void menu_file_name_Click(object sender, EventArgs e)
 {
     this.Enabled = false;
     Peulot_Heshbon.Classes.PersonName pn = new Peulot_Heshbon.Classes.PersonName();
     Code.AskName.ShowForm(ref pn);
     Program.name = pn;
     this.Enabled = true;
 }
Esempio n. 2
0
        private static void Main()
        {
            #region Form Build

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            #endregion Form Build

            // checkes if the computer has the register / settings file
            // if true, then start register process
            // if false, then start normaly
            if (!Register.Start.IsRegistered(PropertiesPath))
            {
                StartRegisterProcess();
            }
            else
            {
                if (File.Exists(Program.ExePath + @"\Languages.dll"))
                {
                    #region normal start

                    Register.Start.Set(PropertiesPath);
                    CreateFiles();

                    Languages.Convertor.ReadConvertedLanguageFile();
                    if(File.Exists(Code.Files.PreferrenceFile.TheFile)) Code.Files.PreferrenceFile.Set();

                    if (!Register.Start.Properties.RememberName)
                    {
                        Peulot_Heshbon.Classes.PersonName pn = new Peulot_Heshbon.Classes.PersonName();
                        Code.AskName.ShowForm(ref pn);
                        name = pn;
                    }
                    else
                        name = Register.Start.Properties.name;
                    Application.Run(new main());

                    foreach (string s in list)
                        Console.WriteLine(s);

                    #endregion normal start
                }
                else
                {
                    Languages.Zip.CreateFile(Program.ExePath + @"\Languages.dll");
                    if (Register.Start.ChooseLanguage() != DialogResult.Cancel)
                    {
                        File.SetAttributes(Program.PropertiesPath, FileAttributes.Normal);
                        Peulot_Heshbon.Classes.Properties.WriteFile(Program.PropertiesPath, Register.Start.Properties);
                        File.SetAttributes(Program.PropertiesPath, FileAttributes.Hidden | FileAttributes.ReadOnly);
                        Application.Restart();
                    }
                }
            }
        }