private void Edit_Click(object sender, RoutedEventArgs e) { MenuItem mnu = sender as MenuItem; if (mnu != null) { ScriptletItem item = mnu.CommandParameter as ScriptletItem; if (item != null) { ScriptControl.Show(item.Filename); } } }
public static void Show(string file) { ScriptControl sc = null; try { sc = new ScriptControl(); ScriptletManager sm = new ScriptletManager(); sm.Editor = sc; EditorWindow.Show("Mission Studio", file, sc, sm, ImageHelper.ConvertBitmapToBitmapSource(Properties.Resources._1360035698_run)); sc = null; } finally { if (sc != null) { sc.Dispose(); } } }