Example #1
0
        public CombatAssistantFeatureForm(IWurmApi wurmApi, ILogger logger, FeatureSettings featureSettings,
                                          IProcessStarter processStarter)
        {
            if (wurmApi == null)
            {
                throw new ArgumentNullException(nameof(wurmApi));
            }
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }
            if (featureSettings == null)
            {
                throw new ArgumentNullException(nameof(featureSettings));
            }
            if (processStarter == null)
            {
                throw new ArgumentNullException(nameof(processStarter));
            }
            this.wurmApi         = wurmApi;
            this.logger          = logger;
            this.featureSettings = featureSettings;
            this.processStarter  = processStarter;

            InitializeComponent();
            var characters =
                wurmApi.Characters.All.Select(character => character.Name.Capitalized).Cast <object>().ToArray();

            wurmCharacterCbox.Items.AddRange(characters);
            historicCharacterCbox.Items.AddRange(characters);
        }
Example #2
0
        public SkillStatsFeatureForm(SkillStatsFeature feature, IWurmApi wurmApi, ILogger logger, [NotNull] ITelemetry telemetry)
        {
            if (feature == null)
            {
                throw new ArgumentNullException("feature");
            }
            if (wurmApi == null)
            {
                throw new ArgumentNullException("wurmApi");
            }
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }
            this.feature   = feature;
            this.wurmApi   = wurmApi;
            this.logger    = logger;
            this.telemetry = telemetry ?? throw new ArgumentNullException(nameof(telemetry));
            InitializeComponent();

            var allChars = this.wurmApi.Characters.All.Select(character => character).ToArray();

            liveMonCharacterCbox.Items.AddRange(
                allChars.Select(character => character.Name.Capitalized).Cast <object>().ToArray());
            queryGameCharsCblist.Items.AddRange(allChars.Cast <object>().ToArray());
            var serverGroups = this.wurmApi.ServerGroups.AllKnown;

            serverGroupCbox.Items.AddRange(serverGroups.Select(group => group.ServerGroupId).Cast <object>().ToArray());

            SetToday();
        }
Example #3
0
        public LogSearchForm([NotNull] IWurmApi wurmApi, [NotNull] ILogger logger, [NotNull] ITelemetry telemetry)
        {
            this.wurmApi   = wurmApi ?? throw new ArgumentNullException(nameof(wurmApi));
            this.logger    = logger ?? throw new ArgumentNullException(nameof(logger));
            this.telemetry = telemetry ?? throw new ArgumentNullException(nameof(telemetry));

            InitializeComponent();
            lastVisibleWindowState = this.WindowState;

            comboBoxPlayerName.Items.AddRange(
                wurmApi.Characters.All.Select(character => (object)character.Name).ToArray());
            comboBoxLogType.Items.AddRange(wurmApi.LogDefinitions.AllLogTypes.Select(type => (object)type.ToString()).ToArray());
            comboBoxSearchType.Items.AddRange(SearchTypes.Select(type => (object)type.ToString()).ToArray());

            dateTimePickerTimeFrom.Value = DateTime.Now;
            dateTimePickerTimeTo.Value   = DateTime.Now;

            comboBoxLogType.Text    = LogType.Event.ToString();
            comboBoxSearchType.Text = SearchTypeId.RegexEscapedCaseIns.ToString();

            if (comboBoxPlayerName.Items.Count > 0)
            {
                comboBoxPlayerName.Text = comboBoxPlayerName.Items[0].ToString();
            }
        }
Example #4
0
 public WurmTimer(
     string persistentObjectId,
     [NotNull] ITrayPopups trayPopups,
     [NotNull] ILogger logger,
     [NotNull] IWurmApi wurmApi,
     [NotNull] ISoundManager soundManager,
     [NotNull] ITelemetry telemetry) : base(persistentObjectId)
 {
     Id = Guid.Parse(persistentObjectId);
     if (trayPopups == null)
     {
         throw new ArgumentNullException("trayPopups");
     }
     if (logger == null)
     {
         throw new ArgumentNullException("logger");
     }
     if (wurmApi == null)
     {
         throw new ArgumentNullException("wurmApi");
     }
     if (soundManager == null)
     {
         throw new ArgumentNullException("soundManager");
     }
     this.TrayPopups   = trayPopups;
     this.Logger       = logger;
     this.WurmApi      = wurmApi;
     this.SoundManager = soundManager;
     this.telemetry    = telemetry ?? throw new ArgumentNullException(nameof(telemetry));
 }
Example #5
0
        public LiveSessionForm(string gameChar, IWurmApi wurmApi, ILogger logger)
        {
            if (gameChar == null)
            {
                throw new ArgumentNullException("gameChar");
            }
            if (wurmApi == null)
            {
                throw new ArgumentNullException("wurmApi");
            }
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }
            this.gameChar = gameChar;
            this.wurmApi  = wurmApi;
            this.logger   = logger;
            InitializeComponent();

            Text = "Skills monitor " + gameChar;

            wurmCharacter = wurmApi.Characters.Get(gameChar);

            objectListView.SetObjects(reportItems);
            descBase = gameChar + " (since: " + DateTime.Now.ToString("g") + ")";
            stopwatch.Start();

            Collecting = true;
            timer.Start();

            wurmCharacter.Skills.SkillsChanged += SkillsOnSkillsChanged;
        }
Example #6
0
 public CombatAssistantFeature(IWurmApi wurmApi, ILogger logger, FeatureSettings featureSettings,
                               IProcessStarter processStarter)
 {
     if (wurmApi == null)
     {
         throw new ArgumentNullException("wurmApi");
     }
     if (logger == null)
     {
         throw new ArgumentNullException("logger");
     }
     if (featureSettings == null)
     {
         throw new ArgumentNullException("featureSettings");
     }
     if (processStarter == null)
     {
         throw new ArgumentNullException("processStarter");
     }
     this.wurmApi         = wurmApi;
     this.logger          = logger;
     this.featureSettings = featureSettings;
     this.processStarter  = processStarter;
     form = new CombatAssistantFeatureForm(wurmApi, logger, featureSettings, processStarter);
 }
        public RevealCreaturesForm(IWurmApi wurmApi, ILogger logger)
        {
            if (wurmApi == null)
            {
                throw new ArgumentNullException("wurmApi");
            }
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }
            this.wurmApi = wurmApi;
            this.logger  = logger;
            InitializeComponent();

            ClearOutput();

            filter = new TextMatchFilter(resultsView,
                                         "",
                                         StringComparison.InvariantCultureIgnoreCase);

            resultsView.DefaultRenderer =
                new HighlightTextRenderer(filter);

            gameChar.Items.AddRange(
                wurmApi.Characters.All.Select(character => character.Name.Capitalized).Cast <object>().ToArray());
        }
Example #8
0
        public Widget(string characterName, IWurmApi wurmApi, ILogger logger)
        {
            if (characterName == null)
            {
                throw new ArgumentNullException("characterName");
            }
            if (wurmApi == null)
            {
                throw new ArgumentNullException("wurmApi");
            }
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }
            this.characterName = characterName;
            this.wurmApi       = wurmApi;
            this.logger        = logger;
            InitializeComponent();

            actionLbl.Text    = string.Empty;
            widgetModeManager = new WidgetModeManager(this);
            widgetModeManager.Set(true);
            widgetModeManager.WidgetModeChanging += (sender, args) =>
            {
                widgetHelpLbl.Visible = !args.WidgetMode;
            };
        }
