Ejemplo n.º 1
0
        private void selectascript_Click(object sender, EventArgs e)
        {
            openFileDialog2.Filter = "Javascript|*.js|All Files|*.*";
            DialogResult result = openFileDialog2.ShowDialog();

            if (result == DialogResult.OK)
            {
                string file = openFileDialog2.FileName;
                mainWindow.aScripts.SetPathToAuxiliaryScript(mainWindow.GetURI(), file);
                mainWindow.aScripts.Save();
                MessageBox.Show("Reload a package that changes have come into force.", "All OK", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 2
0
        public void L(string mainScript)
        {
            if (!mainWindow.aScripts.HasAuxiliaryScript(mainScript))
            {
                return;
            }
            string ascriptpath = mainWindow.aScripts.GetAuxiliaryScriptPath(mainScript);

            if (!File.Exists(ascriptpath))
            {
                mainWindow.ERR("Auxiliary file " + ascriptpath + " not found!");
                mainWindow.ui.Load(mainWindow.GetURI());
                this.lastUrl = ascriptpath;
                return;
            }
            string ascript = File.ReadAllText(ascriptpath);

            File.WriteAllText(mainWindow.pathToTempAS, Properties.Resources._as + ascript);
            this.lastUrl = ascriptpath;
            this.browser.Load(mainWindow.pathToTempIAS);
        }