72 lines
2.0 KiB
C#
72 lines
2.0 KiB
C#
///
|
|
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
|
|
///
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Xml.Serialization;
|
|
|
|
namespace Config.Entities
|
|
{
|
|
public interface IParamsProvider
|
|
{
|
|
/// <summary>
|
|
/// Get XML Serializer
|
|
/// </summary>
|
|
XmlSerializer GetSerializer();
|
|
|
|
string ComponentName { get; }
|
|
|
|
/// <summary>
|
|
/// Number of parameters
|
|
/// </summary>
|
|
int ParamsCount();
|
|
|
|
/// <summary>
|
|
/// Returns a parameter name
|
|
/// </summary>
|
|
/// <param name="ix">Zero based index of the parameter</param>
|
|
string ParamName(int ix);
|
|
|
|
/// <summary>
|
|
/// Returns a list of possible values of one parameter (ComboBox when editing) or null (Textbox when editing).
|
|
/// </summary>
|
|
/// <param name="ix">Zero based index of the parameter</param>
|
|
IList<string> ParamValues(int ix);
|
|
|
|
/// <summary>
|
|
/// Returns a parameter value in the string form
|
|
/// </summary>
|
|
/// <param name="ix">Zero based index of the parameter</param>
|
|
string ToString(int ix);
|
|
|
|
/// <summary>
|
|
/// Initialize values of all parameters
|
|
/// </summary>
|
|
void InitializeAll();
|
|
|
|
/// <summary>
|
|
/// Validates the string representation of a parameter
|
|
/// </summary>
|
|
/// <param name="ix">Zero based index of the parameter</param>
|
|
/// <param name="strValue">String representation of the parameter</param>
|
|
/// <param name="message">Warning message in case the string is wrong or null</param>
|
|
/// <returns>true = string is OK, false = string is wrong (see 'message')</returns>
|
|
bool ValidateParam(int ix, string strValue, out string message);
|
|
|
|
/// <summary>
|
|
/// Update the parameter from a string
|
|
/// </summary>
|
|
/// <param name="ix">Zero based index of the parameter</param>
|
|
/// <param name="strValue">String representation of the parameter</param>
|
|
CfgUpdateFlags UpdateParam(int ix, string strValue);
|
|
|
|
void UpdateEmbeddedDbEntity();
|
|
|
|
/// <summary>
|
|
/// Creates an object copy
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
IParamsProvider Clone();
|
|
}
|
|
}
|