Пример #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;
        }
Пример #2
0
 public SoundGeneratorViewModel(ISessionContextService sessionContext, IDialogService dialogService, IFoldersExplorerFactory <SoundEvent, Sound> factory, IPreferenceService preferenceService) : base(sessionContext, dialogService, factory)
 {
     PreferenceService = preferenceService;
     Preferences       = preferenceService.GetOrCreate <SoundsGeneratorPreferences>();
     Explorer.AllowedFileExtensions.Add(".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             = new EditorForm <Sound>(Cache.Default, DialogService, new SoundEditForm());
     FileEditor.ItemEdited += OnSoundEdited;
 }