Exemplo n.º 1
0
        // TODO: Refactor dependency mess
        public SoundGeneratorViewModel(ISessionContextService sessionContext,
                                       IDialogService dialogService,
                                       IFoldersExplorerFactory <SoundEvent, Sound> factory,
                                       IPreferenceService preferenceService,
                                       ISoundJsonUpdaterFactory jsonUpdaterFactory,
                                       IEditorFormFactory <Sound> editorFormFactory,
                                       IUniqueValidator <SoundEvent> soundEventValidator,
                                       ICodeGenerationService codeGenerationService)
            : base(sessionContext, dialogService, factory)
        {
            Preferences = preferenceService.GetOrCreate <SoundsGeneratorPreferences>();

            PreferenceService     = preferenceService;
            JsonUpdaterFactory    = jsonUpdaterFactory;
            SoundEventValidator   = soundEventValidator;
            CodeGenerationService = codeGenerationService;

            Explorer.AllowFileExtensions(".ogg");
            Explorer.OpenFileDialog.Filter                = "Sound file (*.ogg) | *.ogg";
            Explorer.OpenFileDialog.Multiselect           = true;
            Explorer.OpenFileDialog.CheckFileExists       = true;
            Explorer.OpenFileDialog.ValidateNames         = true;
            Explorer.OpenFolderDialog.ShowNewFolderButton = true;

            FileEditor             = editorFormFactory.Create();
            FileEditor.ItemEdited += OnSoundEdited;
        }
 public SimpleInitViewModelBase(ISessionContextService sessionContext,
                                IEditorFormFactory <TModel> editorFormFactory,
                                IUniqueValidator <TModel> validator,
                                ICodeGenerationService codeGenerationService)
     : base(sessionContext)
 {
     Validator              = validator;
     CodeGenerationService  = codeGenerationService;
     EditorForm             = editorFormFactory.Create();
     EditorForm.ItemEdited += OnModelEdited;
     EditorForm.Validator   = validator;
 }
Exemplo n.º 3
0
 public ModGeneratorViewModel(ISessionContextService sessionContext,
                              IDialogService dialogService,
                              IFileSystem fileSystem,
                              IEditorFormFactory <McMod> editorFormFactory,
                              IValidator <McMod> modValidator,
                              ICodeGenerationService codeGenerationService,
                              ISerializer <McMod> modSerializer,
                              ISerializer <McModInfo> modInfoSerializer)
 {
     SessionContext        = sessionContext;
     DialogService         = dialogService;
     FileSystem            = fileSystem;
     EditorFormFactory     = editorFormFactory;
     ModValidator          = modValidator;
     CodeGenerationService = codeGenerationService;
     ModSerializer         = modSerializer;
     ModInfoSerializer     = modInfoSerializer;
     ResetNewMod();
     EditorForm             = editorFormFactory.Create();
     EditorForm.Validator   = modValidator;
     EditorForm.ItemEdited += Editor_OnItemEdited;
 }
        public CommandGeneratorViewModel(ISessionContextService sessionContext,
                                         IFoldersExplorerFactory <ObservableFolder <Command>, Command> factory,
                                         IEditorFormFactory <Command> editorFormFactory,
                                         IUniqueValidator <Command> validator,
                                         ICodeGenerationService codeGenerationService)
            : base(sessionContext, factory)
        {
            CommandValidator       = validator;
            CodeGenerationService  = codeGenerationService;
            EditorForm             = editorFormFactory.Create();
            EditorForm.ItemEdited += CreateCommand;
            EditorForm.Validator   = validator;

            Explorer.OpenFileDialog.Filter                = "Java file (*.java) | *.java";
            Explorer.OpenFileDialog.Multiselect           = true;
            Explorer.OpenFileDialog.CheckFileExists       = true;
            Explorer.OpenFileDialog.ValidateNames         = true;
            Explorer.OpenFolderDialog.ShowNewFolderButton = true;
            Explorer.AllowFileExtensions(".java");

            Explorer.FileSynchronizer.SyncFilter = NotifyFilter.File;
        }
Exemplo n.º 5
0
        public RecipeGeneratorViewModel(ISessionContextService sessionContext,
                                        IFoldersExplorerFactory <ObservableFolder <Recipe>, Recipe> factory,
                                        IEditorFormFactory <RecipeCreator> editorFormFactory,
                                        IUniqueValidator <Recipe> recipeValidator,
                                        ISerializer <Recipe> recipeSerializer,
                                        ICodeGenerationService codeGenerationService)
            : base(sessionContext, factory)
        {
            RecipeValidator        = recipeValidator;
            RecipeSerializer       = recipeSerializer;
            CodeGenerationService  = codeGenerationService;
            EditorForm             = editorFormFactory.Create();
            EditorForm.ItemEdited += CreateRecipe;

            Explorer.OpenFileDialog.Filter                = "Json file (*.json) | *.json";
            Explorer.OpenFileDialog.Multiselect           = true;
            Explorer.OpenFileDialog.CheckFileExists       = true;
            Explorer.OpenFileDialog.ValidateNames         = true;
            Explorer.OpenFolderDialog.ShowNewFolderButton = true;
            Explorer.AllowFileExtensions(".json");

            Explorer.FileSynchronizer.SyncFilter = NotifyFilter.File;
        }