Class BaseBranchNameTokenRule
Base implementation to apply rules for branch name tokens.
Inheritance
Implements
Inherited Members
Namespace: SimpleVersion.Rules
Assembly: SimpleVersion.Core.dll
Syntax
public abstract class BaseBranchNameTokenRule : ITokenRule<string>
Constructors
| Improve this Doc View SourceBaseBranchNameTokenRule()
Initializes a new instance of the BaseBranchNameTokenRule class.
Declaration
protected BaseBranchNameTokenRule()
BaseBranchNameTokenRule(String)
Initializes a new instance of the BaseBranchNameTokenRule class with an optional regular expression pattern.
Declaration
protected BaseBranchNameTokenRule(string pattern)
Parameters
Type | Name | Description |
---|---|---|
System.String | pattern | The regular expression pattern to use when replacing characters. |
Properties
| Improve this Doc View SourcePattern
Gets or sets the resolved pattern used to replace non-required characters.
Declaration
public Regex Pattern { get; protected set; }
Property Value
Type | Description |
---|---|
System.Text.RegularExpressions.Regex |
Token
Gets the token string.
Declaration
public abstract string Token { get; protected set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceApply(IVersionContext, IEnumerable<String>)
Returns an enumerable of T
where the rule token
may have been applied of the token rule requires it.
Declaration
public virtual IEnumerable<string> Apply(IVersionContext context, IEnumerable<string> value)
Parameters
Type | Name | Description |
---|---|---|
IVersionContext | context | The context of the current calculation. |
System.Collections.Generic.IEnumerable<System.String> | value |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> | An enumerable of |
Resolve(IVersionContext, String)
Resolve the T
value using the given context.
The result will have any application of the token replaced.
Declaration
public virtual string Resolve(IVersionContext context, string value)
Parameters
Type | Name | Description |
---|---|---|
IVersionContext | context | The context of the current calculation. |
System.String | value |
Returns
Type | Description |
---|---|
System.String | An instance of |
ResolveBranchName(IVersionContext)
Resolves the branch name value for this rule.
Declaration
protected abstract string ResolveBranchName(IVersionContext context)
Parameters
Type | Name | Description |
---|---|---|
IVersionContext | context | The VersionContext of the current calculation. |
Returns
Type | Description |
---|---|
System.String | The branch name value. |