Пример #1
0
        /// <summary>
        /// Applies the given script file to the source image.
        /// </summary>
        /// <param name="fileName">Name of the file.</param>
        private void _ApplyScriptFile(string fileName)
        {
            var localEngine = new ScriptEngine();

            localEngine.AddWithoutExecution(new NullTransformCommand());
            ScriptSerializer.LoadFromFile(localEngine, fileName);
            this._ExecuteScriptActions(localEngine.Actions.ToArray());
        }
        private void loadToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var dialog = this.ofdOpenScript;

            if (dialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            var filename = dialog.FileName;

            this._scriptEngine.Clear();
            ScriptSerializer.LoadFromFile(this._scriptEngine, filename);
        }