예제 #1
0
        public ModuleEditorControl CreateNewEditor(IList <Module> modules)
        {
            var editor = new GunEditor();

            editor.SaveCommand = new AddNewModuleCommand(modules, editor.ModifiedGun);

            return(editor);
        }
예제 #2
0
        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);
        }