public ModuleEditorControl CreateNewEditor(IList <Module> modules) { var editor = new TracksEditor(); editor.SaveCommand = new AddNewModuleCommand(modules, editor.ModifiedTracks); return(editor); }
public ModuleEditorControl CreateEditor(Module module) { if (!IsValidModule(module)) { throw new ArgumentException("Invalid module"); } var editor = new TracksEditor(); Tracks targetTracks = module as Tracks; editor.Tracks = targetTracks; editor.SaveCommand = new SaveEdittedModuleCommand <Tracks>(targetTracks, editor.ModifiedTracks); return(editor); }