Example #1
0
 public void ProcessCommand(string val, IYnote ynote)
 {
     foreach (var file in Directory.GetFiles(GlobalSettings.SettingsDir, "*.ys", SearchOption.AllDirectories))
     {
         if (Path.GetFileName(file) == val + ".ys")
         {
             YnoteScript.RunScript(ynote, file);
         }
     }
 }
Example #2
0
 /// <summary>
 ///     Runs the Script
 /// </summary>
 public void Run()
 {
     foreach (var task in Tasks)
     {
         string ys = GlobalSettings.SettingsDir + task.Key + ".runtask";
         // expand all abbreviations eg - $source_path, $project_path
         for (int i = 0; i < task.Value.Length; i++)
         {
             task.Value[i] = Globals.ExpandAbbr(task.Value[i], Globals.Ynote);
         }
         YnoteScript.InvokeScript(ys, "*.RunTask", task.Value, Globals.Ynote);
     }
 }
Example #3
0
 private static ICommand GetCommand(string script, IYnote ynote)
 {
     try
     {
         return(YnoteScript.Get <ICommand>(ynote, script, "*.GetCommand"));
     }
     catch (Exception ex)
     {
         MessageBox.Show("There was an Error running the script : \r\n" + ex.Message, "YnoteScript Host",
                         MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         return(null);
     }
 }
Example #4
0
        /// <summary>
        /// Builds Context Menu
        /// </summary>
        private void BuildContextMenu()
        {
            string file = GlobalSettings.SettingsDir + "ContextMenu.ysr";

            contextmenu.MenuItems.AddRange(YnoteScript.Get <MenuItem[]>(codebox, file, "*.BuildContextMenu"));
        }