Example #9
0
 public TimersForm([NotNull] TimersFeature timersFeature, [NotNull] ILogger logger, [NotNull] IWurmApi wurmApi,
                   [NotNull] TimerDefinitions timerDefinitions)
 {
     if (timersFeature == null)
     {
         throw new ArgumentNullException("timersFeature");
     }
     if (logger == null)
     {
         throw new ArgumentNullException("logger");
     }
     if (wurmApi == null)
     {
         throw new ArgumentNullException("wurmApi");
     }
     if (timerDefinitions == null)
     {
         throw new ArgumentNullException("timerDefinitions");
     }
     this.timersFeature    = timersFeature;
     this.logger           = logger;
     this.wurmApi          = wurmApi;
     this.timerDefinitions = timerDefinitions;
     InitializeComponent();
     widgetManager = new WidgetModeManager(this);
     widgetManager.WidgetModeChanging += (sender, args) =>
     {
         buttonAddRemoveChars.Visible
                   = buttonCustomTimers.Visible
                   = buttonOptions.Visible
                   = label1.Visible
                   = !args.WidgetMode;
     };
 }
Example #10
0
 public WurmUnlimitedLogsDirChecker([NotNull] IWurmApi wurmApi, [NotNull] IUserNotifier userNotifier,
                                    [NotNull] IWurmAssistantConfig wurmAssistantConfig)
 {
     this.wurmPaths           = wurmApi.Paths ?? throw new ArgumentNullException(nameof(wurmPaths));
     this.wurmCharacters      = wurmApi.Characters ?? throw new ArgumentNullException(nameof(wurmCharacters));
     this.userNotifier        = userNotifier ?? throw new ArgumentNullException(nameof(userNotifier));
     this.wurmAssistantConfig = wurmAssistantConfig ?? throw new ArgumentNullException(nameof(wurmAssistantConfig));
 }
Example #11
0
        public CalendarFeature(
            [NotNull] IWurmApi wurmApi,
            [NotNull] ILogger logger,
            [NotNull] ITimerFactory timerFactory,
            [NotNull] ISoundManager soundManager,
            [NotNull] ITrayPopups trayPopups,
            [NotNull] WurmSeasonsManager seasonsManager)
        {
            if (wurmApi == null)
            {
                throw new ArgumentNullException(nameof(wurmApi));
            }
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }
            if (timerFactory == null)
            {
                throw new ArgumentNullException(nameof(timerFactory));
            }
            if (soundManager == null)
            {
                throw new ArgumentNullException(nameof(soundManager));
            }
            if (trayPopups == null)
            {
                throw new ArgumentNullException(nameof(trayPopups));
            }
            if (seasonsManager == null)
            {
                throw new ArgumentNullException(nameof(seasonsManager));
            }
            this.wurmApi        = wurmApi;
            this.logger         = logger;
            this.soundManager   = soundManager;
            this.trayPopups     = trayPopups;
            this.seasonsManager = seasonsManager;

            useWurmTimeForDisplay = false;
            soundWarning          = false;
            soundId        = Guid.Empty;
            popupWarning   = false;
            trackedSeasons = new string[0];
            serverName     = "";
            mainWindowSize = new System.Drawing.Size(487, 414);

            updateTimer          = timerFactory.CreateUiThreadTimer();
            updateTimer.Interval = TimeSpan.FromMilliseconds(500);
            updateTimer.Tick    += (sender, args) =>
            {
                ObtainWdtForCurrentServer();
                if (hasWdt)
                {
                    UpdateOutputList();
                }
            };
            seasonsManager.DataChanged += SeasonsManagerOnDataChanged;
        }
