Пример #1
0
        public settingsWindow()
        {
            InitializeComponent();
            fileDialog_gtaSaExe.Filter = "Exe Files|*.exe";
            string gtaPath = ConfigFile.GetUserConfig("gtapath");

            if (gtaPath.Length == 0)
            {
                txtBox_gtaPath.Text = GTAUtils.GetGTADir();
            }
            else
            {
                txtBox_gtaPath.Text = gtaPath;
            }

            txtBox_setNick.Text = ConfigFile.GetUserConfig("defaultnick");
        }
Пример #2
0
        public static bool CreateDefaultConfigFile(string path)
        {
            try
            {
                XDocument doc = new XDocument(
                    new XDeclaration("1.0", "utf-8", "yes"),
                    new XComment("Launcher configuration file"),
                    new XElement("configuration",
                                 new XElement("user",
                                              new XElement("defaultnick", ""),
                                              new XElement("gtapath", GTAUtils.GetGTADir()))),
                    new XElement("sampdll"));

                doc.Save(path);

                return(false);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }