/// <summary>
 /// Initializes a new instance of the <see cref="PatchModControlViewModel" /> class.
 /// </summary>
 /// <param name="notificationAction">The notification action.</param>
 /// <param name="modCollectionService">The mod collection service.</param>
 /// <param name="modService">The mod service.</param>
 /// <param name="localizationManager">The localization manager.</param>
 public PatchModControlViewModel(INotificationAction notificationAction, IModCollectionService modCollectionService, IModService modService, ILocalizationManager localizationManager)
 {
     this.notificationAction   = notificationAction;
     this.modService           = modService;
     this.localizationManager  = localizationManager;
     this.modCollectionService = modCollectionService;
 }
예제 #2
0
 public OnModuleApplyDamage(
     IModService mod,
     ICombatService combat)
 {
     _mod    = mod;
     _combat = combat;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ModHolderControlViewModel" /> class.
 /// </summary>
 /// <param name="promptNotificationsService">The prompt notifications service.</param>
 /// <param name="modListInstallRefreshRequestHandler">The mod list install refresh request handler.</param>
 /// <param name="modDefinitionInvalidReplaceHandler">The mod definition invalid replace handler.</param>
 /// <param name="idGenerator">The identifier generator.</param>
 /// <param name="shutDownState">State of the shut down.</param>
 /// <param name="modService">The mod service.</param>
 /// <param name="modPatchCollectionService">The mod patch collection service.</param>
 /// <param name="gameService">The game service.</param>
 /// <param name="notificationAction">The notification action.</param>
 /// <param name="appAction">The application action.</param>
 /// <param name="localizationManager">The localization manager.</param>
 /// <param name="installedModsControlViewModel">The installed mods control view model.</param>
 /// <param name="collectionModsControlViewModel">The collection mods control view model.</param>
 /// <param name="modDefinitionAnalyzeHandler">The mod definition analyze handler.</param>
 /// <param name="modDefinitionLoadHandler">The mod definition load handler.</param>
 /// <param name="modDefinitionPatchLoadHandler">The mod definition patch load handler.</param>
 /// <param name="gameDirectoryChangedHandler">The game directory changed handler.</param>
 /// <param name="logger">The logger.</param>
 public ModHolderControlViewModel(IPromptNotificationsService promptNotificationsService, ModListInstallRefreshRequestHandler modListInstallRefreshRequestHandler, ModDefinitionInvalidReplaceHandler modDefinitionInvalidReplaceHandler,
                                  IIDGenerator idGenerator, IShutDownState shutDownState, IModService modService, IModPatchCollectionService modPatchCollectionService, IGameService gameService,
                                  INotificationAction notificationAction, IAppAction appAction, ILocalizationManager localizationManager,
                                  InstalledModsControlViewModel installedModsControlViewModel, CollectionModsControlViewModel collectionModsControlViewModel,
                                  ModDefinitionAnalyzeHandler modDefinitionAnalyzeHandler, ModDefinitionLoadHandler modDefinitionLoadHandler, ModDefinitionPatchLoadHandler modDefinitionPatchLoadHandler,
                                  GameUserDirectoryChangedHandler gameDirectoryChangedHandler, ILogger logger)
 {
     // It was supposed to be a small project and I ended up with this mess I seriously need to introduce facades sometime
     this.promptNotificationsService         = promptNotificationsService;
     this.modDefinitionInvalidReplaceHandler = modDefinitionInvalidReplaceHandler;
     this.idGenerator               = idGenerator;
     this.shutDownState             = shutDownState;
     this.modService                = modService;
     this.modPatchCollectionService = modPatchCollectionService;
     this.notificationAction        = notificationAction;
     this.localizationManager       = localizationManager;
     this.gameService               = gameService;
     this.logger    = logger;
     this.appAction = appAction;
     this.modDefinitionLoadHandler            = modDefinitionLoadHandler;
     this.modDefinitionPatchLoadHandler       = modDefinitionPatchLoadHandler;
     this.modDefinitionAnalyzeHandler         = modDefinitionAnalyzeHandler;
     this.gameDirectoryChangedHandler         = gameDirectoryChangedHandler;
     this.modListInstallRefreshRequestHandler = modListInstallRefreshRequestHandler;
     InstalledMods  = installedModsControlViewModel;
     CollectionMods = collectionModsControlViewModel;
     if (StaticResources.CommandLineOptions != null && StaticResources.CommandLineOptions.EnableResumeGameButton)
     {
         forceEnableResumeButton = true;
     }
 }
예제 #4
0
        public void Setup()
        {
            var modServiceMock = new Mock <IModService>();

            modServiceMock.Setup(ms => ms.GetMods(It.IsAny <int>())).Returns((int value) => new Mods()
            {
                Three = value % 3 == 0,
                Five  = value % 5 == 0
            });
            modService = modServiceMock.Object;

            var translationServiceMock = new Mock <ITranslationService>();

            translationServiceMock.Setup(
                ts => ts.Translate(It.IsAny <TranslationKey>())).Returns(
                (TranslationKey key) =>
            {
                return(key switch
                {
                    TranslationKey.Three => "Fizz",
                    TranslationKey.Five => "Buzz",
                    TranslationKey.Both => "FizzBuzz",
                    _ => "WTF",
                });
            });
예제 #5
0
 public TranslateFizzBuzz(
     IModService modService,
     ITranslationService translationService)
 {
     this.modService         = modService;
     this.translationService = translationService;
 }
예제 #6
0
 public UserController(
     ICommentService commentService,
     IModService modService,
     IPrivateMessageService privateMessageService)
 {
     this.commentService        = commentService;
     this.modService            = modService;
     this.privateMessageService = privateMessageService;
 }
 public NavViewComponent(
     IStreamStatusApiClient streamStatusClient,
     IModService modService,
     IConfigService configService)
 {
     _streamStatusClient = streamStatusClient;
     _modService         = modService;
     _configService      = configService;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MergeViewerBinaryControlViewModel" /> class.
 /// </summary>
 /// <param name="logger">The logger.</param>
 /// <param name="modService">The mod service.</param>
 /// <param name="localizationManager">The localization manager.</param>
 public MergeViewerBinaryControlViewModel(ILogger logger, IModService modService, ILocalizationManager localizationManager)
 {
     this.modService          = modService;
     this.localizationManager = localizationManager;
     this.logger = logger;
     imageCache  = new ThreadSafeLimitedDictionary <string, IBitmap>
     {
         MaxItems = 100
     };
 }
 public ModTechMasterHome(IModService modService, IMtmMainModel mainModel, IMessageService messageService)
 {
     this.MessageService = messageService;
     this.InitializeComponent();
     this.Model          = new HomeModel(modService, mainModel, MessageService);
     this.PluginCommands = new List <IPluginCommand> {
         new LoadModsCommand(this.Model)
     };
     this.DataContext = this.Model;
 }
예제 #10
0
 public QuoteController(
     IQuoteApiClient quoteApiClient,
     IModService modService,
     IConfigService configService,
     ITwitchClientFactory twitchClientFactory)
 {
     _quoteApiClient      = quoteApiClient;
     _modService          = modService;
     _configService       = configService;
     _twitchClientFactory = twitchClientFactory;
 }
 public ChatbotController(
     IModService modService,
     IPlaylistApiClient playlistApiClient,
     IVipApiClient vipApiClient,
     ISearchApiClient searchApiClient,
     ILogger <ChatbotController> logger)
 {
     this._modService   = modService;
     _playlistApiClient = playlistApiClient;
     _vipApiClient      = vipApiClient;
     _searchApiClient   = searchApiClient;
     _logger            = logger;
 }
예제 #12
0
 public ModController(
     IModService modService,
     IPictureService pictureService,
     IUserService userService,
     IGameService gameService,
     ICommentService commentService,
     IVoteService voteService)
 {
     this.modService     = modService;
     this.pictureService = pictureService;
     this.userService    = userService;
     this.gameService    = gameService;
     this.commentService = commentService;
     this.voteService    = voteService;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="InstalledModsControlViewModel" /> class.
 /// </summary>
 /// <param name="gameService">The game service.</param>
 /// <param name="localizationManager">The localization manager.</param>
 /// <param name="modService">The mod service.</param>
 /// <param name="appStateService">The application state service.</param>
 /// <param name="modSelectedSortOrder">The mod selected sort order.</param>
 /// <param name="modNameSortOrder">The mod name sort order.</param>
 /// <param name="modVersionSortOrder">The mod version sort order.</param>
 /// <param name="filterMods">The filter mods.</param>
 /// <param name="appAction">The application action.</param>
 /// <param name="notificationAction">The notification action.</param>
 public InstalledModsControlViewModel(IGameService gameService, ILocalizationManager localizationManager,
                                      IModService modService, IAppStateService appStateService, SortOrderControlViewModel modSelectedSortOrder,
                                      SortOrderControlViewModel modNameSortOrder, SortOrderControlViewModel modVersionSortOrder,
                                      SearchModsControlViewModel filterMods, IAppAction appAction, INotificationAction notificationAction)
 {
     this.modService          = modService;
     this.gameService         = gameService;
     this.appStateService     = appStateService;
     this.appAction           = appAction;
     this.notificationAction  = notificationAction;
     this.localizationManager = localizationManager;
     ModNameSortOrder         = modNameSortOrder;
     ModVersionSortOrder      = modVersionSortOrder;
     ModSelectedSortOrder     = modSelectedSortOrder;
     FilterMods = filterMods;
 }
예제 #14
0
 public ModItem(
     INWScript script,
     IPerkService perk,
     IItemService item,
     IModService mod,
     IDataService data,
     IColorTokenService color,
     ISkillService skill)
 {
     _perk  = perk;
     _item  = item;
     _      = script;
     _mod   = mod;
     _data  = data;
     _color = color;
     _skill = skill;
 }
예제 #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ModifyCollectionControlViewModel" /> class.
 /// </summary>
 /// <param name="modMergeFreeSpaceCheckHandler">The mod merge free space check handler.</param>
 /// <param name="modService">The mod service.</param>
 /// <param name="idGenerator">The identifier generator.</param>
 /// <param name="modCompressMergeProgressHandler">The mod compress merge progress handler.</param>
 /// <param name="modFileMergeProgressHandler">The mod file merge progress handler.</param>
 /// <param name="shutDownState">State of the shut down.</param>
 /// <param name="modMergeService">The mod merge service.</param>
 /// <param name="modCollectionService">The mod collection service.</param>
 /// <param name="modPatchCollectionService">The mod patch collection service.</param>
 /// <param name="localizationManager">The localization manager.</param>
 /// <param name="notificationAction">The notification action.</param>
 public ModifyCollectionControlViewModel(ModMergeFreeSpaceCheckHandler modMergeFreeSpaceCheckHandler, IModService modService, IIDGenerator idGenerator,
                                         ModCompressMergeProgressHandler modCompressMergeProgressHandler, ModFileMergeProgressHandler modFileMergeProgressHandler, IShutDownState shutDownState,
                                         IModMergeService modMergeService, IModCollectionService modCollectionService, IModPatchCollectionService modPatchCollectionService,
                                         ILocalizationManager localizationManager, INotificationAction notificationAction)
 {
     this.modCollectionService        = modCollectionService;
     this.modPatchCollectionService   = modPatchCollectionService;
     this.localizationManager         = localizationManager;
     this.modMergeService             = modMergeService;
     this.shutDownState               = shutDownState;
     this.modFileMergeProgressHandler = modFileMergeProgressHandler;
     this.notificationAction          = notificationAction;
     this.idGenerator = idGenerator;
     this.modCompressMergeProgressHandler = modCompressMergeProgressHandler;
     this.modService = modService;
     this.modMergeFreeSpaceCheckHandler = modMergeFreeSpaceCheckHandler;
 }
예제 #16
0
 public OnModuleExamine(
     INWScript script,
     IFarmingService farming,
     IDurabilityService durability,
     IPerkService perk,
     IItemService item,
     INWNXEvents nwnxEvents,
     IExaminationService examination,
     IModService mod)
 {
     _            = script;
     _farming     = farming;
     _durability  = durability;
     _perk        = perk;
     _item        = item;
     _nwnxEvents  = nwnxEvents;
     _examination = examination;
     _mod         = mod;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="OptionsControlViewModel" /> class.
 /// </summary>
 /// <param name="modService">The mod service.</param>
 /// <param name="positionSettingsService">The position settings service.</param>
 /// <param name="externalEditorService">The external editor service.</param>
 /// <param name="idGenerator">The identifier generator.</param>
 /// <param name="logger">The logger.</param>
 /// <param name="notificationAction">The notification action.</param>
 /// <param name="localizationManager">The localization manager.</param>
 /// <param name="updater">The updater.</param>
 /// <param name="updaterService">The updater service.</param>
 /// <param name="gameService">The game service.</param>
 /// <param name="fileDialogAction">The file dialog action.</param>
 public OptionsControlViewModel(IModService modService, INotificationPositionSettingsService positionSettingsService,
                                IExternalEditorService externalEditorService, IIDGenerator idGenerator, ILogger logger,
                                INotificationAction notificationAction, ILocalizationManager localizationManager, IUpdater updater,
                                IUpdaterService updaterService, IGameService gameService, IFileDialogAction fileDialogAction)
 {
     this.positionSettingsService = positionSettingsService;
     this.gameService             = gameService;
     this.fileDialogAction        = fileDialogAction;
     this.updaterService          = updaterService;
     this.updater             = updater;
     this.localizationManager = localizationManager;
     this.notificationAction  = notificationAction;
     this.logger                = logger;
     this.idGenerator           = idGenerator;
     this.externalEditorService = externalEditorService;
     this.modService            = modService;
     LeftMargin      = new Thickness(20, 0, 0, 0);
     LeftChildMargin = new Thickness(20, 10, 0, 0);
 }
예제 #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ModHolderControlViewModel" /> class.
 /// </summary>
 /// <param name="shutDownState">State of the shut down.</param>
 /// <param name="modService">The mod service.</param>
 /// <param name="modPatchCollectionService">The mod patch collection service.</param>
 /// <param name="gameService">The game service.</param>
 /// <param name="notificationAction">The notification action.</param>
 /// <param name="appAction">The application action.</param>
 /// <param name="localizationManager">The localization manager.</param>
 /// <param name="installedModsControlViewModel">The installed mods control view model.</param>
 /// <param name="collectionModsControlViewModel">The collection mods control view model.</param>
 /// <param name="modDefinitionAnalyzeHandler">The mod definition analyze handler.</param>
 /// <param name="modDefinitionLoadHandler">The mod definition load handler.</param>
 /// <param name="modDefinitionPatchLoadHandler">The mod definition patch load handler.</param>
 /// <param name="gameDirectoryChangedHandler">The game directory changed handler.</param>
 /// <param name="logger">The logger.</param>
 public ModHolderControlViewModel(IShutDownState shutDownState, IModService modService, IModPatchCollectionService modPatchCollectionService, IGameService gameService,
                                  INotificationAction notificationAction, IAppAction appAction, ILocalizationManager localizationManager,
                                  InstalledModsControlViewModel installedModsControlViewModel, CollectionModsControlViewModel collectionModsControlViewModel,
                                  ModDefinitionAnalyzeHandler modDefinitionAnalyzeHandler, ModDefinitionLoadHandler modDefinitionLoadHandler, ModDefinitionPatchLoadHandler modDefinitionPatchLoadHandler,
                                  GameUserDirectoryChangedHandler gameDirectoryChangedHandler, ILogger logger)
 {
     this.shutDownState             = shutDownState;
     this.modService                = modService;
     this.modPatchCollectionService = modPatchCollectionService;
     this.notificationAction        = notificationAction;
     this.localizationManager       = localizationManager;
     this.gameService               = gameService;
     this.logger    = logger;
     this.appAction = appAction;
     this.modDefinitionLoadHandler      = modDefinitionLoadHandler;
     this.modDefinitionPatchLoadHandler = modDefinitionPatchLoadHandler;
     this.modDefinitionAnalyzeHandler   = modDefinitionAnalyzeHandler;
     this.gameDirectoryChangedHandler   = gameDirectoryChangedHandler;
     InstalledMods  = installedModsControlViewModel;
     CollectionMods = collectionModsControlViewModel;
 }
예제 #19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ModifyCollectionControlViewModel" /> class.
 /// </summary>
 /// <param name="modDefinitionInvalidReplaceHandler">The mod definition invalid replace handler.</param>
 /// <param name="modService">The mod service.</param>
 /// <param name="idGenerator">The identifier generator.</param>
 /// <param name="modCompressMergeProgressHandler">The mod compress merge progress handler.</param>
 /// <param name="modDefinitionAnalyzeHandler">The mod definition analyze handler.</param>
 /// <param name="modDefinitionLoadHandler">The mod definition load handler.</param>
 /// <param name="modDefinitionMergeProgressHandler">The mod definition merge progress handler.</param>
 /// <param name="modFileMergeProgressHandler">The mod file merge progress handler.</param>
 /// <param name="shutDownState">State of the shut down.</param>
 /// <param name="gameService">The game service.</param>
 /// <param name="modMergeService">The mod merge service.</param>
 /// <param name="modCollectionService">The mod collection service.</param>
 /// <param name="modPatchCollectionService">The mod patch collection service.</param>
 /// <param name="localizationManager">The localization manager.</param>
 /// <param name="notificationAction">The notification action.</param>
 public ModifyCollectionControlViewModel(ModDefinitionInvalidReplaceHandler modDefinitionInvalidReplaceHandler, IModService modService, IIDGenerator idGenerator, ModCompressMergeProgressHandler modCompressMergeProgressHandler,
                                         ModDefinitionAnalyzeHandler modDefinitionAnalyzeHandler, ModDefinitionLoadHandler modDefinitionLoadHandler, ModDefinitionMergeProgressHandler modDefinitionMergeProgressHandler,
                                         ModFileMergeProgressHandler modFileMergeProgressHandler, IShutDownState shutDownState, IGameService gameService, IModMergeService modMergeService,
                                         IModCollectionService modCollectionService, IModPatchCollectionService modPatchCollectionService,
                                         ILocalizationManager localizationManager, INotificationAction notificationAction)
 {
     this.modCollectionService      = modCollectionService;
     this.modPatchCollectionService = modPatchCollectionService;
     this.localizationManager       = localizationManager;
     this.gameService                       = gameService;
     this.modMergeService                   = modMergeService;
     this.modDefinitionLoadHandler          = modDefinitionLoadHandler;
     this.modDefinitionAnalyzeHandler       = modDefinitionAnalyzeHandler;
     this.modDefinitionMergeProgressHandler = modDefinitionMergeProgressHandler;
     this.shutDownState                     = shutDownState;
     this.modFileMergeProgressHandler       = modFileMergeProgressHandler;
     this.notificationAction                = notificationAction;
     this.idGenerator                       = idGenerator;
     this.modCompressMergeProgressHandler   = modCompressMergeProgressHandler;
     this.modService = modService;
     this.modDefinitionInvalidReplaceHandler = modDefinitionInvalidReplaceHandler;
 }
예제 #20
0
        public ModCopyPage(
            IModService modService,
            ILogger logger,
            IMtmMainModel mainModel,
            IMessageService messageService)
        {
            this.MessageService = messageService;
            Self = this;

            this.ModCopyModel = new ModCopyModel(
                modService,
                logger,
                mainModel,
                new ReferenceFinderService(),
                messageService);

            this.InitializeComponent();
            this.ModCopyModel.PropertyChanged += (sender, args) =>
            {
                if (args.PropertyName == "ModCollectionNode")
                {
                    this.Dispatcher.Invoke(
                        () => this.tvModControl.ItemsSource = this.ModCopyModel.ModCollectionData);
                }
            };
            this.tvModControl.SelectedItemChanged += this.ModCopyModel.OnSelectedItemChanged;
            this.PluginCommands = new List <IPluginCommand>
            {
                ModCopyModel.ResetSelectionsCommand,
                ModCopyModel.SelectMechsFromDataFileCommand,
                ModCopyModel.BuildCustomCollectionCommand,
                ModCopyModel.ValidateLanceDefinitionsCommand,
                ModCopyModel.SelectVeesFromDataFileCommand,
                ModCopyModel.ViewObjectSummaryWindow
            };
            this.DataContext = this;
        }
예제 #21
0
 public ModCopyModel(
     IModService modService,
     ILogger logger,
     IMtmMainModel mainModel,
     IReferenceFinderService referenceFinderService,
     IMessageService messageService)
 {
     this.modService                  = modService;
     this.logger                      = logger;
     this.ReferenceFinderService      = referenceFinderService;
     this.MessageService              = messageService;
     this.MainModel                   = mainModel;
     this.modService.PropertyChanged += this.ModServiceOnPropertyChanged;
     ResetSelectionsCommand           = new ResetSelectionsCommand(this);
     SelectMechsFromDataFileCommand   = new SelectMechsFromDataFileCommand(this);
     BuildCustomCollectionCommand     = new BuildCustomCollectionCommand(this);
     ValidateLanceDefinitionsCommand  = new ValidateLanceDefinitionsCommand(this);
     SelectVeesFromDataFileCommand    = new SelectVeesFromDataFileCommand(this);
     ViewObjectSummaryWindow          = new DelegatePluginCommand(
         () =>
     {
         if (ObjectSummaryWindow == null)
         {
             ObjectSummaryWindow         = new ObjectSummaryWindow(this);
             ObjectSummaryWindow.Topmost = true;
             ObjectSummaryWindow.Show();
         }
         else
         {
             ObjectSummaryWindow.Activate();
         }
     },
         () => true,
         this,
         @"Show Object Summary Window");
 }
예제 #22
0
 public HomeController(IModService modService, IUserService userService)
 {
     _modService  = modService;
     _userService = userService;
 }
예제 #23
0
 public GameController(IGameService gameService, IModService modService)
 {
     this.gameService = gameService;
     this.modService  = modService;
 }
예제 #24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MergeViewerBinaryControlViewModel" /> class.
 /// </summary>
 /// <param name="logger">The logger.</param>
 /// <param name="modService">The mod service.</param>
 /// <param name="localizationManager">The localization manager.</param>
 public MergeViewerBinaryControlViewModel(ILogger logger, IModService modService, ILocalizationManager localizationManager)
 {
     this.modService          = modService;
     this.localizationManager = localizationManager;
     this.logger = logger;
 }
예제 #25
0
 public HomeModel(IModService modService, IMtmMainModel mainModel, IMessageService messageService)
 {
     this.MessageService = messageService;
     this.modService     = modService;
     this.mainModel      = mainModel;
 }
예제 #26
0
 public OnModuleApplyDamage(IModService mod,
                            IAbilityService ability)
 {
     _mod     = mod;
     _ability = ability;
 }
예제 #27
0
 public VoteService(ApplicationDbContext db, IModService modService)
 {
     this.db         = db;
     this.modService = modService;
 }