Example #12
0
        public ActiveTriggers(
            string characterName,
            [NotNull] ISoundManager soundManager,
            [NotNull] ITrayPopups trayPopups,
            [NotNull] IWurmApi wurmApi,
            [NotNull] ILogger logger,
            [NotNull] IActionQueueConditions actionQueueConditions,
            [NotNull] TriggersDataContext triggersDataContext,
            [NotNull] ITelemetry telemetry)
        {
            if (soundManager == null)
            {
                throw new ArgumentNullException(nameof(soundManager));
            }
            if (trayPopups == null)
            {
                throw new ArgumentNullException(nameof(trayPopups));
            }
            if (wurmApi == null)
            {
                throw new ArgumentNullException(nameof(wurmApi));
            }
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }
            if (actionQueueConditions == null)
            {
                throw new ArgumentNullException(nameof(actionQueueConditions));
            }
            if (triggersDataContext == null)
            {
                throw new ArgumentNullException(nameof(triggersDataContext));
            }

            CharacterName = characterName;

            this.soundManager          = soundManager;
            this.trayPopups            = trayPopups;
            this.wurmApi               = wurmApi;
            this.logger                = logger;
            this.actionQueueConditions = actionQueueConditions;
            this.telemetry             = telemetry ?? throw new ArgumentNullException(nameof(telemetry));
            this.triggersConfig        = triggersDataContext.CharacterTriggersConfigs.GetOrCreate(characterName);

            foreach (var entity in triggersConfig.TriggerEntities.Values)
            {
                try
                {
                    triggers.Add(entity.TriggerId, BuildTrigger(entity));
                }
                catch (Exception exception)
                {
                    logger.Error(exception,
                                 string.Format("Error initializing trigger id {0}, name: {1}", entity.TriggerId, entity.Name));
                }
            }
        }
Example #13
0
 public CustomTimer(string persistentObjectId, IWurmApi wurmApi, ILogger logger, ISoundManager soundManager,
                    ITrayPopups trayPopups)
     : base(persistentObjectId, trayPopups, logger, wurmApi, soundManager)
 {
     if (logger == null)
     {
         throw new ArgumentNullException("logger");
     }
     this.logger = logger;
 }
Example #14
0
 public FormChoosePlayers(IReadOnlyCollection <string> currentPlayers, IWurmApi wurmApi)
 {
     InitializeComponent();
     string[] allPlayers = wurmApi.Characters.All.Select(character => character.Name.Capitalized)
                           .Union(currentPlayers).Distinct().ToArray();
     foreach (var player in allPlayers)
     {
         checkedListBoxPlayers.Items.Add(player, currentPlayers.Contains(player));
     }
     BuildResult();
 }
Example #15
0
 public LogsFeedManager(
     [NotNull] GrangerFeature parentModule,
     [NotNull] GrangerContext context,
     [NotNull] IWurmApi wurmApi,
     [NotNull] ILogger logger,
     [NotNull] ITrayPopups trayPopups,
     [NotNull] IWurmAssistantConfig wurmAssistantConfig,
     [NotNull] CreatureColorDefinitions creatureColorDefinitions,
     [NotNull] GrangerSettings grangerSettings,
     [NotNull] ITelemetry telemetry)
 {
     if (parentModule == null)
     {
         throw new ArgumentNullException(nameof(parentModule));
     }
     if (context == null)
     {
         throw new ArgumentNullException(nameof(context));
     }
     if (wurmApi == null)
     {
         throw new ArgumentNullException(nameof(wurmApi));
     }
     if (logger == null)
     {
         throw new ArgumentNullException(nameof(logger));
     }
     if (trayPopups == null)
     {
         throw new ArgumentNullException(nameof(trayPopups));
     }
     if (wurmAssistantConfig == null)
     {
         throw new ArgumentNullException(nameof(wurmAssistantConfig));
     }
     if (creatureColorDefinitions == null)
     {
         throw new ArgumentNullException(nameof(creatureColorDefinitions));
     }
     if (grangerSettings == null)
     {
         throw new ArgumentNullException(nameof(grangerSettings));
     }
     this.parentModule             = parentModule;
     this.context                  = context;
     this.wurmApi                  = wurmApi;
     this.logger                   = logger;
     this.trayPopups               = trayPopups;
     this.wurmAssistantConfig      = wurmAssistantConfig;
     this.creatureColorDefinitions = creatureColorDefinitions;
     this.grangerSettings          = grangerSettings;
     this.telemetry                = telemetry ?? throw new ArgumentNullException(nameof(telemetry));
 }
