コード例 #1
0
 static void Main(string[] args)
 {
     if (args[1] == "true")
     {
         Application.EnableVisualStyles();
         Application.Run(new ProfileSelector(args[0]));
     }
     else
     {
         if (args[0] == "null")
         {
             args[0] = "";
         }
         using (CodeCompiler compiler = new CodeCompiler(args[0] + "\\Bots\\SmartCC\\Profiles\\Defaut\\", args[0]))
         {
             if (compiler.Compile())
             {
             }
         }
         String path = args[0] + "\\Bots\\SmartCC\\Profile.current";
         using (var stream = new FileStream(path, FileMode.Truncate))
         {
             using (var writer = new StreamWriter(stream))
             {
                 writer.WriteLine("Defaut");
                 writer.Close();
             }
         }
     }
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: jrgutier/SmartCC
        private void button1_Click(object sender, EventArgs e)
        {
            Console.OutputEncoding = Encoding.UTF8;
            using (CodeCompiler compiler = new CodeCompiler(BotDirectory + "Bots\\SmartCC\\Profiles\\" + comboBox1.SelectedItem.ToString() + "\\", BotDirectory))
            {
                if (compiler.Compile())
                {
                }
                else
                {
                }
            }
            Close();
            StreamWriter writer = new StreamWriter(BotDirectory + "Bots\\SmartCC\\Profile.current");

            writer.WriteLine(comboBox1.SelectedItem.ToString().Substring(1));
            writer.Close();
        }
コード例 #3
0
ファイル: DebugForm.cs プロジェクト: jrgutier/SmartCC
        public DebugForm()
        {
            InitializeComponent();
            CardTemplate.DatabasePath = System.IO.Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]) + "/";
            CardTemplate.LoadAll();

            StreamReader str = new StreamReader(CardTemplate.DatabasePath + "Bots/SmartCC/Config/useProfiles");
            string useDefaut = str.ReadLine();

            str.Close();

            if (useDefaut == "true")
            {
                Application.EnableVisualStyles();
                Application.Run(new ProfileSelector(CardTemplate.DatabasePath));
            }
            else
            {

                using (CodeCompiler compiler = new CodeCompiler(CardTemplate.DatabasePath + "\\Bots\\SmartCC\\Profiles\\Defaut\\", CardTemplate.DatabasePath))
                {
                    if (compiler.Compile())
                    {
                    }
                }
                String path = CardTemplate.DatabasePath + "\\Bots\\SmartCC\\Profile.current";
                using (var stream = new FileStream(path, FileMode.Truncate))
                {
                    using (var writer = new StreamWriter(stream))
                    {
                        writer.WriteLine("Defaut");
                        writer.Close();

                    }
                }

            }

            s = new Simulation();
        }
コード例 #4
0
ファイル: ProfileSelector.cs プロジェクト: jrgutier/SmartCC
 private void button1_Click(object sender, EventArgs e)
 {
     if (comboBoxProfiles.Text != "")
     {
         using (CodeCompiler compiler = new CodeCompiler(BotDirectory + "" + Path.DirectorySeparatorChar + "Bots" + Path.DirectorySeparatorChar + "SmartCC" + Path.DirectorySeparatorChar + "Profiles" + Path.DirectorySeparatorChar + "" + comboBoxProfiles.SelectedItem.ToString() + Path.DirectorySeparatorChar, BotDirectory))
         {
             if (compiler.Compile())
             {
             }
             else
             {
             }
         }
         Close();
         StreamWriter writer = new StreamWriter(BotDirectory + "" + Path.DirectorySeparatorChar + "Bots" + Path.DirectorySeparatorChar + "SmartCC" + Path.DirectorySeparatorChar + "Profile.current");
         writer.WriteLine(comboBoxProfiles.SelectedItem.ToString().Substring(1));
         writer.Close();
     }
     else
     {
         MessageBox.Show("Error: you didn't select a profile from the list", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }