Class CalculationProvider
- Namespace
- Dynamicweb.Ecommerce.Products.FieldTypeProviders
- Assembly
- Dynamicweb.Ecommerce.dll
[AddInName("Dynamicweb.Ecommerce.FieldTypeProviders.CalculationProvider")]
[AddInLabel("Calculation FieldType Provider")]
[AddInActive(true)]
[Serializable]
public sealed class CalculationProvider : ProductFieldTypeProvider, IParameterOptions
- Inheritance
-
CalculationProvider
- Implements
- Inherited Members
Properties
DecimalPlaces
[AddInParameter("Decimal places")]
[AddInParameterEditor(typeof(IntegerNumberParameterEditor), "")]
[AddInParameterGroup("Source")]
public int DecimalPlaces { get; set; }
Property Value
ErrorMessage
public string ErrorMessage { get; }
Property Value
Expression
[AddInParameter("Expression")]
[AddInParameterEditor(typeof(LanguageExpressionParameterEditor), "info=Use {FieldSystemName1} to define placeholders. Use [{FieldSystemName1} * 2 + {FieldSystemName2}] syntax to define calculated placeholders. Example: The '{ProductName}' price with discount is [{ProductPrice} * 0.8]")]
public string Expression { get; set; }
Property Value
FieldOptionSource
[AddInParameter("FieldOptionSource")]
[AddInLabel("Use Listbox content")]
[AddInParameterEditor(typeof(RadioParameterEditor), "")]
public string FieldOptionSource { get; set; }
Property Value
Methods
GetAppenderInfo(string, Dictionary<string, string>)
public override string GetAppenderInfo(string languageId, Dictionary<string, string> settings)
Parameters
languageId
stringsettings
Dictionary<string, string>
Returns
GetAppenderInfo(string, string)
public override string GetAppenderInfo(string languageId, string settings)
Parameters
Returns
GetExpression(string)
public string GetExpression(string language)
Parameters
language
string
Returns
GetParameterOptions(string)
public IEnumerable<ParameterOption> GetParameterOptions(string parameterName)
Parameters
parameterName
string
Returns
GetProductValue(Product, object, string, Dictionary<string, string>)
public override object GetProductValue(Product product, object fieldValue, string languageId, Dictionary<string, string> settings)
Parameters
Returns
GetValue(object, string, Dictionary<string, string>)
public override object GetValue(object value, string languageId, Dictionary<string, string> settings)
Parameters
value
objectlanguageId
stringsettings
Dictionary<string, string>
Returns
IsCalculated(Dictionary<string, string>)
public override bool IsCalculated(Dictionary<string, string> settings)
Parameters
settings
Dictionary<string, string>
Returns
RenderAdditionalContent(TextWriter)
Renders the content of the additional.
public override void RenderAdditionalContent(TextWriter output)
Parameters
output
TextWriterThe output.