Ejemplo n.º 1
0
        private void button_select_Click(object sender, EventArgs e)
        {
            string name = (string)(glb.Items[glb.SelectedIndex] as ImageListBox.ImageListBoxItem).Item;

            CWA.GlobalOptions.Lang = name;
            CWA.GlobalOptions.Save();
            TranslateBase.CurrentLangName = name;
            TranslateBase.ProceedLang();
            Fill();
        }
Ejemplo n.º 2
0
        static void Main()
        {
            string execDirectory = new FileInfo(Application.ExecutablePath).DirectoryName;

            // ---====  CREATING NECESSARY DIRECTORIES  ===---
            foreach (string s in NecessaryDirectrories.Select(p => p = execDirectory + p))
            {
                if (!Directory.Exists(s))
                {
                    Directory.CreateDirectory(s);
                }
            }

            // ---====  SETUP APPLICATION  ===---

            //    ==GlobalOptions==
            GlobalOptions.Filename      = execDirectory + "\\Options\\Options.xml";
            GlobalOptions.BuildFilename = execDirectory + "\\Options\\Build";
            GlobalOptions.Load();

            //    ==TranslateBase==
            TranslateBase.LangDirectory = execDirectory + "\\Options\\";
            TranslateBase.Init();
            TranslateBase.CurrentLangName = GlobalOptions.Lang;
            TranslateBase.ProceedLang();

            //    ==GlobalOptionsLogPolitics==
            GlobalOptionsLogPolitics.Filename  = execDirectory + "\\Options\\logPolitics.xml";
            GlobalOptionsLogPolitics.OutPutDir = execDirectory + "\\Logs\\";
            GlobalOptionsLogPolitics.Load();

            //    ==CommandLineParser==
            CommandLineParser.CommamndsFileName = execDirectory + "\\Options\\Commands.xml";
            CommandLineParser.Init();

            //    ==CurvePluginHandler==
            CurvePluginHandler.PluginDir = execDirectory + "\\Plugins\\";
            if (GlobalOptions.PreloadPlugins)
            {
                CurvePluginHandler.Init();
            }

            //    ==Association==
            //FileAssociation.DeleteAllAssociations();
            FileAssociation.PathToIcons   = execDirectory + "\\Lib\\IconSet.dll";
            FileAssociation.PathToProgram = execDirectory + "\\Plotter Control.exe";
            FileAssociation.DiscoverRegistryAccessibility();
            if (!GlobalOptions.IgnoreRegisterExtentions)
            {
                FileAssociation.AssociateAll();
            }

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


            // ---====  STARTING APPLICATION  ===---
            CommandLineParser.Parse(Environment.GetCommandLineArgs());


            // ---====  DELETING TEMPORARY DIRECTORY ===---
            try
            {
                foreach (string s in Directory.GetFiles(new FileInfo(Application.ExecutablePath).DirectoryName + "\\Temp"))
                {
                    File.Delete(s);
                }
                Directory.Delete(new FileInfo(Application.ExecutablePath).DirectoryName + "\\Temp");
            }
            catch { };
        }