예제 #1
0
 public EventsHandler(
     IKeybindEvents events,
     IWhisperService whisperService,
     INativeClipboard clipboard,
     INativeKeyboard keyboard,
     ILogger logger,
     ITradeSearchService tradeSearchService,
     IWikiProvider wikiProvider,
     IViewLocator viewLocator,
     IChatService chatService,
     IStashService stashService,
     SidekickSettings settings,
     IParserService parserService)
 {
     this.events             = events;
     this.whisperService     = whisperService;
     this.clipboard          = clipboard;
     this.keyboard           = keyboard;
     this.logger             = logger.ForContext(GetType());
     this.tradeSearchService = tradeSearchService;
     this.logger             = logger.ForContext(GetType());
     this.wikiProvider       = wikiProvider;
     this.viewLocator        = viewLocator;
     this.chatService        = chatService;
     this.stashService       = stashService;
     this.settings           = settings;
     this.parserService      = parserService;
     Initialize();
 }
예제 #2
0
        public FileManagerCommand(IStageService stageService, IStashService stashService, ILogService logger)
        {
            this.stageService = stageService ?? throw new ArgumentNullException(nameof(stageService));
            this.stashService = stashService ?? throw new ArgumentNullException(nameof(stashService));
            this.logger       = logger;

            RegisterQuery(StageQueries.STAGE, new StageCommand(stageService));
            RegisterQuery(StashQueries.STASH, new StashCommand(stashService, stageService));
            RegisterQuery(ApplyQueries.APPLY, new ApplyCommand(stageService, stashService, logger));
        }
예제 #3
0
        public ApplyCommand(IStageService stage, IStashService stashes, ILogService logger)
        {
            this.stage   = stage ?? throw new ArgumentNullException(nameof(stage));
            this.stashes = stashes ?? throw new ArgumentNullException(nameof(stashes));
            this.logger  = logger;

            RegisterQuery(ApplyQueries.COPY, new CopyCommand(stage, stashes, logger));
            RegisterQuery(ApplyQueries.MOVE, new MoveCommand(stage, stashes, logger));
            //RegisterQuery(ApplyQueries.RENAME, new RenameCommand());
            RegisterQuery(ApplyQueries.DELETE, new DeleteCommand(stage, stashes, logger));
            RegisterQuery(ApplyQueries.SEARCH, new ContentSearchCommand(stage, stashes, logger));
            //RegisterQuery(ApplyQueries.REPLACE, new ContentReplaceCommand());
            RegisterQuery(ApplyQueries.ARCHIVE, new ArchiveCommand(stage, stashes, logger));
        }
예제 #4
0
 public KeybindEvents(ILogger logger,
                      INativeProcess nativeProcess,
                      SidekickSettings configuration,
                      INativeKeyboard nativeKeyboard,
                      IStashService stashService,
                      HookProvider hookProvider)
 {
     this.logger         = logger.ForContext(GetType());
     this.nativeProcess  = nativeProcess;
     this.configuration  = configuration;
     this.nativeKeyboard = nativeKeyboard;
     this.stashService   = stashService;
     this.hookProvider   = hookProvider;
 }
예제 #5
0
        public StashCommand(IStashService stashes, IStageService stage)
        {
            this.stashes = stashes;
            this.stage   = stage;

            RegisterQuery(StashQueries.LIST, List);
            RegisterQuery(StashQueries.SHOW, Show);
            RegisterQuery(StashQueries.PUSH, Push);
            RegisterQuery(StashQueries.APPLY, Apply);
            RegisterQuery(StashQueries.PEEK, Peek);
            RegisterQuery(StashQueries.POP, Pop);
            RegisterQuery(StashQueries.DROP, Drop);
            RegisterQuery(StashQueries.CLEAR, Clear);
        }
