C# Class Nexus.Client.ModManagement.Scripting.XmlScript.ConditionalOptionTypeResolver

An option type that is dependent upon the state of external conditions.
Inheritance: IOptionTypeResolver
Show file Open project: NexusMods/NexusModManager-4.5

Public Methods

Method Description
AddPattern ( OptionType p_ptpType, ICondition p_cndCondition ) : void

Adds a pattern that returns the given option type if the given condition is fulfilled.

ConditionalOptionTypeResolver ( OptionType p_ptpDefaultType ) : System

A simple constructor that initializes the object with the given values.

ResolveOptionType ( ConditionStateManager p_csmStateManager ) : OptionType

Gets the plugin type.

The returned type is dependent upon external state. A list of patterns are matched against external state (e.g., installed files); the first pattern that is fulfilled determines the returned type. If no pattern is fulfilled, a default type if returned.

Method Details

AddPattern() public method

Adds a pattern that returns the given option type if the given condition is fulfilled.
public AddPattern ( OptionType p_ptpType, ICondition p_cndCondition ) : void
p_ptpType OptionType The type the pattern will return if the condition is fulfilled.
p_cndCondition ICondition The condition that must be fulfilled in order for the pattern /// to return the option type.
return void

ConditionalOptionTypeResolver() public method

A simple constructor that initializes the object with the given values.
public ConditionalOptionTypeResolver ( OptionType p_ptpDefaultType ) : System
p_ptpDefaultType OptionType The default to return /// if no patterns are fulfilled.
return System

ResolveOptionType() public method

Gets the plugin type.
The returned type is dependent upon external state. A list of patterns are matched against external state (e.g., installed files); the first pattern that is fulfilled determines the returned type. If no pattern is fulfilled, a default type if returned.
public ResolveOptionType ( ConditionStateManager p_csmStateManager ) : OptionType
p_csmStateManager ConditionStateManager The manager that tracks the currect install state.
return OptionType