Example #1
0
        private async void viewApiDumpClassic_Click(object sender, EventArgs e)
        {
            await lockWindowAndRunTask(async() =>
            {
                string branch      = getBranch();
                string apiFilePath = await getApiDumpFilePath(branch);
                string apiJson     = File.ReadAllText(apiFilePath);

                ReflectionDatabase api  = ReflectionDatabase.Load(apiJson);
                ReflectionDumper dumper = new ReflectionDumper(api);

                string result = dumper.Run();

                FileInfo info    = new FileInfo(apiFilePath);
                string directory = info.DirectoryName;

                string resultPath = Path.Combine(directory, branch + "-api-dump.txt");
                writeAndViewFile(resultPath, result);
            });
        }
Example #2
0
        public void getListFromDatabase(ReflectionDatabase db)
        {
            List <Hashtable> dbRes = db.lastResult;

            if (dbRes != null)
            {
                Boolean first = true;
                this.listView.Items.Clear();
                foreach (Hashtable row in dbRes)
                {
                    int          rowNr   = 0;
                    ListViewItem adLwItm = new ListViewItem();
                    foreach (DictionaryEntry line in row)
                    {
                        if (first)
                        {
                            this.listView.Columns.Add(line.Key.ToString());
                        }
                        string val = "";
                        if (line.Value != null)
                        {
                            val = line.Value.ToString();
                        }
                        if (rowNr == 0)
                        {
                            adLwItm.Text = val;
                        }
                        else
                        {
                            adLwItm.SubItems.Add(val);
                        }
                        rowNr++;
                    }
                    this.listView.Items.Add(adLwItm);
                    first = false;
                }
            }
        }
Example #3
0
        private async void compareVersions_Click(object sender, EventArgs e)
        {
            await lockWindowAndRunTask(async() =>
            {
                string newBranch   = getBranch();
                bool fetchPrevious = (newBranch == "roblox");

                string newApiFilePath = await getApiDumpFilePath(newBranch);
                string oldApiFilePath = await getApiDumpFilePath("roblox", fetchPrevious);

                setStatus("Reading the " + (fetchPrevious ? "Previous" : "Production") + " API...");
                string oldApiJson         = File.ReadAllText(oldApiFilePath);
                ReflectionDatabase oldApi = ReflectionDatabase.Load(oldApiJson);

                setStatus("Reading the " + (fetchPrevious ? "Production" : "New") + " API...");
                string newApiJson         = File.ReadAllText(newApiFilePath);
                ReflectionDatabase newApi = ReflectionDatabase.Load(newApiJson);

                setStatus("Comparing APIs...");
                ReflectionDiffer differ = new ReflectionDiffer();
                string result           = differ.CompareDatabases(oldApi, newApi);

                if (result.Length > 0)
                {
                    FileInfo info = new FileInfo(newApiFilePath);

                    string directory  = info.DirectoryName;
                    string resultPath = Path.Combine(directory, newBranch + "-diff.txt");

                    writeAndViewFile(resultPath, result);
                }
                else
                {
                    MessageBox.Show("No differences were found!", "Well, this is awkward...", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            });
        }