Files
tbf/TBF/Rig/DataEntry/Uni/EntryFormCfg.cs
T

1087 lines
42 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 ShowCycleBeginningForm; /// 0
public string BgTitle; /// 1
public Sz BgSize; /// 2
public bool BgIsLrOrder; /// 3
public string BgFormCloseKeys; /// 4
public bool ShowCycleEndForm; /// 5
public string EnTitle; /// 6
public Sz EnSize; /// 7
public bool EnIsLrOrder; /// 8
public string EnFormCloseKeys; /// 9
public bool ShowTestStartEndForm; /// 10
public string TestTitle; /// 11
public Sz TestSize; /// 12
public string TestFormCloseKeys; /// 13
public Content BgItem1Content; /// 14
public string BgItem1Caption; /// 15
public Action BgItem1Action; /// 16
public int BgItem1Width; /// 17
public Content BgItem2Content; /// 18
public string BgItem2Caption; /// 19
public Action BgItem2Action; /// 20
public int BgItem2Width; /// 21
public Content BgItem3Content; /// 22
public string BgItem3Caption; /// 23
public Action BgItem3Action; /// 24
public int BgItem3Width; /// 25
public Content BgColAContent; /// 26
public string BgColACaption; /// 27
public Action BgColAAction; /// 28
public int BgColAWidth; /// 29
public Content BgColBContent; /// 30
public string BgColBCaption; /// 31
public Action BgColBAction; /// 32
public int BgColBWidth; /// 33
public Content BgColCContent; /// 34
public string BgColCCaption; /// 35
public Action BgColCAction; /// 36
public int BgColCWidth; /// 37
public Content BgColDContent; /// 38
public string BgColDCaption; /// 39
public Action BgColDAction; /// 40
public int BgColDWidth; /// 41
public Content BgColEContent; /// 42
public string BgColECaption; /// 43
public Action BgColEAction; /// 44
public int BgColEWidth; /// 45
public Content EnItem1Content; /// 46
public string EnItem1Caption; /// 47
public Action EnItem1Action; /// 48
public int EnItem1Width; /// 49
public Content EnItem2Content; /// 50
public string EnItem2Caption; /// 51
public Action EnItem2Action; /// 52
public int EnItem2Width; /// 53
public Content EnItem3Content; /// 54
public string EnItem3Caption; /// 55
public Action EnItem3Action; /// 56
public int EnItem3Width; /// 57
public Content EnColAContent; /// 58
public string EnColACaption; /// 59
public Action EnColAAction; /// 60
public int EnColAWidth; /// 61
public Content EnColBContent; /// 62
public string EnColBCaption; /// 63
public Action EnColBAction; /// 64
public int EnColBWidth; /// 65
public Content EnColCContent; /// 66
public string EnColCCaption; /// 67
public Action EnColCAction; /// 68
public int EnColCWidth; /// 69
public Content EnColDContent; /// 70
public string EnColDCaption; /// 71
public Action EnColDAction; /// 72
public int EnColDWidth; /// 73
public Content EnColEContent; /// 74
public string EnColECaption; /// 75
public Action EnColEAction; /// 76
public int EnColEWidth; /// 77
/// 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()
{
ShowCycleBeginningForm = true;
BgTitle = "Enter water meter data";
BgSize = Sz.M;
BgIsLrOrder = false;
BgFormCloseKeys = string.Empty;
ShowCycleEndForm = false;
EnTitle = "Enter water meter data";
EnSize = Sz.M;
EnIsLrOrder = false;
EnFormCloseKeys = string.Empty;
ShowTestStartEndForm = true;
TestTitle = "Enter states of water meters";
TestSize = Sz.M;
TestFormCloseKeys = string.Empty;
BgItem1Content = Content.BatchAndWmOrder;
BgItem1Caption = "Order nr.";
BgItem1Action = Action.HistoryLast;
BgItem1Width = 160;
BgItem2Content = Content.None;
BgItem3Content = Content.None;
BgColAContent = Content.SerialNr;
BgColACaption = "Serial nr.";
BgItem1Action = Action.Clear;
BgColAWidth = 160;
BgColBContent = Content.None;
BgColCContent = Content.None;
BgColDContent = Content.None;
BgColEContent = Content.None;
EnItem1Content = Content.BatchRemark;
EnItem1Caption = "Remark";
EnItem1Action = Action.HistoryLast;
EnItem1Width = 160;
EnItem2Content = Content.None;
EnItem3Content = Content.None;
EnColAContent = Content.SerialNr;
EnColACaption = "Serial nr.";
EnColAAction = Action.LoadReadOnly;
EnColAWidth = -160;
EnColBCaption = "End state";
EnColBContent = Content.EndState;
EnColBAction = Action.Clear;
EnColBWidth = 160;
EnColCContent = Content.None;
EnColDContent = Content.None;
EnColEContent = Content.None;
}
string[] paramNames = new string[]
{
Strings.Show_cycle_beginning_form,
"Beginning: Title",
"Beginning: Size",
"Beginning: Left-to-right order",
"Beginning: Keys to close the form",
Strings.Show_cycle_end_form,
"End: Title",
"End: Size",
"End: Left-to-right order",
"End: Keys to close the form",
"Show test start/end form",
"Test start/end: Title",
"Test start/end: Size",
"Test start/end: Keys to close the form",
"Beginning: Item 1 content",
"Beginning: Item 1 caption",
"Beginning: Item 1 action",
"Beginning: Item 1 width",
"Beginning: Item 2 content",
"Beginning: Item 2 caption",
"Beginning: Item 2 action",
"Beginning: Item 2 width",
"Beginning: Item 3 content",
"Beginning: Item 3 caption",
"Beginning: Item 3 action",
"Beginning: Item 3 width",
"Beginning: Column A content",
"Beginning: Column A caption",
"Beginning: Column A action",
"Beginning: Column A width",
"Beginning: Column B content",
"Beginning: Column B caption",
"Beginning: Column B action",
"Beginning: Column B width",
"Beginning: Column C content",
"Beginning: Column C caption",
"Beginning: Column C action",
"Beginning: Column C width",
"Beginning: Column D content",
"Beginning: Column D caption",
"Beginning: Column D action",
"Beginning: Column D width",
"Beginning: Column E content",
"Beginning: Column E caption",
"Beginning: Column E action",
"Beginning: Column E width",
"End: Item 1 content",
"End: Item 1 caption",
"End: Item 1 action",
"End: Item 1 width",
"End: Item 2 content",
"End: Item 2 caption",
"End: Item 2 action",
"End: Item 2 width",
"End: Item 3 content",
"End: Item 3 caption",
"End: Item 3 action",
"End: Item 3 width",
"End: Column A content",
"End: Column A caption",
"End: Column A action",
"End: Column A width",
"End: Column B content",
"End: Column B caption",
"End: Column B action",
"End: Column B width",
"End: Column C content",
"End: Column C caption",
"End: Column C action",
"End: Column C width",
"End: Column D content",
"End: Column D caption",
"End: Column D action",
"End: Column D width",
"End: Column E content",
"End: Column E caption",
"End: Column E action",
"End: Column E width",
};
public string ParamName(int i) { return paramNames[i]; }
public int ParamsCount() { return paramNames.Length; }
public ICollection<string> ParamValues(int i)
{
var list = new List<string>();
switch (i)
{
case 0:
case 3:
case 5:
case 8:
case 10:
return new string[] { Strings.yes, Strings.no };
case 14:
case 18:
case 22:
case 46:
case 50:
case 54:
return new string[]
{
Content.None.ToDescription(),
Content.YearOfCalibration.ToDescription(),
Content.ArchivePath.ToDescription(),
Content.BatchOrder.ToDescription(),
Content.BatchAndWmOrder.ToDescription(),
Content.BatchRemark.ToDescription(),
Content.BatchAndWmRemark.ToDescription(),
};
case 26:
case 30:
case 34:
case 38:
case 42:
case 58:
case 62:
case 66:
case 70:
case 74:
return new string[]
{
Content.None.ToDescription(),
Content.SerialNr.ToDescription(),
Content.SerialNrAux.ToDescription(),
Content.RadioAddress.ToDescription(),
Content.YearOfCalibration.ToDescription(),
Content.StartState.ToDescription(),
Content.EndState.ToDescription(),
Content.ArchivePath.ToDescription(),
Content.WmOrder.ToDescription(),
Content.WmRemark.ToDescription(),
};
case 16:
case 20:
case 24:
case 28:
case 32:
case 36:
case 40:
case 44:
case 48:
case 52:
case 56:
case 60:
case 64:
case 68:
case 72:
case 76:
for (Action a = 0; a < Action.Count; a++) list.Add(a.ToDescription());
return list;
case 2:
case 7:
case 12:
for (Sz sz = 0; sz < Sz.Count; sz++) list.Add(sz.ToDescription());
return list;
default:
return null;
}
}
public string ToString(int i)
{
switch (i)
{
case 0: return ShowCycleBeginningForm ? Strings.yes : Strings.no;
case 1: return BgTitle;
case 2: return BgSize.ToDescription();
case 3: return BgIsLrOrder ? Strings.yes : Strings.no;
case 4: return BgFormCloseKeys;
case 5: return ShowCycleEndForm ? Strings.yes : Strings.no;
case 6: return EnTitle;
case 7: return EnSize.ToDescription();
case 8: return EnIsLrOrder ? Strings.yes : Strings.no;
case 9: return EnFormCloseKeys;
case 10: return ShowTestStartEndForm ? Strings.yes : Strings.no;
case 11: return TestTitle;
case 12: return TestSize.ToDescription();
case 13: return TestFormCloseKeys;
case 14: return BgItem1Content.ToDescription();
case 15: return BgItem1Caption;
case 16: return BgItem1Action.ToDescription();
case 17: return BgItem1Width.ToString();
case 18: return BgItem2Content.ToDescription();
case 19: return BgItem2Caption;
case 20: return BgItem2Action.ToDescription();
case 21: return BgItem2Width.ToString();
case 22: return BgItem3Content.ToDescription();
case 23: return BgItem3Caption;
case 24: return BgItem3Action.ToDescription();
case 25: return BgItem3Width.ToString();
case 26: return BgColAContent.ToDescription();
case 27: return BgColACaption;
case 28: return BgColAAction.ToDescription();
case 29: return BgColAWidth.ToString();
case 30: return BgColBContent.ToDescription();
case 31: return BgColBCaption;
case 32: return BgColBAction.ToDescription();
case 33: return BgColBWidth.ToString();
case 34: return BgColCContent.ToDescription();
case 35: return BgColCCaption;
case 36: return BgColCAction.ToDescription();
case 37: return BgColCWidth.ToString();
case 38: return BgColDContent.ToDescription();
case 39: return BgColDCaption;
case 40: return BgColDAction.ToDescription();
case 41: return BgColDWidth.ToString();
case 42: return BgColEContent.ToDescription();
case 43: return BgColECaption;
case 44: return BgColEAction.ToDescription();
case 45: return BgColEWidth.ToString();
case 46: return EnItem1Content.ToDescription();
case 47: return EnItem1Caption;
case 48: return EnItem1Action.ToDescription();
case 49: return EnItem1Width.ToString();
case 50: return EnItem2Content.ToDescription();
case 51: return EnItem2Caption;
case 52: return EnItem2Action.ToDescription();
case 53: return EnItem2Width.ToString();
case 54: return EnItem3Content.ToDescription();
case 55: return EnItem3Caption;
case 56: return EnItem3Action.ToDescription();
case 57: return EnItem3Width.ToString();
case 58: return EnColAContent.ToDescription();
case 59: return EnColACaption;
case 60: return EnColAAction.ToDescription();
case 61: return EnColAWidth.ToString();
case 62: return EnColBContent.ToDescription();
case 63: return EnColBCaption;
case 64: return EnColBAction.ToDescription();
case 65: return EnColBWidth.ToString();
case 66: return EnColCContent.ToDescription();
case 67: return EnColCCaption;
case 68: return EnColCAction.ToDescription();
case 69: return EnColCWidth.ToString();
case 70: return EnColDContent.ToDescription();
case 71: return EnColDCaption;
case 72: return EnColDAction.ToDescription();
case 73: return EnColDWidth.ToString();
case 74: return EnColEContent.ToDescription();
case 75: return EnColECaption;
case 76: return EnColEAction.ToDescription();
case 77: return EnColEWidth.ToString();
default:
return string.Format("Name={0}, Show cycle beginning form={1}, Show cycle end form={2}", Name, ShowCycleBeginningForm, ShowCycleEndForm);
}
}
public CfgUpdateFlags UpdateParam(int i, string str)
{
switch (i)
{
case 0: ShowCycleBeginningForm = (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: BgIsLrOrder = (str == Strings.yes); return CfgUpdateFlags.RestartRqrd;
case 4: BgFormCloseKeys = str; return CfgUpdateFlags.RestartRqrd;
case 5: ShowCycleEndForm = (str == Strings.yes); return CfgUpdateFlags.RestartRqrd;
case 6: EnTitle = str; return CfgUpdateFlags.RestartRqrd;
case 7:
for (Sz sz = 0; sz < Sz.Count; sz++)
{
if (str == sz.ToDescription())
{
EnSize = sz;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 8: EnIsLrOrder = (str == Strings.yes); return CfgUpdateFlags.RestartRqrd;
case 9: EnFormCloseKeys = str; return CfgUpdateFlags.RestartRqrd;
case 10: ShowTestStartEndForm = (str == Strings.yes); return CfgUpdateFlags.RestartRqrd;
case 11: TestTitle = str; return CfgUpdateFlags.RestartRqrd;
case 12:
for (Sz sz = 0; sz < Sz.Count; sz++)
{
if (str == sz.ToDescription())
{
TestSize = sz;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 13: TestFormCloseKeys = str; return CfgUpdateFlags.RestartRqrd;
case 14:
for (Content c = 0; c < Content.Count; c++)
{
if (str == c.ToDescription())
{
BgItem1Content = c;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 15: BgItem1Caption = str; return CfgUpdateFlags.RestartRqrd;
case 16:
for (Action a = 0; a < Action.Count; a++)
{
if (str == a.ToDescription())
{
BgItem1Action = a;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 17: BgItem1Width = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
case 18:
for (Content c = 0; c < Content.Count; c++)
{
if (str == c.ToDescription())
{
BgItem2Content = c;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 19: BgItem2Caption = str; return CfgUpdateFlags.RestartRqrd;
case 20:
for (Action a = 0; a < Action.Count; a++)
{
if (str == a.ToDescription())
{
BgItem2Action = a;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 21: BgItem2Width = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
case 22:
for (Content c = 0; c < Content.Count; c++)
{
if (str == c.ToDescription())
{
BgItem3Content = c;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 23: BgItem3Caption = str; return CfgUpdateFlags.RestartRqrd;
case 24:
for (Action a = 0; a < Action.Count; a++)
{
if (str == a.ToDescription())
{
BgItem3Action = a;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 25: BgItem3Width = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
case 26:
for (Content c = 0; c < Content.Count; c++)
{
if (str == c.ToDescription())
{
BgColAContent = c;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 27: BgColACaption = str; return CfgUpdateFlags.RestartRqrd;
case 28:
for (Action a = 0; a < Action.Count; a++)
{
if (str == a.ToDescription())
{
BgColAAction = a;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 29: BgColAWidth = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
case 30:
for (Content c = 0; c < Content.Count; c++)
{
if (str == c.ToDescription())
{
BgColBContent = c;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 31: BgColBCaption = str; return CfgUpdateFlags.RestartRqrd;
case 32:
for (Action a = 0; a < Action.Count; a++)
{
if (str == a.ToDescription())
{
BgColBAction = a;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 33: BgColBWidth = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
case 34:
for (Content c = 0; c < Content.Count; c++)
{
if (str == c.ToDescription())
{
BgColCContent = c;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 35: BgColCCaption = str; return CfgUpdateFlags.RestartRqrd;
case 36:
for (Action a = 0; a < Action.Count; a++)
{
if (str == a.ToDescription())
{
BgColCAction = a;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 37: BgColCWidth = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
case 38:
for (Content c = 0; c < Content.Count; c++)
{
if (str == c.ToDescription())
{
BgColDContent = c;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 39: BgColDCaption = str; return CfgUpdateFlags.RestartRqrd;
case 40:
for (Action a = 0; a < Action.Count; a++)
{
if (str == a.ToDescription())
{
BgColDAction = a;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 41: BgColDWidth = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
case 42:
for (Content c = 0; c < Content.Count; c++)
{
if (str == c.ToDescription())
{
BgColEContent = c;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 43: BgColECaption = str; return CfgUpdateFlags.RestartRqrd;
case 44:
for (Action a = 0; a < Action.Count; a++)
{
if (str == a.ToDescription())
{
BgColEAction = a;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 45: BgColEWidth = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
case 46:
for (Content c = 0; c < Content.Count; c++)
{
if (str == c.ToDescription())
{
EnItem1Content = c;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 47: EnItem1Caption = str; return CfgUpdateFlags.RestartRqrd;
case 48:
for (Action a = 0; a < Action.Count; a++)
{
if (str == a.ToDescription())
{
EnItem1Action = a;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 49: EnItem1Width = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
case 50:
for (Content c = 0; c < Content.Count; c++)
{
if (str == c.ToDescription())
{
EnItem2Content = c;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 51: EnItem2Caption = str; return CfgUpdateFlags.RestartRqrd;
case 52:
for (Action a = 0; a < Action.Count; a++)
{
if (str == a.ToDescription())
{
EnItem2Action = a;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 53: EnItem2Width = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
case 54:
for (Content c = 0; c < Content.Count; c++)
{
if (str == c.ToDescription())
{
EnItem3Content = c;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 55: EnItem3Caption = str; return CfgUpdateFlags.RestartRqrd;
case 56:
for (Action a = 0; a < Action.Count; a++)
{
if (str == a.ToDescription())
{
EnItem3Action = a;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 57: EnItem3Width = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
case 58:
for (Content c = 0; c < Content.Count; c++)
{
if (str == c.ToDescription())
{
EnColAContent = c;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 59: EnColACaption = str; return CfgUpdateFlags.RestartRqrd;
case 60:
for (Action a = 0; a < Action.Count; a++)
{
if (str == a.ToDescription())
{
EnColAAction = a;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 61: EnColAWidth = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
case 62:
for (Content c = 0; c < Content.Count; c++)
{
if (str == c.ToDescription())
{
EnColBContent = c;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 63: EnColBCaption = str; return CfgUpdateFlags.RestartRqrd;
case 64:
for (Action a = 0; a < Action.Count; a++)
{
if (str == a.ToDescription())
{
EnColBAction = a;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 65: EnColBWidth = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
case 66:
for (Content c = 0; c < Content.Count; c++)
{
if (str == c.ToDescription())
{
EnColCContent = c;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 67: EnColCCaption = str; return CfgUpdateFlags.RestartRqrd;
case 68:
for (Action a = 0; a < Action.Count; a++)
{
if (str == a.ToDescription())
{
EnColCAction = a;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 69: EnColCWidth = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
case 70:
for (Content c = 0; c < Content.Count; c++)
{
if (str == c.ToDescription())
{
EnColDContent = c;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 71: EnColDCaption = str; return CfgUpdateFlags.RestartRqrd;
case 72:
for (Action a = 0; a < Action.Count; a++)
{
if (str == a.ToDescription())
{
EnColDAction = a;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 73: EnColDWidth = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
case 74:
for (Content c = 0; c < Content.Count; c++)
{
if (str == c.ToDescription())
{
EnColEContent = c;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 75: EnColECaption = str; return CfgUpdateFlags.RestartRqrd;
case 76:
for (Action a = 0; a < Action.Count; a++)
{
if (str == a.ToDescription())
{
EnColEAction = a;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 77: EnColEWidth = int.Parse(str); return CfgUpdateFlags.RestartRqrd;
default:
return CfgUpdateFlags.None;
}
}
public bool ValidateParam(int i, string str, out string message)
{
int idummy;
switch (i)
{
case 0:
case 2:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
case 14:
case 16:
case 18:
case 20:
case 22:
case 24:
case 26:
case 28:
case 30:
case 32:
case 34:
case 36:
case 38:
case 40:
case 42:
case 44:
case 46:
case 48:
case 50:
case 52:
case 54:
case 56:
case 58:
case 60:
case 62:
case 64:
case 66:
case 68:
case 70:
case 72:
case 74:
case 76:
message = string.Empty;
if (ParamValues(i).Contains(str)) return true;
break;
case 17:
case 21:
case 25:
case 29:
case 33:
case 37:
case 41:
case 45:
case 49:
case 53:
case 57:
case 61:
case 65:
case 69:
case 73:
case 77:
message = string.Empty;
if (int.TryParse(str, out idummy)) return true;
break;
case 1:
case 4:
case 6:
case 9:
case 11:
case 13:
case 15:
case 19:
case 23:
case 27:
case 31:
case 35:
case 39:
case 43:
case 47:
case 51:
case 55:
case 59:
case 63:
case 67:
case 71:
case 75:
message = string.Empty;
return true;
default:
message = "Invalid index";
return false;
}
message = string.Format(Strings.Invalid_0, ParamName(i)) ;
return false;
}
void CopyContentTo(EntryFormCfg prms)
{
prms.ShowCycleBeginningForm = ShowCycleBeginningForm;
prms.BgTitle = BgTitle;
prms.BgSize = BgSize;
prms.BgIsLrOrder = BgIsLrOrder;
prms.BgFormCloseKeys = BgFormCloseKeys;
prms.ShowCycleEndForm = ShowCycleEndForm;
prms.EnTitle = EnTitle;
prms.EnSize = EnSize;
prms.EnIsLrOrder = EnIsLrOrder;
prms.EnFormCloseKeys = EnFormCloseKeys;
prms.ShowTestStartEndForm = ShowTestStartEndForm;
prms.TestTitle = TestTitle;
prms.TestSize = TestSize;
prms.TestFormCloseKeys = TestFormCloseKeys;
prms.BgItem1Caption = BgItem1Caption;
prms.BgItem1Content = BgItem1Content;
prms.BgItem1Action = BgItem1Action;
prms.BgItem1Width = BgItem1Width;
prms.BgItem2Caption = BgItem2Caption;
prms.BgItem2Content = BgItem2Content;
prms.BgItem2Action = BgItem2Action;
prms.BgItem2Width = BgItem2Width;
prms.BgItem3Caption = BgItem3Caption;
prms.BgItem3Content = BgItem3Content;
prms.BgItem3Action = BgItem3Action;
prms.BgItem3Width = BgItem3Width;
prms.BgColACaption = BgColACaption;
prms.BgColAContent = BgColAContent;
prms.BgColAAction = BgColAAction;
prms.BgColAWidth = BgColAWidth;
prms.BgColBCaption = BgColBCaption;
prms.BgColBContent = BgColBContent;
prms.BgColBAction = BgColBAction;
prms.BgColBWidth = BgColBWidth;
prms.BgColCCaption = BgColCCaption;
prms.BgColCContent = BgColCContent;
prms.BgColCAction = BgColCAction;
prms.BgColCWidth = BgColCWidth;
prms.BgColDCaption = BgColDCaption;
prms.BgColDContent = BgColDContent;
prms.BgColDAction = BgColDAction;
prms.BgColDWidth = BgColDWidth;
prms.BgColECaption = BgColECaption;
prms.BgColEContent = BgColEContent;
prms.BgColEAction = BgColEAction;
prms.BgColEWidth = BgColEWidth;
prms.EnItem1Caption = EnItem1Caption;
prms.EnItem1Content = EnItem1Content;
prms.EnItem1Action = EnItem1Action;
prms.EnItem1Width = EnItem1Width;
prms.EnItem2Caption = EnItem2Caption;
prms.EnItem2Content = EnItem2Content;
prms.EnItem2Action = EnItem2Action;
prms.EnItem2Width = EnItem2Width;
prms.EnItem3Caption = EnItem3Caption;
prms.EnItem3Content = EnItem3Content;
prms.EnItem3Action = EnItem3Action;
prms.EnItem3Width = EnItem3Width;
prms.EnColACaption = EnColACaption;
prms.EnColAContent = EnColAContent;
prms.EnColAAction = EnColAAction;
prms.EnColAWidth = EnColAWidth;
prms.EnColBCaption = EnColBCaption;
prms.EnColBContent = EnColBContent;
prms.EnColBAction = EnColBAction;
prms.EnColBWidth = EnColBWidth;
prms.EnColCCaption = EnColCCaption;
prms.EnColCContent = EnColCContent;
prms.EnColCAction = EnColCAction;
prms.EnColCWidth = EnColCWidth;
prms.EnColDCaption = EnColDCaption;
prms.EnColDContent = EnColDContent;
prms.EnColDAction = EnColDAction;
prms.EnColDWidth = EnColDWidth;
prms.EnColECaption = EnColECaption;
prms.EnColEContent = EnColEContent;
prms.EnColEAction = EnColEAction;
prms.EnColEWidth = EnColEWidth;
}
public IParamsProvider Clone()
{
EntryFormCfg pars = new EntryFormCfg();
CopyContentTo(pars);
return pars;
}
public bool UpdateEmbeddedDbEntity()
{
return true; /// =OK, do nothing
}
}
}