public void Invoke(IEditor editor, ModuleEditorEventArgs e) { Log.Source.TraceInformation("Invoking {0} FileName='{1}'", ClassName, editor.FileName); Invoking(); ModuleEditor instance = (ModuleEditor)GetInstance(); instance.Invoke(editor, e); }
protected override void OnClick(EventArgs e) { base.OnClick(e); Editor editor; switch (EditorToOpen) { case "Text Editor": editor = new TextEditor(); break; case "Music Editor": editor = new MusicEditor(); break; case "Portrait Editor": editor = new PortraitEditor(); break; case "Map Sprite Editor": editor = new MapSpriteEditor(); break; case "Battle Animation Editor": editor = new BattleAnimEditor(); break; default: if (EditorToOpen != null && EditorToOpen.Length > 7 && EditorToOpen.Substring(0, 7) == "Module:") { string module = EditorToOpen.Substring(7, EditorToOpen.Length - 7); editor = new ModuleEditor(); ((ModuleEditor)editor).Core_OpenFile(Core.Path_Modules + module + ".emm"); } else { editor = null; } break; } if (editor != null) { Program.Core.Core_OpenEditor(editor); switch (EditorToOpen) { case "Text Editor": ((TextEditor)editor).Core_SetEntry((UInt16)EntryToSelect); break; case "Music Editor": ((MusicEditor)editor).Core_SetEntry((byte)EntryToSelect); break; case "Portrait Editor": ((PortraitEditor)editor).Core_SetEntry((UInt16)EntryToSelect); break; case "Map Sprite Editor": ((MapSpriteEditor)editor).Core_SetEntry((byte)EntryToSelect); break; case "Battle Animation Editor": ((BattleAnimEditor)editor).Core_SetEntry(EntryToSelect); break; default: ((ModuleEditor)editor).Core_SetEntry(EntryToSelect); break; } } }
/// <summary> /// Constructor /// </summary> /// <param name = "parent">ModuleEditor</param> /// <param name = "module">Document to bind</param> /// <param name = "avalon1">TextEditor</param> /// <param name = "avalon2">TextEditor</param> public ModuleDocument(IModule module, ModuleEditor parent, TextEditor avalon1, TextEditor avalon2) { try { this._parent = parent; this._editor1 = avalon1; this._editor2 = avalon2; this._module = module; this._module.Attach(this); this._col = new Label { Margin = new Thickness(0), Padding = new Thickness(0), FontSize = 12, Height = 28, Content = "0" }; this._length = new Label { Margin = new Thickness(0), Padding = new Thickness(0), FontSize = 12, Height = 28, Content = "0" }; this._lines = new Label { Margin = new Thickness(0), Padding = new Thickness(0), FontSize = 12, Height = 28, Content = "0" }; this._row = new Label { Margin = new Thickness(0), Padding = new Thickness(0), FontSize = 12, Height = 28, Content = "0" }; this._selection = new Label { Margin = new Thickness(0), Padding = new Thickness(0), FontSize = 12, Height = 28, Content = "0" }; this.SetUpLookAndFeel(); this.PrepareEditorContents(); this.LoadHighlighter(); this.SetHandlers(); this.Bind(); this.PrepareFoldingStrategy(); this._document.UndoStack = new UndoStack(); this._hashContents = this._document.Text.GetHashCode(); } catch (Exception error) { Framework.EventBus.Publish(error); } }