1013 lines
40 KiB
C#
1013 lines
40 KiB
C#
|
|
///
|
|||
|
|
/// Copyright (c) 2023 Sensus Slovensko a.s.
|
|||
|
|
///
|
|||
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Xml.Serialization;
|
|||
|
|
using Common;
|
|||
|
|
using Config;
|
|||
|
|
using Config.Entities;
|
|||
|
|
using TBF.Resources;
|
|||
|
|
using TBF.Rig.Generic;
|
|||
|
|
|
|||
|
|
namespace TBF.Rig.DataEntry.Uni
|
|||
|
|
{
|
|||
|
|
public enum Sz
|
|||
|
|
{
|
|||
|
|
[Description("Small")] S,
|
|||
|
|
[Description("Medium")] M,
|
|||
|
|
[Description("Large")] L,
|
|||
|
|
Count,
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg, IParamsProvider
|
|||
|
|
{
|
|||
|
|
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(EntryFormCfg) })[0];
|
|||
|
|
public override XmlSerializer GetSerializer() { return Serializer; }
|
|||
|
|
|
|||
|
|
public IComponentCfgCtrl GetControl(IList<Config.Entities.Component> cmpntEntities)
|
|||
|
|
{
|
|||
|
|
return new Configs.ParamsProvider.ComponentCfgCtrl(this, null);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
///
|
|||
|
|
/// Serialized parameters
|
|||
|
|
///
|
|||
|
|
public bool BgShowForm; /// 0
|
|||
|
|
public string BgTitle; /// 1
|
|||
|
|
public Sz BgSize; /// 2
|
|||
|
|
// int BgItemsCount; /// 3
|
|||
|
|
// int BgColumnsCount; /// 4
|
|||
|
|
public bool BgIsLrOrder; /// 5
|
|||
|
|
public bool BgIsVertArrangement; /// 6
|
|||
|
|
public string BgFormCloseKeys; /// 7
|
|||
|
|
|
|||
|
|
public bool EnShowForm; /// 8
|
|||
|
|
public string EnTitle; /// 9
|
|||
|
|
public Sz EnSize; /// 10
|
|||
|
|
// int EnItemsCount; /// 11
|
|||
|
|
// int EnColumnsCount; /// 12
|
|||
|
|
public bool EnIsLrOrder; /// 13
|
|||
|
|
public bool EnIsVertArrangement; /// 14
|
|||
|
|
public string EnFormCloseKeys; /// 15
|
|||
|
|
|
|||
|
|
public bool TestStartEndShowForm; /// 16
|
|||
|
|
public string TestTitle; /// 17
|
|||
|
|
public Sz TestSize; /// 18
|
|||
|
|
// int TestColumnsCount; /// 19
|
|||
|
|
public bool TestStartBoxAlwaysEn; /// 20
|
|||
|
|
public bool TestIsLrOrder; /// 21
|
|||
|
|
public bool TestIsVertArrangement; /// 22
|
|||
|
|
public string TestFormCloseKeys; /// 23
|
|||
|
|
|
|||
|
|
public Ct[] BgItemContent; /// 24 + 4 * ix
|
|||
|
|
public string[] BgItemCaption; /// 25 + 4 * ix
|
|||
|
|
public Ac[] BgItemAction; /// 26 + 4 * ix
|
|||
|
|
public int[] BgItemWidth; /// 27 + 4 * ix
|
|||
|
|
|
|||
|
|
public Ct[] BgColumnContent; /// 24 + 4 * ix
|
|||
|
|
public string[] BgColumnCaption; /// 25 + 4 * ix
|
|||
|
|
public Ac[] BgColumnAction; /// 26 + 4 * ix
|
|||
|
|
public int[] BgColumnWidth; /// 27 + 4 * ix
|
|||
|
|
|
|||
|
|
public Ct[] EnItemContent; /// 24 + 4 * ix
|
|||
|
|
public string[] EnItemCaption; /// 25 + 4 * ix
|
|||
|
|
public Ac[] EnItemAction; /// 26 + 4 * ix
|
|||
|
|
public int[] EnItemWidth; /// 27 + 4 * ix
|
|||
|
|
|
|||
|
|
public Ct[] EnColumnContent; /// 24 + 4 * ix
|
|||
|
|
public string[] EnColumnCaption; /// 25 + 4 * ix
|
|||
|
|
public Ac[] EnColumnAction; /// 26 + 4 * ix
|
|||
|
|
public int[] EnColumnWidth; /// 27 + 4 * ix
|
|||
|
|
|
|||
|
|
public Ct[] TestColumnContent; /// 24 + 4 * ix
|
|||
|
|
public string[] TestColumnCaption; /// 25 + 4 * ix
|
|||
|
|
public Ac[] TestColumnAction; /// 26 + 4 * ix
|
|||
|
|
public int[] TestColumnWidth; /// 27 + 4 * ix
|
|||
|
|
|
|||
|
|
///
|
|||
|
|
/// Not serialized
|
|||
|
|
///
|
|||
|
|
int oriBgItemsCount = -1;
|
|||
|
|
int oriBgColumnsCount = -1;
|
|||
|
|
int oriEnItemsCount = -1;
|
|||
|
|
int oriEnColumnsCount = -1;
|
|||
|
|
int oriTestColumnsCount = -1;
|
|||
|
|
|
|||
|
|
///
|
|||
|
|
/// Wrappers
|
|||
|
|
///
|
|||
|
|
public int GetBgItemsCount() { return (BgItemContent == null) ? 0 : BgItemContent.Length; }
|
|||
|
|
public int GetBgColumnsCount() { return (BgColumnContent == null) ? 0 : BgColumnContent.Length; }
|
|||
|
|
public int GetEnItemsCount() { return (EnItemContent == null) ? 0 : EnItemContent.Length; }
|
|||
|
|
public int GetEnColumnsCount() { return (EnColumnContent == null) ? 0 : EnColumnContent.Length; }
|
|||
|
|
public int GetTestColumnsCount() { return (TestColumnContent == null) ? 0 : TestColumnContent.Length; }
|
|||
|
|
///
|
|||
|
|
void SetBgItemsCount(int newCount)
|
|||
|
|
{
|
|||
|
|
if (oriBgItemsCount < 0) oriBgItemsCount = GetBgItemsCount();
|
|||
|
|
if (newCount == GetBgItemsCount()) return;
|
|||
|
|
|
|||
|
|
int oldCount = (BgItemContent == null) ? 0 : BgItemContent.Length;
|
|||
|
|
var oldContent = BgItemContent;
|
|||
|
|
var oldCaption = BgItemCaption;
|
|||
|
|
var oldAction = BgItemAction;
|
|||
|
|
var oldWidth = BgItemWidth;
|
|||
|
|
|
|||
|
|
BgItemContent = new Ct[newCount];
|
|||
|
|
BgItemCaption = new string[newCount];
|
|||
|
|
BgItemAction = new Ac[newCount];
|
|||
|
|
BgItemWidth = new int[newCount];
|
|||
|
|
|
|||
|
|
for (int i = 0; i < newCount; i++)
|
|||
|
|
{
|
|||
|
|
if (i < oldCount)
|
|||
|
|
{
|
|||
|
|
BgItemContent[i] = oldContent[i];
|
|||
|
|
BgItemCaption[i] = oldCaption[i];
|
|||
|
|
BgItemAction[i] = oldAction[i];
|
|||
|
|
BgItemWidth[i] = oldWidth[i];
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
BgItemContent[i] = Ct.None;
|
|||
|
|
BgItemCaption[i] = string.Empty;
|
|||
|
|
BgItemAction[i] = Ac.Clear;
|
|||
|
|
BgItemWidth[i] = 0;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
///
|
|||
|
|
void SetBgColumnsCount(int newCount)
|
|||
|
|
{
|
|||
|
|
if (oriBgColumnsCount < 0) oriBgColumnsCount = GetBgColumnsCount();
|
|||
|
|
if (newCount == GetBgColumnsCount()) return;
|
|||
|
|
|
|||
|
|
int oldCount = (BgColumnContent == null) ? 0 : BgColumnContent.Length;
|
|||
|
|
var oldContent = BgColumnContent;
|
|||
|
|
var oldCaption = BgColumnCaption;
|
|||
|
|
var oldAction = BgColumnAction;
|
|||
|
|
var oldWidth = BgColumnWidth;
|
|||
|
|
|
|||
|
|
BgColumnContent = new Ct[newCount];
|
|||
|
|
BgColumnCaption = new string[newCount];
|
|||
|
|
BgColumnAction = new Ac[newCount];
|
|||
|
|
BgColumnWidth = new int[newCount];
|
|||
|
|
|
|||
|
|
for (int i = 0; i < newCount; i++)
|
|||
|
|
{
|
|||
|
|
if (i < oldCount)
|
|||
|
|
{
|
|||
|
|
BgColumnContent[i] = oldContent[i];
|
|||
|
|
BgColumnCaption[i] = oldCaption[i];
|
|||
|
|
BgColumnAction[i] = oldAction[i];
|
|||
|
|
BgColumnWidth[i] = oldWidth[i];
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
BgColumnContent[i] = Ct.None;
|
|||
|
|
BgColumnCaption[i] = string.Empty;
|
|||
|
|
BgColumnAction[i] = Ac.Clear;
|
|||
|
|
BgColumnWidth[i] = 0;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
///
|
|||
|
|
void SetEnItemsCount(int newCount)
|
|||
|
|
{
|
|||
|
|
if (oriEnItemsCount < 0) oriEnItemsCount = GetEnItemsCount();
|
|||
|
|
if (newCount == GetEnItemsCount()) return;
|
|||
|
|
|
|||
|
|
int oldCount = (EnItemContent == null) ? 0 : EnItemContent.Length;
|
|||
|
|
var oldContent = EnItemContent;
|
|||
|
|
var oldCaption = EnItemCaption;
|
|||
|
|
var oldAction = EnItemAction;
|
|||
|
|
var oldWidth = EnItemWidth;
|
|||
|
|
|
|||
|
|
EnItemContent = new Ct[newCount];
|
|||
|
|
EnItemCaption = new string[newCount];
|
|||
|
|
EnItemAction = new Ac[newCount];
|
|||
|
|
EnItemWidth = new int[newCount];
|
|||
|
|
|
|||
|
|
for (int i = 0; i < newCount; i++)
|
|||
|
|
{
|
|||
|
|
if (i < oldCount)
|
|||
|
|
{
|
|||
|
|
EnItemContent[i] = oldContent[i];
|
|||
|
|
EnItemCaption[i] = oldCaption[i];
|
|||
|
|
EnItemAction[i] = oldAction[i];
|
|||
|
|
EnItemWidth[i] = oldWidth[i];
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
EnItemContent[i] = Ct.None;
|
|||
|
|
EnItemCaption[i] = string.Empty;
|
|||
|
|
EnItemAction[i] = Ac.Clear;
|
|||
|
|
EnItemWidth[i] = 0;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
///
|
|||
|
|
void SetEnColumnsCount(int newCount)
|
|||
|
|
{
|
|||
|
|
if (oriEnColumnsCount < 0) oriEnColumnsCount = GetEnColumnsCount();
|
|||
|
|
if (newCount == GetEnColumnsCount()) return;
|
|||
|
|
|
|||
|
|
int oldCount = (EnColumnContent == null) ? 0 : EnColumnContent.Length;
|
|||
|
|
var oldContent = EnColumnContent;
|
|||
|
|
var oldCaption = EnColumnCaption;
|
|||
|
|
var oldAction = EnColumnAction;
|
|||
|
|
var oldWidth = EnColumnWidth;
|
|||
|
|
|
|||
|
|
EnColumnContent = new Ct[newCount];
|
|||
|
|
EnColumnCaption = new string[newCount];
|
|||
|
|
EnColumnAction = new Ac[newCount];
|
|||
|
|
EnColumnWidth = new int[newCount];
|
|||
|
|
|
|||
|
|
for (int i = 0; i < newCount; i++)
|
|||
|
|
{
|
|||
|
|
if (i < oldCount)
|
|||
|
|
{
|
|||
|
|
EnColumnContent[i] = oldContent[i];
|
|||
|
|
EnColumnCaption[i] = oldCaption[i];
|
|||
|
|
EnColumnAction[i] = oldAction[i];
|
|||
|
|
EnColumnWidth[i] = oldWidth[i];
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
EnColumnContent[i] = Ct.None;
|
|||
|
|
EnColumnCaption[i] = string.Empty;
|
|||
|
|
EnColumnAction[i] = Ac.Clear;
|
|||
|
|
EnColumnWidth[i] = 0;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
///
|
|||
|
|
void SetTestColumnsCount(int newCount)
|
|||
|
|
{
|
|||
|
|
if (oriTestColumnsCount < 0) oriTestColumnsCount = GetTestColumnsCount();
|
|||
|
|
if (newCount == GetTestColumnsCount()) return;
|
|||
|
|
|
|||
|
|
int oldCount = (TestColumnContent == null) ? 0 : TestColumnContent.Length;
|
|||
|
|
var oldContent = TestColumnContent;
|
|||
|
|
var oldCaption = TestColumnCaption;
|
|||
|
|
var oldAction = TestColumnAction;
|
|||
|
|
var oldWidth = TestColumnWidth;
|
|||
|
|
|
|||
|
|
TestColumnContent = new Ct[newCount];
|
|||
|
|
TestColumnCaption = new string[newCount];
|
|||
|
|
TestColumnAction = new Ac[newCount];
|
|||
|
|
TestColumnWidth = new int[newCount];
|
|||
|
|
|
|||
|
|
for (int i = 0; i < newCount; i++)
|
|||
|
|
{
|
|||
|
|
if (i < oldCount)
|
|||
|
|
{
|
|||
|
|
TestColumnContent[i] = oldContent[i];
|
|||
|
|
TestColumnCaption[i] = oldCaption[i];
|
|||
|
|
TestColumnAction[i] = oldAction[i];
|
|||
|
|
TestColumnWidth[i] = oldWidth[i];
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
TestColumnContent[i] = Ct.None;
|
|||
|
|
TestColumnCaption[i] = string.Empty;
|
|||
|
|
TestColumnAction[i] = Ac.Clear;
|
|||
|
|
TestColumnWidth[i] = 0;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
///
|
|||
|
|
int GetOriBgItemsCount()
|
|||
|
|
{
|
|||
|
|
if (oriBgItemsCount < 0) oriBgItemsCount = GetBgItemsCount();
|
|||
|
|
return oriBgItemsCount;
|
|||
|
|
}
|
|||
|
|
int GetOriBgColumnsCount()
|
|||
|
|
{
|
|||
|
|
if (oriBgColumnsCount < 0) oriBgColumnsCount = GetBgColumnsCount();
|
|||
|
|
return oriBgColumnsCount;
|
|||
|
|
}
|
|||
|
|
int GetOriEnItemsCount()
|
|||
|
|
{
|
|||
|
|
if (oriEnItemsCount < 0) oriEnItemsCount = GetEnItemsCount();
|
|||
|
|
return oriEnItemsCount;
|
|||
|
|
}
|
|||
|
|
int GetOriEnColumnsCount()
|
|||
|
|
{
|
|||
|
|
if (oriEnColumnsCount < 0) oriEnColumnsCount = GetEnColumnsCount();
|
|||
|
|
return oriEnColumnsCount;
|
|||
|
|
}
|
|||
|
|
int GetOriTestColumnsCount()
|
|||
|
|
{
|
|||
|
|
if (oriTestColumnsCount < 0) oriTestColumnsCount = GetTestColumnsCount();
|
|||
|
|
return oriTestColumnsCount;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
///
|
|||
|
|
/// Private parameterless constructor invoked by all other (public) constructors
|
|||
|
|
///
|
|||
|
|
EntryFormCfg() { }
|
|||
|
|
|
|||
|
|
public EntryFormCfg(IComponentFactory factory, string name)
|
|||
|
|
: this()
|
|||
|
|
{
|
|||
|
|
this.Factory = factory;
|
|||
|
|
this.Name = name;
|
|||
|
|
ParentName = string.Empty;
|
|||
|
|
InitializeAll();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public string ComponentName { get { return Name; } }
|
|||
|
|
|
|||
|
|
public void InitializeAll()
|
|||
|
|
{
|
|||
|
|
BgShowForm = true;
|
|||
|
|
BgTitle = "Enter water meter data";
|
|||
|
|
BgSize = Sz.M;
|
|||
|
|
BgIsLrOrder = false;
|
|||
|
|
BgIsVertArrangement = false;
|
|||
|
|
BgFormCloseKeys = string.Empty;
|
|||
|
|
|
|||
|
|
EnShowForm = false;
|
|||
|
|
EnTitle = "Enter water meter data";
|
|||
|
|
EnSize = Sz.M;
|
|||
|
|
EnIsLrOrder = false;
|
|||
|
|
EnIsVertArrangement = false;
|
|||
|
|
EnFormCloseKeys = string.Empty;
|
|||
|
|
|
|||
|
|
TestStartEndShowForm = true;
|
|||
|
|
TestTitle = "Enter states of water meters";
|
|||
|
|
TestSize = Sz.M;
|
|||
|
|
TestStartBoxAlwaysEn = false;
|
|||
|
|
TestIsLrOrder = false;
|
|||
|
|
TestIsVertArrangement = false;
|
|||
|
|
TestFormCloseKeys = string.Empty;
|
|||
|
|
|
|||
|
|
BgItemContent = new Ct[1] { Ct.BatchAndWmOrder };
|
|||
|
|
BgItemCaption = new string[1] { "Order nr." };
|
|||
|
|
BgItemAction = new Ac[1] { Ac.Clear };
|
|||
|
|
BgItemWidth = new int[1] { 200 };
|
|||
|
|
|
|||
|
|
BgColumnContent = new Ct[1] { Ct.SerialNr };
|
|||
|
|
BgColumnCaption = new string[1] { "S/N" };
|
|||
|
|
BgColumnAction = new Ac[1] { Ac.Clear };
|
|||
|
|
BgColumnWidth = new int[1] { 200 };
|
|||
|
|
|
|||
|
|
EnItemContent = new Ct[2] { Ct.BatchAndWmOrder, Ct.BatchRemark };
|
|||
|
|
EnItemCaption = new string[2] { "Order nr.","Remark" };
|
|||
|
|
EnItemAction = new Ac[2] { Ac.LoadReadOnly, Ac.HistoryLast };
|
|||
|
|
EnItemWidth = new int[2] { 200, 200 };
|
|||
|
|
|
|||
|
|
EnColumnContent = new Ct[2] { Ct.SerialNr, Ct.EndState };
|
|||
|
|
EnColumnCaption = new string[2] { "S/N", "End state" };
|
|||
|
|
EnColumnAction = new Ac[2] { Ac.LoadReadOnly, Ac.Clear };
|
|||
|
|
EnColumnWidth = new int[2] { 200, 200 };
|
|||
|
|
|
|||
|
|
TestColumnContent = new Ct[3] { Ct.SerialNr, Ct.StartState, Ct.EndState };
|
|||
|
|
TestColumnCaption = new string[3] { "S/N", "Start state", "End state" };
|
|||
|
|
TestColumnAction = new Ac[3] { Ac.LoadReadOnly, Ac.Clear, Ac.Clear };
|
|||
|
|
TestColumnWidth = new int[3] { 200, 200, 200 };
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
string[] paramNames = new string[]
|
|||
|
|
{
|
|||
|
|
"Beginning: Show form",
|
|||
|
|
"Beginning: Form title",
|
|||
|
|
"Beginning: Font ize",
|
|||
|
|
"Beginning: Common items count",
|
|||
|
|
"Beginning: Columns count",
|
|||
|
|
"Beginning: Left-to-right order",
|
|||
|
|
"Beginning: Vertical arrangement",
|
|||
|
|
"Beginning: Keys to close the form",
|
|||
|
|
|
|||
|
|
"End: Show form",
|
|||
|
|
"End: Form title",
|
|||
|
|
"End: Font size",
|
|||
|
|
"End: Common items count",
|
|||
|
|
"End: Columns count",
|
|||
|
|
"End: Left-to-right order",
|
|||
|
|
"End: Vertical arrangement",
|
|||
|
|
"End: Keys to close the form",
|
|||
|
|
|
|||
|
|
"Test start/end: Show form",
|
|||
|
|
"Test start/end: Form title",
|
|||
|
|
"Test start/end: Font size",
|
|||
|
|
"Test start/end: Columns count",
|
|||
|
|
"Test start/end: Start text box always enabled",
|
|||
|
|
"Test start/end: Left-to-right order",
|
|||
|
|
"Test start/end: Vertical arrangement",
|
|||
|
|
"Test start/end: Keys to close the form",
|
|||
|
|
};
|
|||
|
|
public string ParamName(int i)
|
|||
|
|
{
|
|||
|
|
if (i < paramNames.Length) return paramNames[i];
|
|||
|
|
int ix = i - paramNames.Length;
|
|||
|
|
|
|||
|
|
if (ix < 4 * GetOriBgItemsCount())
|
|||
|
|
{
|
|||
|
|
int j = ix / 4 + 1;
|
|||
|
|
switch (ix % 4)
|
|||
|
|
{
|
|||
|
|
case 0: return string.Format("Beginning: Item {0} content", j);
|
|||
|
|
case 1: return string.Format("Beginning: Item {0} caption", j);
|
|||
|
|
case 2: return string.Format("Beginning: Item {0} action", j);
|
|||
|
|
case 3: return string.Format("Beginning: Item {0} width", j);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
ix -= 4 * GetOriBgItemsCount();
|
|||
|
|
|
|||
|
|
if (ix < 4 * GetOriBgColumnsCount())
|
|||
|
|
{
|
|||
|
|
char c = Convert.ToChar(ix / 4 + 65);
|
|||
|
|
switch (ix % 4)
|
|||
|
|
{
|
|||
|
|
case 0: return string.Format("Beginning: Column {0} content", c);
|
|||
|
|
case 1: return string.Format("Beginning: Column {0} caption", c);
|
|||
|
|
case 2: return string.Format("Beginning: Column {0} action", c);
|
|||
|
|
case 3: return string.Format("Beginning: Column {0} width", c);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
ix -= 4 * GetOriBgColumnsCount();
|
|||
|
|
|
|||
|
|
if (ix < 4 * GetOriEnItemsCount())
|
|||
|
|
{
|
|||
|
|
int j = ix / 4 + 1;
|
|||
|
|
switch (ix % 4)
|
|||
|
|
{
|
|||
|
|
case 0: return string.Format("End: Item {0} content", j);
|
|||
|
|
case 1: return string.Format("End: Item {0} caption", j);
|
|||
|
|
case 2: return string.Format("End: Item {0} action", j);
|
|||
|
|
case 3: return string.Format("End: Item {0} width", j);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
ix -= 4 * GetOriEnItemsCount();
|
|||
|
|
|
|||
|
|
if (ix < 4 * GetOriEnColumnsCount())
|
|||
|
|
{
|
|||
|
|
char c = Convert.ToChar(ix / 4 + 65);
|
|||
|
|
switch (ix % 4)
|
|||
|
|
{
|
|||
|
|
case 0: return string.Format("End: Column {0} content", c);
|
|||
|
|
case 1: return string.Format("End: Column {0} caption", c);
|
|||
|
|
case 2: return string.Format("End: Column {0} action", c);
|
|||
|
|
case 3: return string.Format("End: Column {0} width", c);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
ix -= 4 * GetOriEnColumnsCount();
|
|||
|
|
|
|||
|
|
if (ix < 4 * GetOriTestColumnsCount())
|
|||
|
|
{
|
|||
|
|
char c = Convert.ToChar(ix / 4 + 65);
|
|||
|
|
switch (ix % 4)
|
|||
|
|
{
|
|||
|
|
case 0: return string.Format("Test start/end: Column {0} content", c);
|
|||
|
|
case 1: return string.Format("Test start/end: Column {0} caption", c);
|
|||
|
|
case 2: return string.Format("Test start/end: Column {0} action", c);
|
|||
|
|
case 3: return string.Format("Test start/end: Column {0} width", c);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return string.Empty;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public int ParamsCount()
|
|||
|
|
{
|
|||
|
|
int itemsCount = GetOriBgItemsCount() + GetOriBgColumnsCount()
|
|||
|
|
+ GetOriEnItemsCount() + GetOriEnColumnsCount() + GetOriTestColumnsCount();
|
|||
|
|
return paramNames.Length + 4 * itemsCount;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public ICollection<string> ParamValues(int i)
|
|||
|
|
{
|
|||
|
|
var list = new List<string>();
|
|||
|
|
|
|||
|
|
if (i < paramNames.Length)
|
|||
|
|
{
|
|||
|
|
switch (i)
|
|||
|
|
{
|
|||
|
|
case 0:
|
|||
|
|
case 5:
|
|||
|
|
case 6:
|
|||
|
|
case 8:
|
|||
|
|
case 13:
|
|||
|
|
case 14:
|
|||
|
|
case 16:
|
|||
|
|
case 20:
|
|||
|
|
case 21:
|
|||
|
|
case 22:
|
|||
|
|
return new string[] { Strings.yes, Strings.no };
|
|||
|
|
case 2:
|
|||
|
|
case 10:
|
|||
|
|
case 18:
|
|||
|
|
for (Sz sz = 0; sz < Sz.Count; sz++) list.Add(sz.ToDescription());
|
|||
|
|
return list;
|
|||
|
|
default:
|
|||
|
|
return null;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
i -= paramNames.Length;
|
|||
|
|
|
|||
|
|
switch (i % 4)
|
|||
|
|
{
|
|||
|
|
case 0:
|
|||
|
|
bool isCommon = (i < 4 * GetOriBgItemsCount())
|
|||
|
|
|| (i >= 4 * (GetOriBgItemsCount() + GetOriBgColumnsCount())
|
|||
|
|
&& i < 4 * (GetOriBgItemsCount() + GetOriBgColumnsCount() + GetOriEnItemsCount()));
|
|||
|
|
if (isCommon)
|
|||
|
|
{
|
|||
|
|
return new string[]
|
|||
|
|
{
|
|||
|
|
Ct.None.ToDescription(),
|
|||
|
|
Ct.YearOfCalibration.ToDescription(),
|
|||
|
|
Ct.ArchivePath.ToDescription(),
|
|||
|
|
Ct.BatchOrder.ToDescription(),
|
|||
|
|
Ct.BatchAndWmOrder.ToDescription(),
|
|||
|
|
Ct.BatchRemark.ToDescription(),
|
|||
|
|
Ct.BatchAndWmRemark.ToDescription(),
|
|||
|
|
};
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
return new string[]
|
|||
|
|
{
|
|||
|
|
Ct.None.ToDescription(),
|
|||
|
|
Ct.SerialNr.ToDescription(),
|
|||
|
|
Ct.SerialNrAux.ToDescription(),
|
|||
|
|
Ct.RadioAddress.ToDescription(),
|
|||
|
|
Ct.YearOfCalibration.ToDescription(),
|
|||
|
|
Ct.StartState.ToDescription(),
|
|||
|
|
Ct.EndState.ToDescription(),
|
|||
|
|
Ct.ArchivePath.ToDescription(),
|
|||
|
|
Ct.WmOrder.ToDescription(),
|
|||
|
|
Ct.WmRemark.ToDescription(),
|
|||
|
|
};
|
|||
|
|
}
|
|||
|
|
case 2:
|
|||
|
|
for (Ac a = 0; a < Ac.Count; a++) list.Add(a.ToDescription());
|
|||
|
|
return list;
|
|||
|
|
case 1:
|
|||
|
|
case 3:
|
|||
|
|
default:
|
|||
|
|
return null;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public string ToString(int i)
|
|||
|
|
{
|
|||
|
|
if (i < 0)
|
|||
|
|
{
|
|||
|
|
return string.Format("Name={0}, Show cycle beginning form={1}, Show cycle end form={2}",
|
|||
|
|
Name, BgShowForm, EnShowForm);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (i < paramNames.Length)
|
|||
|
|
{
|
|||
|
|
switch (i)
|
|||
|
|
{
|
|||
|
|
case 0: return BgShowForm ? Strings.yes : Strings.no;
|
|||
|
|
case 1: return BgTitle;
|
|||
|
|
case 2: return BgSize.ToDescription();
|
|||
|
|
case 3: return GetBgItemsCount().ToString();
|
|||
|
|
case 4: return GetBgColumnsCount().ToString();
|
|||
|
|
case 5: return BgIsLrOrder ? Strings.yes : Strings.no;
|
|||
|
|
case 6: return BgIsVertArrangement ? Strings.yes : Strings.no;
|
|||
|
|
case 7: return BgFormCloseKeys;
|
|||
|
|
|
|||
|
|
case 8: return EnShowForm ? Strings.yes : Strings.no;
|
|||
|
|
case 9: return EnTitle;
|
|||
|
|
case 10: return EnSize.ToDescription();
|
|||
|
|
case 11: return GetEnItemsCount().ToString();
|
|||
|
|
case 12: return GetEnColumnsCount().ToString();
|
|||
|
|
case 13: return EnIsLrOrder ? Strings.yes : Strings.no;
|
|||
|
|
case 14: return EnIsVertArrangement ? Strings.yes : Strings.no;
|
|||
|
|
case 15: return EnFormCloseKeys;
|
|||
|
|
|
|||
|
|
case 16: return TestStartEndShowForm ? Strings.yes : Strings.no;
|
|||
|
|
case 17: return TestTitle;
|
|||
|
|
case 18: return TestSize.ToDescription();
|
|||
|
|
case 19: return GetTestColumnsCount().ToString();
|
|||
|
|
case 20: return TestStartBoxAlwaysEn ? Strings.yes : Strings.no;
|
|||
|
|
case 21: return TestIsLrOrder ? Strings.yes : Strings.no;
|
|||
|
|
case 22: return TestIsVertArrangement ? Strings.yes : Strings.no;
|
|||
|
|
case 23: return TestFormCloseKeys;
|
|||
|
|
|
|||
|
|
default: return string.Empty;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
int ix = i - paramNames.Length;
|
|||
|
|
|
|||
|
|
if (ix < 4 * GetOriBgItemsCount())
|
|||
|
|
{
|
|||
|
|
int j = ix / 4;
|
|||
|
|
switch (ix % 4)
|
|||
|
|
{
|
|||
|
|
case 0: return (j < GetBgItemsCount()) ? BgItemContent[j].ToDescription() : Ct.None.ToDescription();
|
|||
|
|
case 1: return (j < GetBgItemsCount()) ? BgItemCaption[j] : string.Empty;
|
|||
|
|
case 2: return (j < GetBgItemsCount()) ? BgItemAction[j].ToDescription() : Ac.Clear.ToDescription();
|
|||
|
|
case 3: return (j < GetBgItemsCount()) ? BgItemWidth[j].ToString() : "0";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
ix -= 4 * GetOriBgItemsCount();
|
|||
|
|
|
|||
|
|
if (ix < 4 * GetOriBgColumnsCount())
|
|||
|
|
{
|
|||
|
|
int j = ix / 4;
|
|||
|
|
switch (ix % 4)
|
|||
|
|
{
|
|||
|
|
case 0: return (j < GetBgColumnsCount()) ? BgColumnContent[j].ToDescription() : Ct.None.ToDescription();
|
|||
|
|
case 1: return (j < GetBgColumnsCount()) ? BgColumnCaption[j] : string.Empty;
|
|||
|
|
case 2: return (j < GetBgColumnsCount()) ? BgColumnAction[j].ToDescription() : Ac.Clear.ToDescription();
|
|||
|
|
case 3: return (j < GetBgColumnsCount()) ? BgColumnWidth[j].ToString() : "0";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
ix -= 4 * GetOriBgColumnsCount();
|
|||
|
|
|
|||
|
|
if (ix < 4 * GetOriEnItemsCount())
|
|||
|
|
{
|
|||
|
|
int j = ix / 4;
|
|||
|
|
switch (ix % 4)
|
|||
|
|
{
|
|||
|
|
case 0: return (j < GetEnItemsCount()) ? EnItemContent[j].ToDescription() : Ct.None.ToDescription();
|
|||
|
|
case 1: return (j < GetEnItemsCount()) ? EnItemCaption[j] : string.Empty;
|
|||
|
|
case 2: return (j < GetEnItemsCount()) ? EnItemAction[j].ToDescription() : Ac.Clear.ToDescription();
|
|||
|
|
case 3: return (j < GetEnItemsCount()) ? EnItemWidth[j].ToString() : "0";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
ix -= 4 * GetOriEnItemsCount();
|
|||
|
|
|
|||
|
|
if (ix < 4 * GetOriEnColumnsCount())
|
|||
|
|
{
|
|||
|
|
int j = ix / 4;
|
|||
|
|
switch (ix % 4)
|
|||
|
|
{
|
|||
|
|
case 0: return (j < GetEnColumnsCount()) ? EnColumnContent[j].ToDescription() : Ct.None.ToDescription();
|
|||
|
|
case 1: return (j < GetEnColumnsCount()) ? EnColumnCaption[j] : string.Empty;
|
|||
|
|
case 2: return (j < GetEnColumnsCount()) ? EnColumnAction[j].ToDescription() : Ac.Clear.ToDescription();
|
|||
|
|
case 3: return (j < GetEnColumnsCount()) ? EnColumnWidth[j].ToString() : "0";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
ix -= 4 * GetOriEnColumnsCount();
|
|||
|
|
|
|||
|
|
if (ix < 4 * GetOriTestColumnsCount())
|
|||
|
|
{
|
|||
|
|
int j = ix / 4;
|
|||
|
|
switch (ix % 4)
|
|||
|
|
{
|
|||
|
|
case 0: return (j < GetTestColumnsCount()) ? TestColumnContent[j].ToDescription() : Ct.None.ToDescription();
|
|||
|
|
case 1: return (j < GetTestColumnsCount()) ? TestColumnCaption[j] : string.Empty;
|
|||
|
|
case 2: return (j < GetTestColumnsCount()) ? TestColumnAction[j].ToDescription() : Ac.Clear.ToDescription();
|
|||
|
|
case 3: return (j < GetTestColumnsCount()) ? TestColumnWidth[j].ToString() : "0";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return string.Empty;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
public CfgUpdateFlags UpdateParam(int i, string str)
|
|||
|
|
{
|
|||
|
|
if (i < paramNames.Length)
|
|||
|
|
{
|
|||
|
|
switch (i)
|
|||
|
|
{
|
|||
|
|
case 0: BgShowForm = (str == Strings.yes); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 1: BgTitle = str; return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 2:
|
|||
|
|
for (Sz sz = 0; sz < Sz.Count; sz++)
|
|||
|
|
{
|
|||
|
|
if (str == sz.ToDescription())
|
|||
|
|
{
|
|||
|
|
BgSize = sz;
|
|||
|
|
return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
return CfgUpdateFlags.None;
|
|||
|
|
case 3: SetBgItemsCount(int.Parse(str)); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 4: SetBgColumnsCount(int.Parse(str)); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 5: BgIsLrOrder = (str == Strings.yes); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 6: BgIsVertArrangement = (str == Strings.yes); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 7: BgFormCloseKeys = str; return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
|
|||
|
|
case 8: EnShowForm = (str == Strings.yes); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 9: EnTitle = str; return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 10:
|
|||
|
|
for (Sz sz = 0; sz < Sz.Count; sz++)
|
|||
|
|
{
|
|||
|
|
if (str == sz.ToDescription())
|
|||
|
|
{
|
|||
|
|
EnSize = sz;
|
|||
|
|
return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
return CfgUpdateFlags.None;
|
|||
|
|
case 11: SetEnItemsCount(int.Parse(str)); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 12: SetEnColumnsCount(int.Parse(str)); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 13: EnIsLrOrder = (str == Strings.yes); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 14: EnIsVertArrangement = (str == Strings.yes); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 15: EnFormCloseKeys = str; return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
|
|||
|
|
case 16: TestStartEndShowForm = (str == Strings.yes); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 17: TestTitle = str; return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 18:
|
|||
|
|
for (Sz sz = 0; sz < Sz.Count; sz++)
|
|||
|
|
{
|
|||
|
|
if (str == sz.ToDescription())
|
|||
|
|
{
|
|||
|
|
TestSize = sz;
|
|||
|
|
return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
return CfgUpdateFlags.None;
|
|||
|
|
case 19: SetTestColumnsCount(int.Parse(str)); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 20: TestStartBoxAlwaysEn = (str == Strings.yes); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 21: TestIsLrOrder = (str == Strings.yes); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 22: TestIsVertArrangement = (str == Strings.yes); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 23: TestFormCloseKeys = str; return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
|
|||
|
|
default:
|
|||
|
|
return CfgUpdateFlags.None;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
int ix = i - paramNames.Length;
|
|||
|
|
|
|||
|
|
if (ix < 4 * GetOriBgItemsCount())
|
|||
|
|
{
|
|||
|
|
int j = ix / 4;
|
|||
|
|
if (j < GetBgItemsCount())
|
|||
|
|
{
|
|||
|
|
switch (ix % 4)
|
|||
|
|
{
|
|||
|
|
case 0: BgItemContent[j] = Str2Content(str); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 1: BgItemCaption[j] = str; return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 2: BgItemAction[j] = Str2Action(str); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 3: BgItemWidth[j] = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
ix -= 4 * GetOriBgItemsCount();
|
|||
|
|
|
|||
|
|
if (ix < 4 * GetOriBgColumnsCount())
|
|||
|
|
{
|
|||
|
|
int j = ix / 4;
|
|||
|
|
if (j < GetBgColumnsCount())
|
|||
|
|
{
|
|||
|
|
switch (ix % 4)
|
|||
|
|
{
|
|||
|
|
case 0: BgColumnContent[j] = Str2Content(str); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 1: BgColumnCaption[j] = str; return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 2: BgColumnAction[j] = Str2Action(str); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 3: BgColumnWidth[j] = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
ix -= 4 * GetOriBgColumnsCount();
|
|||
|
|
|
|||
|
|
if (ix < 4 * GetOriEnItemsCount())
|
|||
|
|
{
|
|||
|
|
int j = ix / 4;
|
|||
|
|
if (j < GetEnItemsCount())
|
|||
|
|
{
|
|||
|
|
switch (ix % 4)
|
|||
|
|
{
|
|||
|
|
case 0: EnItemContent[j] = Str2Content(str); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 1: EnItemCaption[j] = str; return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 2: EnItemAction[j] = Str2Action(str); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 3: EnItemWidth[j] = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
ix -= 4 * GetOriEnItemsCount();
|
|||
|
|
|
|||
|
|
if (ix < 4 * GetOriEnColumnsCount())
|
|||
|
|
{
|
|||
|
|
int j = ix / 4;
|
|||
|
|
if (j < GetEnColumnsCount())
|
|||
|
|
{
|
|||
|
|
switch (ix % 4)
|
|||
|
|
{
|
|||
|
|
case 0: EnColumnContent[j] = Str2Content(str); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 1: EnColumnCaption[j] = str; return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 2: EnColumnAction[j] = Str2Action(str); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 3: EnColumnWidth[j] = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
ix -= 4 * GetOriEnColumnsCount();
|
|||
|
|
|
|||
|
|
if (ix < 4 * GetOriTestColumnsCount())
|
|||
|
|
{
|
|||
|
|
int j = ix / 4;
|
|||
|
|
if (j < GetTestColumnsCount())
|
|||
|
|
{
|
|||
|
|
switch (ix % 4)
|
|||
|
|
{
|
|||
|
|
case 0: TestColumnContent[j] = Str2Content(str); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 1: TestColumnCaption[j] = str; return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 2: TestColumnAction[j] = Str2Action(str); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
case 3: TestColumnWidth[j] = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return CfgUpdateFlags.RestartRqrd;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Ct Str2Content(string str)
|
|||
|
|
{
|
|||
|
|
for (Ct c = 0; c < Ct.Count; c++)
|
|||
|
|
{
|
|||
|
|
if (str == c.ToDescription()) return c;
|
|||
|
|
}
|
|||
|
|
return Ct.None;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Ac Str2Action(string str)
|
|||
|
|
{
|
|||
|
|
for (Ac a = 0; a < Ac.Count; a++)
|
|||
|
|
{
|
|||
|
|
if (str == a.ToDescription()) return a;
|
|||
|
|
}
|
|||
|
|
return Ac.Clear;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public bool ValidateParam(int i, string str, out string message)
|
|||
|
|
{
|
|||
|
|
int idummy;
|
|||
|
|
|
|||
|
|
if (i < paramNames.Length)
|
|||
|
|
{
|
|||
|
|
switch (i)
|
|||
|
|
{
|
|||
|
|
case 0:
|
|||
|
|
case 2:
|
|||
|
|
case 5:
|
|||
|
|
case 6:
|
|||
|
|
case 8:
|
|||
|
|
case 10:
|
|||
|
|
case 13:
|
|||
|
|
case 14:
|
|||
|
|
case 16:
|
|||
|
|
case 18:
|
|||
|
|
case 20:
|
|||
|
|
case 21:
|
|||
|
|
case 22:
|
|||
|
|
message = string.Empty;
|
|||
|
|
if (ParamValues(i).Contains(str)) return true;
|
|||
|
|
break;
|
|||
|
|
case 3:
|
|||
|
|
case 4:
|
|||
|
|
case 11:
|
|||
|
|
case 12:
|
|||
|
|
case 19:
|
|||
|
|
message = string.Empty;
|
|||
|
|
if (int.TryParse(str, out idummy)) return true;
|
|||
|
|
break;
|
|||
|
|
case 1:
|
|||
|
|
case 7:
|
|||
|
|
case 9:
|
|||
|
|
case 15:
|
|||
|
|
case 17:
|
|||
|
|
case 23:
|
|||
|
|
message = string.Empty;
|
|||
|
|
return true;
|
|||
|
|
default:
|
|||
|
|
message = "Invalid index";
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (i < ParamsCount())
|
|||
|
|
{
|
|||
|
|
switch ((i - paramNames.Length) % 4)
|
|||
|
|
{
|
|||
|
|
case 0:
|
|||
|
|
case 2:
|
|||
|
|
message = string.Empty;
|
|||
|
|
if (ParamValues(i).Contains(str)) return true;
|
|||
|
|
break;
|
|||
|
|
case 1:
|
|||
|
|
message = string.Empty;
|
|||
|
|
return true;
|
|||
|
|
case 3:
|
|||
|
|
message = string.Empty;
|
|||
|
|
if (int.TryParse(str, out idummy)) return true;
|
|||
|
|
break;
|
|||
|
|
default:
|
|||
|
|
message = "Invalid index";
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
message = string.Format(Strings.Invalid_0, ParamName(i)) ;
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void CopyContentTo(EntryFormCfg prms)
|
|||
|
|
{
|
|||
|
|
prms.BgShowForm = BgShowForm;
|
|||
|
|
prms.BgTitle = BgTitle;
|
|||
|
|
prms.BgSize = BgSize;
|
|||
|
|
prms.BgIsLrOrder = BgIsLrOrder;
|
|||
|
|
prms.BgIsVertArrangement = BgIsVertArrangement;
|
|||
|
|
prms.BgFormCloseKeys = BgFormCloseKeys;
|
|||
|
|
|
|||
|
|
prms.EnShowForm = EnShowForm;
|
|||
|
|
prms.EnTitle = EnTitle;
|
|||
|
|
prms.EnSize = EnSize;
|
|||
|
|
prms.EnIsLrOrder = EnIsLrOrder;
|
|||
|
|
prms.EnIsVertArrangement = EnIsVertArrangement;
|
|||
|
|
prms.EnFormCloseKeys = EnFormCloseKeys;
|
|||
|
|
|
|||
|
|
prms.TestStartEndShowForm = TestStartEndShowForm;
|
|||
|
|
prms.TestTitle = TestTitle;
|
|||
|
|
prms.TestSize = TestSize;
|
|||
|
|
prms.TestStartBoxAlwaysEn = TestStartBoxAlwaysEn;
|
|||
|
|
prms.TestIsLrOrder = TestIsLrOrder;
|
|||
|
|
prms.TestIsVertArrangement = TestIsVertArrangement;
|
|||
|
|
prms.TestFormCloseKeys = TestFormCloseKeys;
|
|||
|
|
|
|||
|
|
prms.BgItemContent = new Ct[GetBgItemsCount()];
|
|||
|
|
prms.BgItemCaption = new string[GetBgItemsCount()];
|
|||
|
|
prms.BgItemAction = new Ac[GetBgItemsCount()];
|
|||
|
|
prms.BgItemWidth = new int[GetBgItemsCount()];
|
|||
|
|
///
|
|||
|
|
for (int ix = 0; ix < GetBgItemsCount(); ix++)
|
|||
|
|
{
|
|||
|
|
prms.BgItemContent[ix] = BgItemContent[ix];
|
|||
|
|
prms.BgItemCaption[ix] = BgItemCaption[ix];
|
|||
|
|
prms.BgItemAction[ix] = BgItemAction[ix];
|
|||
|
|
prms.BgItemWidth[ix] = BgItemWidth[ix];
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
prms.BgColumnContent = new Ct[GetBgColumnsCount()];
|
|||
|
|
prms.BgColumnCaption = new string[GetBgColumnsCount()];
|
|||
|
|
prms.BgColumnAction = new Ac[GetBgColumnsCount()];
|
|||
|
|
prms.BgColumnWidth = new int[GetBgColumnsCount()];
|
|||
|
|
///
|
|||
|
|
for (int ix = 0; ix < GetBgColumnsCount(); ix++)
|
|||
|
|
{
|
|||
|
|
prms.BgColumnContent[ix] = BgColumnContent[ix];
|
|||
|
|
prms.BgColumnCaption[ix] = BgColumnCaption[ix];
|
|||
|
|
prms.BgColumnAction[ix] = BgColumnAction[ix];
|
|||
|
|
prms.BgColumnWidth[ix] = BgColumnWidth[ix];
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
prms.EnItemContent = new Ct[GetEnItemsCount()];
|
|||
|
|
prms.EnItemCaption = new string[GetEnItemsCount()];
|
|||
|
|
prms.EnItemAction = new Ac[GetEnItemsCount()];
|
|||
|
|
prms.EnItemWidth = new int[GetEnItemsCount()];
|
|||
|
|
///
|
|||
|
|
for (int ix = 0; ix < GetEnItemsCount(); ix++)
|
|||
|
|
{
|
|||
|
|
prms.EnItemContent[ix] = EnItemContent[ix];
|
|||
|
|
prms.EnItemCaption[ix] = EnItemCaption[ix];
|
|||
|
|
prms.EnItemAction[ix] = EnItemAction[ix];
|
|||
|
|
prms.EnItemWidth[ix] = EnItemWidth[ix];
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
prms.EnColumnContent = new Ct[GetEnColumnsCount()];
|
|||
|
|
prms.EnColumnCaption = new string[GetEnColumnsCount()];
|
|||
|
|
prms.EnColumnAction = new Ac[GetEnColumnsCount()];
|
|||
|
|
prms.EnColumnWidth = new int[GetEnColumnsCount()];
|
|||
|
|
///
|
|||
|
|
for (int ix = 0; ix < GetEnColumnsCount(); ix++)
|
|||
|
|
{
|
|||
|
|
prms.EnColumnContent[ix] = EnColumnContent[ix];
|
|||
|
|
prms.EnColumnCaption[ix] = EnColumnCaption[ix];
|
|||
|
|
prms.EnColumnAction[ix] = EnColumnAction[ix];
|
|||
|
|
prms.EnColumnWidth[ix] = EnColumnWidth[ix];
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
prms.TestColumnContent = new Ct[GetTestColumnsCount()];
|
|||
|
|
prms.TestColumnCaption = new string[GetTestColumnsCount()];
|
|||
|
|
prms.TestColumnAction = new Ac[GetTestColumnsCount()];
|
|||
|
|
prms.TestColumnWidth = new int[GetTestColumnsCount()];
|
|||
|
|
///
|
|||
|
|
for (int ix = 0; ix < GetTestColumnsCount(); ix++)
|
|||
|
|
{
|
|||
|
|
prms.TestColumnContent[ix] = TestColumnContent[ix];
|
|||
|
|
prms.TestColumnCaption[ix] = TestColumnCaption[ix];
|
|||
|
|
prms.TestColumnAction[ix] = TestColumnAction[ix];
|
|||
|
|
prms.TestColumnWidth[ix] = TestColumnWidth[ix];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public IParamsProvider Clone()
|
|||
|
|
{
|
|||
|
|
EntryFormCfg pars = new EntryFormCfg();
|
|||
|
|
CopyContentTo(pars);
|
|||
|
|
return pars;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public bool UpdateEmbeddedDbEntity()
|
|||
|
|
{
|
|||
|
|
return true; /// =OK, do nothing
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|