Beispiel #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 BlockGeneratorViewModel(ISessionContextService sessionContext,
                                IEditorFormFactory <Block> editorFormFactory,
                                IUniqueValidator <Block> validator,
                                ICodeGenerationService codeGenerationService)
     : base(sessionContext, editorFormFactory, validator, codeGenerationService)
 {
 }
Beispiel #3
0
 public MaterialGeneratorViewModel(ISessionContextService sessionContext,
                                   IEditorFormFactory <Material> editorFormFactory,
                                   IUniqueValidator <Material> validator,
                                   ICodeGenerationService codeGenerationService)
     : base(sessionContext, editorFormFactory, validator, codeGenerationService)
 {
 }
Beispiel #4
0
 public TextureGeneratorViewModel(ISessionContextService sessionContext, IFoldersExplorerFactory <ObservableFolder <FileObject>, FileObject> explorerFactory) : base(sessionContext, explorerFactory)
 {
     Explorer.OpenFileDialog.Filter                = "Image (*.png) | *.png";
     Explorer.OpenFileDialog.Multiselect           = true;
     Explorer.OpenFileDialog.CheckFileExists       = true;
     Explorer.OpenFileDialog.ValidateNames         = true;
     Explorer.OpenFolderDialog.ShowNewFolderButton = true;
     Explorer.AllowedFileExtensions.Add(".png");
 }
 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;
 }
Beispiel #6
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;
 }
 public ModGeneratorViewModel(ISessionContextService sessionContext, IDialogService dialogService, IFileSystem fileSystem)
 {
     SessionContext = sessionContext;
     DialogService  = dialogService;
     FileSystem     = fileSystem;
     ResetNewMod();
     Form = new ModForm()
     {
         AddForgeVersionCommand = AddNewForgeVersionCommand,
         Setups        = new ObservableCollection <WorkspaceSetup>(ReflectionHelper.EnumerateSubclasses <WorkspaceSetup>()),
         ForgeVersions = SessionContext.ForgeVersions,
         Sides         = Sides
     };
     EditorForm             = new EditorForm <Mod>(Cache.Default, DialogService, Form, ModValidator);
     EditorForm.ItemEdited += Editor_OnItemEdited;
 }
Beispiel #8
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;
        }
Beispiel #10
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;
        }
 public MainWindowViewModel(INavigationService navigation, ISessionContextService sessionContext, IModBuildService modBuilder)
 {
     this.navigation = navigation;
     this.modBuilder = modBuilder;
     SessionContext  = sessionContext;
 }
Beispiel #12
0
 public FoldersWatcherViewModelBase(ISessionContextService sessionContext, IFoldersExplorerFactory <TFolder, TFile> explorerFactory)
     : base(sessionContext) => Explorer = explorerFactory.Create();
Beispiel #13
0
 public BuildConfigurationViewModel(ISessionContextService sessionContext, IModBuildService modBuilder)
 {
     this.modBuilder = modBuilder;
     SessionContext  = sessionContext;
 }
 public FoldersJsonViewModelBase(ISessionContextService sessionContext, IDialogService dialogService, IFoldersExplorerFactory <TFolder, TFile> factory) : base(sessionContext, factory) => DialogService = dialogService;
 public FoldersWatcherViewModelBase(ISessionContextService sessionContext, IFoldersExplorerFactory <TFolder, TFile> explorerFactory)
 {
     Explorer       = explorerFactory.Create();
     SessionContext = sessionContext;
     SessionContext.PropertyChanged += OnSessionContexPropertyChanged;
 }
Beispiel #16
0
 public ViewModelBase(ISessionContextService sessionContext)
 {
     SessionContext = sessionContext;
     SessionContext.PropertyChanged += OnSessionContextPropertyChanged;
 }
 public McModModelFormProvider(ISessionContextService sessionContext, ObservableCollection <WorkspaceSetup> setups)
 {
     this.sessionContext = sessionContext;
     this.setups         = setups;
 }
 public DashboardViewModel(ISessionContextService sessionContext) => SessionContext = sessionContext;