예제 #6
0
        public MainForm(
            IServiceProvider serviceProvider             // TODO Refactor : injecting service factory is anti pattern
            , ILogger <MainForm> log
            , SessionContext sessionContext
            , IPlayerService playerService
            , IVaultService vaultService
            , IStashService stashService
            , IFontService fontService
            ) : base(serviceProvider)
        {
            this.userContext   = sessionContext;
            this.playerService = playerService;
            this.vaultService  = vaultService;
            this.stashService  = stashService;

            Log = log;
            Log.LogInformation("TQVaultAE Initialization !");

            InitForm();

            #region Apply custom font & scaling

            this.exitButton.Font = FontService.GetFontLight(12F, UIService.Scale);
            ScaleControl(this.UIService, this.exitButton);
            this.characterComboBox.Font = FontService.GetFontLight(13F, UIService.Scale);
            ScaleControl(this.UIService, this.characterComboBox, false);
            this.characterLabel.Font = FontService.GetFontLight(11F, UIService.Scale);
            ScaleControl(this.UIService, this.characterLabel, false);

            this.itemText.Font = FontService.GetFontLight(11F, FontStyle.Bold, UIService.Scale);

            this.vaultListComboBox.Font = FontService.GetFontLight(13F, UIService.Scale);
            ScaleControl(this.UIService, this.vaultListComboBox, false);
            this.vaultLabel.Font = FontService.GetFontLight(11F, UIService.Scale);
            ScaleControl(this.UIService, this.vaultLabel, false);
            this.configureButton.Font = FontService.GetFontLight(12F, UIService.Scale);
            ScaleControl(this.UIService, this.configureButton);
            this.customMapText.Font = FontService.GetFont(11.25F, UIService.Scale);
            ScaleControl(this.UIService, this.customMapText, false);
            this.showVaulButton.Font = FontService.GetFontLight(12F, UIService.Scale);
            ScaleControl(this.UIService, this.showVaulButton);
            this.secondaryVaultListComboBox.Font = FontService.GetFontLight(11F, UIService.Scale);
            ScaleControl(this.UIService, this.secondaryVaultListComboBox, false);
            this.aboutButton.Font = FontService.GetFontLight(8.25F, UIService.Scale);
            ScaleControl(this.UIService, this.aboutButton);
            this.titleLabel.Font = FontService.GetFontLight(24F, UIService.Scale);
            ScaleControl(this.UIService, this.titleLabel);
            this.searchButton.Font = FontService.GetFontLight(12F, UIService.Scale);
            ScaleControl(this.UIService, this.searchButton);
            ScaleControl(this.UIService, this.tableLayoutPanelMain);

            #endregion

            if (TQDebug.DebugEnabled)
            {
                // Write this version into the debug file.
                Log.LogDebug(
                    $@"Current TQVault Version: {this.currentVersion}
Debug Levels
{nameof(TQDebug.ArcFileDebugLevel)}: {TQDebug.ArcFileDebugLevel}
{nameof(TQDebug.DatabaseDebugLevel)}: {TQDebug.DatabaseDebugLevel}
{nameof(TQDebug.ItemAttributesDebugLevel)}: {TQDebug.ItemAttributesDebugLevel}
{nameof(TQDebug.ItemDebugLevel)}: {TQDebug.ItemDebugLevel}
");
            }

            // Process the mouse scroll wheel to cycle through the vaults.
            this.MouseWheel += new MouseEventHandler(this.MainFormMouseWheel);
        }
예제 #7
0
        internal static IOperationSource GetOperationSource(this CommandContext context, IStageService stage, IStashService stashes)
        {
            OptionContext optionStash = context.GetOption(ApplyOptions.STASH);

            if (optionStash == null)
            {
                return(stage);
            }

            string id = optionStash.GetParameterValue(StashParameters.IDENTIFIER);

            return(int.TryParse(id, out int index)
                ? stashes.GetStash(index)
                : stashes.GetStash(id));
        }
예제 #8
0
 public ArchiveCommand(IStageService stage, IStashService stashes, ILogService logger)
 {
     this.stage   = stage ?? throw new ArgumentNullException(nameof(stage));
     this.stashes = stashes ?? throw new ArgumentNullException(nameof(stashes));
     this.logger  = logger;
 }
예제 #9
0
        public MainForm(
            IServiceProvider serviceProvider
            , ILogger <MainForm> log
            , SessionContext sessionContext
            , IPlayerService playerService
            , IVaultService vaultService
            , ISearchService searchService
            , IStashService stashService
            , IFontService fontService
            ) : base(serviceProvider)
        {
            this.userContext   = sessionContext;
            this.playerService = playerService;
            this.vaultService  = vaultService;
            this.searchService = searchService;
            this.stashService  = stashService;

            Log = log.Logger;
            Log.Info("TQVaultAE Initialization !");

            InitForm();

            #region Apply custom font & scaling

            this.exitButton.Font = FontService.GetFontAlbertusMTLight(12F, UIService.Scale);
            ScaleControl(this.UIService, this.exitButton);
            this.characterComboBox.Font = FontService.GetFontAlbertusMTLight(13F, UIService.Scale);
            ScaleControl(this.UIService, this.characterComboBox);
            this.characterLabel.Font = FontService.GetFontAlbertusMTLight(11F, UIService.Scale);
            ScaleControl(this.UIService, this.characterLabel);
            ScaleControl(this.UIService, this.itemTextPanel);

            ScaleControl(this.UIService, this.itemText);
            this.vaultListComboBox.Font = FontService.GetFontAlbertusMTLight(13F, UIService.Scale);
            ScaleControl(this.UIService, this.vaultListComboBox);
            this.vaultLabel.Font = FontService.GetFontAlbertusMTLight(11F, UIService.Scale);
            ScaleControl(this.UIService, this.vaultLabel);
            this.configureButton.Font = FontService.GetFontAlbertusMTLight(12F, UIService.Scale);
            ScaleControl(this.UIService, this.configureButton);
            this.customMapText.Font = FontService.GetFontAlbertusMT(11.25F, UIService.Scale);
            ScaleControl(this.UIService, this.customMapText);
            this.panelSelectButton.Font = FontService.GetFontAlbertusMTLight(12F, UIService.Scale);
            ScaleControl(this.UIService, this.panelSelectButton);
            this.secondaryVaultListComboBox.Font = FontService.GetFontAlbertusMTLight(11F, UIService.Scale);
            ScaleControl(this.UIService, this.secondaryVaultListComboBox);
            this.aboutButton.Font = FontService.GetFontAlbertusMTLight(8.25F, UIService.Scale);
            ScaleControl(this.UIService, this.aboutButton);
            this.titleLabel.Font = FontService.GetFontAlbertusMTLight(24F, UIService.Scale);
            ScaleControl(this.UIService, this.titleLabel);
            this.searchButton.Font = FontService.GetFontAlbertusMTLight(12F, UIService.Scale);
            ScaleControl(this.UIService, this.searchButton);

            #endregion

            if (TQDebug.DebugEnabled)
            {
                // Write this version into the debug file.
                Log.DebugFormat(CultureInfo.InvariantCulture, "Current TQVault Version: {0}", this.currentVersion);
                Log.Debug(string.Empty);
                Log.Debug("Debug Levels");
                Log.DebugFormat(CultureInfo.InvariantCulture, "ARCFileDebugLevel: {0}", TQDebug.ArcFileDebugLevel);
                Log.DebugFormat(CultureInfo.InvariantCulture, "DatabaseDebugLevel: {0}", TQDebug.DatabaseDebugLevel);
                Log.DebugFormat(CultureInfo.InvariantCulture, "ItemAttributesDebugLevel: {0}", TQDebug.ItemAttributesDebugLevel);
                Log.DebugFormat(CultureInfo.InvariantCulture, "ItemDebugLevel: {0}", TQDebug.ItemDebugLevel);
                Log.Debug(string.Empty);
            }

            // Set up Item strings
            Item.ItemWith           = Resources.ItemWith;
            Item.ItemRelicBonus     = Resources.ItemRelicBonus;
            Item.ItemRelicCompleted = Resources.ItemRelicCompleted;
            Item.ItemQuest          = Resources.ItemQuest;
            Item.ItemSeed           = Resources.ItemSeed;
            Item.ItemIT             = Resources.ItemIT;
            Item.ItemRagnarok       = Resources.ItemRagnarok;
            Item.ItemAtlantis       = Resources.ItemAtlantis;
            Item.ShowSkillLevel     = Config.Settings.Default.ShowSkillLevel;

            // Process the mouse scroll wheel to cycle through the vaults.
            this.MouseWheel += new MouseEventHandler(this.MainFormMouseWheel);
        }
예제 #10
0
        public MainForm(
            IServiceProvider serviceProvider
            , ILogger <MainForm> log
            , SessionContext sessionContext
            , IPlayerService playerService
            , IVaultService vaultService
            , ISearchService searchService
            , IStashService stashService
            , IFontService fontService
            ) : base(serviceProvider)
        {
            this.userContext   = sessionContext;
            this.playerService = playerService;
            this.vaultService  = vaultService;
            this.searchService = searchService;
            this.stashService  = stashService;

            Log = log.Logger;
            Log.Info("TQVaultAE Initialization !");

            InitForm();

            #region Apply custom font & scaling

            this.exitButton.Font = FontService.GetFontAlbertusMTLight(12F, UIService.Scale);
            ScaleControl(this.UIService, this.exitButton);
            this.characterComboBox.Font = FontService.GetFontAlbertusMTLight(13F, UIService.Scale);
            ScaleControl(this.UIService, this.characterComboBox, false);
            this.characterLabel.Font = FontService.GetFontAlbertusMTLight(11F, UIService.Scale);
            ScaleControl(this.UIService, this.characterLabel, false);

            this.itemText.Font = FontService.GetFontAlbertusMTLight(11F, FontStyle.Bold, UIService.Scale);

            this.vaultListComboBox.Font = FontService.GetFontAlbertusMTLight(13F, UIService.Scale);
            ScaleControl(this.UIService, this.vaultListComboBox, false);
            this.vaultLabel.Font = FontService.GetFontAlbertusMTLight(11F, UIService.Scale);
            ScaleControl(this.UIService, this.vaultLabel, false);
            this.configureButton.Font = FontService.GetFontAlbertusMTLight(12F, UIService.Scale);
            ScaleControl(this.UIService, this.configureButton);
            this.customMapText.Font = FontService.GetFontAlbertusMT(11.25F, UIService.Scale);
            ScaleControl(this.UIService, this.customMapText, false);
            this.showVaulButton.Font = FontService.GetFontAlbertusMTLight(12F, UIService.Scale);
            ScaleControl(this.UIService, this.showVaulButton);
            this.secondaryVaultListComboBox.Font = FontService.GetFontAlbertusMTLight(11F, UIService.Scale);
            ScaleControl(this.UIService, this.secondaryVaultListComboBox, false);
            this.aboutButton.Font = FontService.GetFontAlbertusMTLight(8.25F, UIService.Scale);
            ScaleControl(this.UIService, this.aboutButton);
            this.titleLabel.Font = FontService.GetFontAlbertusMTLight(24F, UIService.Scale);
            ScaleControl(this.UIService, this.titleLabel);
            this.searchButton.Font = FontService.GetFontAlbertusMTLight(12F, UIService.Scale);
            ScaleControl(this.UIService, this.searchButton);
            ScaleControl(this.UIService, this.tableLayoutPanelMain);

            #endregion

            if (TQDebug.DebugEnabled)
            {
                // Write this version into the debug file.
                Log.DebugFormat(CultureInfo.InvariantCulture, "Current TQVault Version: {0}", this.currentVersion);
                Log.Debug(string.Empty);
                Log.Debug("Debug Levels");
                Log.DebugFormat(CultureInfo.InvariantCulture, "ARCFileDebugLevel: {0}", TQDebug.ArcFileDebugLevel);
                Log.DebugFormat(CultureInfo.InvariantCulture, "DatabaseDebugLevel: {0}", TQDebug.DatabaseDebugLevel);
                Log.DebugFormat(CultureInfo.InvariantCulture, "ItemAttributesDebugLevel: {0}", TQDebug.ItemAttributesDebugLevel);
                Log.DebugFormat(CultureInfo.InvariantCulture, "ItemDebugLevel: {0}", TQDebug.ItemDebugLevel);
                Log.Debug(string.Empty);
            }

            // Process the mouse scroll wheel to cycle through the vaults.
            this.MouseWheel += new MouseEventHandler(this.MainFormMouseWheel);
        }