Example #16
0
 public WurmClientValidator([NotNull] IWurmApi wurmApi, [NotNull] IWurmAssistantConfig config)
 {
     if (wurmApi == null)
     {
         throw new ArgumentNullException(nameof(wurmApi));
     }
     if (config == null)
     {
         throw new ArgumentNullException(nameof(config));
     }
     this.wurmApi = wurmApi;
     this.config  = config;
 }
Example #17
0
 void Form1_Load(object sender, EventArgs e)
 {
     wurmApi = WurmApiFactory.Create(
         new WurmApiCreationOptions()
     {
         WurmApiLogger          = new WumrApiLogger(textBox1),
         WurmApiEventMarshaller = new Marshaller(this),
         WurmApiConfig          = new WurmApiConfig()
         {
             PersistenceMethod = WurmApiPersistenceMethod.FlatFiles
         }
     });
 }
Example #18
0
 public LogSearchFeature([NotNull] IWurmApi wurmApi, [NotNull] ILogger logger)
 {
     if (wurmApi == null)
     {
         throw new ArgumentNullException("wurmApi");
     }
     if (logger == null)
     {
         throw new ArgumentNullException("logger");
     }
     this.wurmApi = wurmApi;
     this.logger  = logger;
 }
 public SkillStatsFeature(IWurmApi wurmApi, ILogger logger)
 {
     if (wurmApi == null)
     {
         throw new ArgumentNullException("wurmApi");
     }
     if (logger == null)
     {
         throw new ArgumentNullException("logger");
     }
     this.wurmApi = wurmApi;
     this.logger  = logger;
     form         = new SkillStatsFeatureForm(this, wurmApi, logger);
 }
Example #20
0
 public LogSearchFeature([NotNull] IWurmApi wurmApi, [NotNull] ILogger logger, [NotNull] ITelemetry telemetry)
 {
     if (wurmApi == null)
     {
         throw new ArgumentNullException("wurmApi");
     }
     if (logger == null)
     {
         throw new ArgumentNullException("logger");
     }
     this.wurmApi   = wurmApi;
     this.logger    = logger;
     this.telemetry = telemetry ?? throw new ArgumentNullException(nameof(telemetry));
 }
Example #21
0
        public CraftingAssistantFeature(IWurmApi wurmApi, ILogger logger)
        {
            if (wurmApi == null)
            {
                throw new ArgumentNullException("wurmApi");
            }
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }
            this.wurmApi = wurmApi;
            this.logger  = logger;

            form = new CraftingAssistantForm(wurmApi, logger);
        }
Example #22
0
        public RevealCreaturesFeature(IWurmApi wurmApi, ILogger logger)
        {
            if (wurmApi == null)
            {
                throw new ArgumentNullException("wurmApi");
            }
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }
            this.wurmApi = wurmApi;
            this.logger  = logger;

            form = new RevealCreaturesForm(wurmApi, logger);
        }
