2015-04-15 18:32:56 +00:00
|
|
|
|
///
|
2022-01-23 18:56:15 +00:00
|
|
|
|
/// Copyright (c) 2013-2021 Sensus Slovensko a.s.
|
2015-04-15 18:32:56 +00:00
|
|
|
|
///
|
2018-06-18 13:05:56 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
2018-05-10 11:25:46 +00:00
|
|
|
|
using System.Xml.Serialization;
|
|
|
|
|
|
|
2022-01-23 18:56:15 +00:00
|
|
|
|
namespace Common
|
2014-07-28 07:54:35 +00:00
|
|
|
|
{
|
|
|
|
|
|
public interface IParamsProvider
|
|
|
|
|
|
{
|
2018-05-10 11:25:46 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Get XML Serializer
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
XmlSerializer GetSerializer();
|
|
|
|
|
|
|
2014-07-28 07:54:35 +00:00
|
|
|
|
string ComponentName { get; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Number of parameters
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
int ParamsCount();
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2018-06-18 13:05:56 +00:00
|
|
|
|
/// Returns a parameter name
|
2014-07-28 07:54:35 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="ix">Zero based index of the parameter</param>
|
|
|
|
|
|
string ParamName(int ix);
|
|
|
|
|
|
|
2018-06-18 13:05:56 +00:00
|
|
|
|
/// <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>
|
2021-07-28 11:31:18 +00:00
|
|
|
|
ICollection<string> ParamValues(int ix);
|
2018-06-18 13:05:56 +00:00
|
|
|
|
|
2014-07-28 07:54:35 +00:00
|
|
|
|
/// <summary>
|
2018-06-18 13:05:56 +00:00
|
|
|
|
/// Returns a parameter value in the string form
|
2014-07-28 07:54:35 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="ix">Zero based index of the parameter</param>
|
2014-12-31 12:46:33 +00:00
|
|
|
|
string ToString(int ix);
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Initialize values of all parameters
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
void InitializeAll();
|
2014-07-28 07:54:35 +00:00
|
|
|
|
|
|
|
|
|
|
/// <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>
|
2018-06-18 13:05:56 +00:00
|
|
|
|
CfgUpdateFlags UpdateParam(int ix, string strValue);
|
2014-07-28 07:54:35 +00:00
|
|
|
|
|
2018-12-14 09:53:24 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Updates DB entities for related parameters
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns>true when successful</returns>
|
|
|
|
|
|
bool UpdateEmbeddedDbEntity();
|
2015-09-05 10:18:09 +00:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Creates an object copy
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
IParamsProvider Clone();
|
2014-07-28 07:54:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|