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