Example #23
0
        public ServersEditorForm([NotNull] ServerInfoManager serverInfoManager, IWurmApi wurmApi)
        {
            if (serverInfoManager == null)
            {
                throw new ArgumentNullException("serverInfoManager");
            }
            this.serverInfoManager = serverInfoManager;
            InitializeComponent();

            currentMappings         = new BindingList <WurmServerInfo>(wurmApi.ServersList.All.ToArray());
            defaultsGrid.DataSource = currentMappings;

            customMappings = new BindingList <ServerInformation>(
                serverInfoManager.GetAllMappings().ToList());
            customGrid.DataSource = customMappings;
        }
        public LogSearchEventsParser(LogSearchParameters logSearchParameters, IWurmApi wurmApi, ILogger logger)
        {
            if (logSearchParameters == null)
            {
                throw new ArgumentNullException("logSearchParameters");
            }
            if (wurmApi == null)
            {
                throw new ArgumentNullException("wurmApi");
            }
            this.logSearchParameters = logSearchParameters;
            this.wurmApi             = wurmApi;

            CombatStatus = new CombatStatus(logSearchParameters.CharacterName);
            processor    = new CombatResultsProcessor(CombatStatus, logger, wurmApi);
        }
 public CustomTimersManagerForm([NotNull] IWurmApi wurmApi,
                                [NotNull] TimerDefinitions timerDefinitions)
 {
     if (wurmApi == null)
     {
         throw new ArgumentNullException("wurmApi");
     }
     if (timerDefinitions == null)
     {
         throw new ArgumentNullException("timerDefinitions");
     }
     this.wurmApi          = wurmApi;
     this.timerDefinitions = timerDefinitions;
     InitializeComponent();
     ReloadList();
 }
        public CraftingAssistantForm(IWurmApi wurmApi, ILogger logger)
        {
            if (wurmApi == null)
            {
                throw new ArgumentNullException("wurmApi");
            }
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }
            this.wurmApi = wurmApi;
            this.logger  = logger;
            InitializeComponent();

            gameCharactersCmb.Items.AddRange(
                wurmApi.Characters.All.Select(character => character.Name.Capitalized).Cast <object>().ToArray());
        }
        public CustomTimersManagerEditForm([NotNull] IWurmApi wurmApi, [NotNull] TimerDefinition definition,
                                           [NotNull] TimerDefinitions timerDefinitions)
        {
            if (wurmApi == null)
            {
                throw new ArgumentNullException("wurmApi");
            }
            if (definition == null)
            {
                throw new ArgumentNullException("definition");
            }
            if (timerDefinitions == null)
            {
                throw new ArgumentNullException("timerDefinitions");
            }
            this.wurmApi          = wurmApi;
            this.timerDefinitions = timerDefinitions;
            this.definition       = definition;

            InitializeComponent();

            foreach (var type in wurmApi.LogDefinitions.AllLogTypes)
            {
                comboBoxLogType.Items.Add(type);
            }
            comboBoxLogType.SelectedItem = LogType.Event;

            CustomTimerDefinition options = definition.CustomTimerConfig ?? new CustomTimerDefinition();

            textBoxTimerName.Text = definition.Name;
            if (options.TriggerConditions != null)
            {
                textBoxCond.Text = options.TriggerConditions[0].RegexPattern;
                if (!options.IsRegex)
                {
                    textBoxCond.Text = Regex.Unescape(textBoxCond.Text);
                }
                else
                {
                    checkBoxAsRegex.Checked = true;
                }
                comboBoxLogType.SelectedItem = options.TriggerConditions[0].LogType;
            }
            timeInputUControl2.Value    = options.Duration;
            checkBoxUptimeReset.Checked = options.ResetOnUptime;
        }
Example #28
0
        public TriggerBase([NotNull] TriggerEntity triggerEntity, [NotNull] ISoundManager soundManager, [NotNull] ITrayPopups trayPopups,
                           [NotNull] IWurmApi wurmApi, [NotNull] ILogger logger,
                           [NotNull] ITelemetry telemetry)
        {
            if (triggerEntity == null)
            {
                throw new ArgumentNullException("triggerEntity");
            }
            if (soundManager == null)
            {
                throw new ArgumentNullException("soundManager");
            }
            if (trayPopups == null)
            {
                throw new ArgumentNullException("trayPopups");
            }
            if (wurmApi == null)
            {
                throw new ArgumentNullException("wurmApi");
            }
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }
            this.TriggerEntity = triggerEntity;
            this.SoundManager  = soundManager;
            this.TrayPopups    = trayPopups;
            this.WurmApi       = wurmApi;
            this.Logger        = logger;
            this.telemetry     = telemetry ?? throw new ArgumentNullException(nameof(telemetry));

            MuteChecker = () => false;
            Active      = true;

            if (triggerEntity.HasSound)
            {
                Sound = new SoundNotifier(this, soundManager);
            }
            if (triggerEntity.HasPopup)
            {
                Popup = new PopupNotifier(this, trayPopups);
            }

            telemetry.TrackEvent($"Triggers: initialized trigger {this.GetType().Name}");
        }
