예제 #1
0
        public static void CreateScript(string Name, string Code, params Arg[] Args)
        {
            var FinalCode = Code + @"
namespace Script
{
    public static class Args
    {
";

            foreach (Arg a in Args)
            {
                Rc.saveData(a.XML, "ScriptData/" + a.ArgName);
                FinalCode += @"
        public static " + a.type + " " + a.ArgName + @"
        {
        get
            {
            return LoadFromXMLString<" + a.type + ">(loadData(" + Rc.loadData("ScriptData/DoubleQuortation") + "ScriptData/" + a.ArgName + Rc.loadData("ScriptData/DoubleQuortation") + @"));
            }
        }
";
            }
            FinalCode += add + @"
    }
}";
            Console.WriteLine(@"Compile code : 
" + FinalCode);
            Rc.saveData(FinalCode, "Scripts/" + Name + ".cs");
            Compile("Scripts/" + Name);
        }
예제 #2
0
 private void openOToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         this.textBox1.Text = Rc.loadData(openFileDialog1.FileName);
         EditingPath        = openFileDialog1.FileName;
     }
 }
예제 #3
0
        public static Dictionary <string, ExtendedOAuthTokens> Read(string path)
        {
            if (!File.Exists(path))
            {
                new FileInfo(path).Directory.Create();
                File.Create(path).Dispose();
            }
            var d    = new Dictionary <string, ExtendedOAuthTokens>();
            var read = Rc.CutString(";", Rc.loadData(path));

            foreach (var s in read)
            {
                var add = new ExtendedOAuthTokens().Create(Rc.CutString(",", s)[1], Rc.CutString(",", s)[2], Rc.CutString(",", s)[0]);
                d[Rc.CutString(",", s)[0]] = add;
            }
            return(d);
        }
예제 #4
0
        public static bool CreateScript(string Name, string Code, params Arg[] Args)
        {
            var FinalCode = Code + @"
namespace Script
{
    public static class Args
    {
        public static void Return<T>(T Arg)
        {
            SaveToXML(((object)Arg)," + Rc.loadData("ScriptData/DoubleQuortation") + "Scripts/" + Name + Rc.loadData("ScriptData/DoubleQuortation") + @");
        }
";

            foreach (Arg a in Args)
            {
                Rc.saveData(a.XML, "ScriptData/" + a.ArgName);
                FinalCode += @"
        public static " + a.type + " " + a.ArgName + @"
        {
        get
            {
            return LoadFromXMLString<" + a.type + ">(loadData(" + Rc.loadData("ScriptData/DoubleQuortation") + "ScriptData/" + a.ArgName + Rc.loadData("ScriptData/DoubleQuortation") + @"));
            }
        }
";
            }
            FinalCode += add + @"
    }
}";
            if (Rc.loadData("Scripts/" + Name + ".cs") != FinalCode)
            {
                Rc.saveData(FinalCode, "Scripts/" + Name + ".cs");
                return(Compile("Scripts/" + Name));
            }
            else
            {
                return(true);
            }
        }