コード例 #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 BlockGeneratorViewModel(ISessionContextService sessionContext,
                                IEditorFormFactory <Block> editorFormFactory,
                                IUniqueValidator <Block> validator,
                                ICodeGenerationService codeGenerationService)
     : base(sessionContext, editorFormFactory, validator, codeGenerationService)
 {
 }
コード例 #3
0
 public MaterialGeneratorViewModel(ISessionContextService sessionContext,
                                   IEditorFormFactory <Material> editorFormFactory,
                                   IUniqueValidator <Material> validator,
                                   ICodeGenerationService codeGenerationService)
     : base(sessionContext, editorFormFactory, validator, codeGenerationService)
 {
 }
コード例 #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");
 }
コード例 #5
0
 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;
 }
コード例 #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;
 }
コード例 #7
0
 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;
 }
コード例 #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;
 }
コード例 #9
0
        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;
        }
コード例 #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;
        }
コード例 #11
0
 public MainWindowViewModel(INavigationService navigation, ISessionContextService sessionContext, IModBuildService modBuilder)
 {
     this.navigation = navigation;
     this.modBuilder = modBuilder;
     SessionContext  = sessionContext;
 }
コード例 #12
0
 public FoldersWatcherViewModelBase(ISessionContextService sessionContext, IFoldersExplorerFactory <TFolder, TFile> explorerFactory)
     : base(sessionContext) => Explorer = explorerFactory.Create();
コード例 #13
0
 public BuildConfigurationViewModel(ISessionContextService sessionContext, IModBuildService modBuilder)
 {
     this.modBuilder = modBuilder;
     SessionContext  = sessionContext;
 }
コード例 #14
0
 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;
 }
コード例 #16
0
 public ViewModelBase(ISessionContextService sessionContext)
 {
     SessionContext = sessionContext;
     SessionContext.PropertyChanged += OnSessionContextPropertyChanged;
 }
コード例 #17
0
 public McModModelFormProvider(ISessionContextService sessionContext, ObservableCollection <WorkspaceSetup> setups)
 {
     this.sessionContext = sessionContext;
     this.setups         = setups;
 }
コード例 #18
0
 public DashboardViewModel(ISessionContextService sessionContext) => SessionContext = sessionContext;