Example #29
0
        public CombatResultsProcessor(CombatStatus combatStatus, ILogger logger, IWurmApi wurmApi)
        {
            if (combatStatus == null)
            {
                throw new ArgumentNullException("combatStatus");
            }
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }
            this.combatStatus = combatStatus;
            this.logger       = logger;

            damageEntryParser = new DamageEntryParser(logger);
            skillEntryParser  = new SkillEntryParser(wurmApi);

            SetupRules();
        }
Example #30
0
        public TriggerBaseConfig(TriggerBase trigger, [NotNull] IWurmApi wurmApi, [NotNull] ILogger logger)
        {
            if (wurmApi == null)
            {
                throw new ArgumentNullException("wurmApi");
            }
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }
            this.trigger = trigger;
            this.wurmApi = wurmApi;
            this.logger  = logger;
            InitializeComponent();
            toolTip1.SetToolTip(ResetOnCndHitChkbox, "Every time condition is hit, cooldown will be set to full duration (including when trigger is already on cooldown). Useful for new chat message triggers.".WrapLines());

            TriggerNameTbox.Text             = trigger.Name;
            ApplicableLogsDisplayTxtbox.Text = trigger.LogTypesAspect;
            foreach (var logType in wurmApi.LogDefinitions.AllLogTypes)
            {
                LogTypesChklist.Items.Add(logType, trigger.CheckLogType(logType));
            }
            if (trigger.LogTypesLocked)
            {
                LogTypesChklist.Enabled = false;
            }
            CooldownEnabledChkbox.Checked
                                        = ResetOnCndHitChkbox.Enabled
                                        = CooldownInput.Enabled
                                        = trigger.CooldownEnabled;
            CooldownInput.Value         = trigger.Cooldown;
            ResetOnCndHitChkbox.Checked = this.trigger.ResetOnConditonHit;
            if (this.trigger.DefaultDelayFunctionalityDisabled)
            {
                DelayChkbox.Enabled = DelayInput.Enabled = false;
            }
            else
            {
                DelayChkbox.Checked = DelayInput.Enabled = this.trigger.DelayEnabled;
                DelayInput.Value    = this.trigger.Delay;
            }

            initComplete = true;
        }
        void ConstructWurmApi(IWurmAssistantConfig config, LoggerFactory loggerFactory, IEventMarshaller eventMarshaller)
        {
            IWurmInstallDirectory wurmInstallDirectory = null;
            if (!string.IsNullOrWhiteSpace(config.WurmGameClientInstallDirectory))
            {
                wurmInstallDirectory = new WurmInstallDirectoryOverride()
                {
                    FullPath = config.WurmGameClientInstallDirectory
                };
            }

            WurmApiConfig wurmApiConfig = null;
            if (config.RunningPlatform != Platform.Unknown)
            {
                wurmApiConfig = new WurmApiConfig {Platform = config.RunningPlatform};
            }

            wurmApi = WurmApiFactory.Create(Path.Combine(config.DataDirectoryFullPath, "WurmApi"),
                loggerFactory.CreateWithGuiThreadMarshaller("WurmApi"),
                eventMarshaller,
                wurmInstallDirectory,
                wurmApiConfig);
            kernel.Bind<IWurmApi>().ToConstant(wurmApi);
        }
 public LogSearcherViewModel([NotNull] IWurmApi wurmApi)
 {
     if (wurmApi == null) throw new ArgumentNullException("wurmApi");
     this.wurmApi = wurmApi;
 }