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); }
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 CombatResultsForm(ICombatDataSource combatDataSource, FeatureSettings featureSettings, IProcessStarter processStarter, ILogger logger) { if (combatDataSource == null) { throw new ArgumentNullException("combatDataSource"); } if (featureSettings == null) { throw new ArgumentNullException("featureSettings"); } if (processStarter == null) { throw new ArgumentNullException("processStarter"); } if (logger == null) { throw new ArgumentNullException("logger"); } this.combatDataSource = combatDataSource; this.featureSettings = featureSettings; this.processStarter = processStarter; this.logger = logger; InitializeComponent(); combatDataSource.DataChanged += CombatResultsOnDataChanged; filter = new TextMatchFilter(objectListView1, "", StringComparison.InvariantCultureIgnoreCase); filter.Columns = new[] { olvColumn0 }; defaultFilter = objectListView1.ModelFilter; rowHeightNup.Value = objectListView1.RowHeight.ConstrainToRange(1, 10000); if (featureSettings.CombatResultViewState.Any()) { objectListView1.RestoreState(featureSettings.CombatResultViewState); } initialOlvState = objectListView1.SaveState(); RefreshData(); }