Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try to move Nullables and comparison stuff to GenPrompt:</p> <pre><code>public static class Constants { public const string U_GOI_FORMAT_OPTION_MONEY = ""; public const string U_GOI_FORMAT_OPTION_NUMBER = ""; } /// &lt;summary&gt; /// abstracted Generic Prompt Base /// &lt;/summary&gt; public abstract class GenPromptBase { public string InputValueType { get; set; } public abstract bool TooLow { get; } public abstract void ParseInput(string result); } /// &lt;summary&gt; /// Derived Generic 'Money' class of 'GenPromptBase' /// &lt;/summary&gt; public class GenPromptMoney : GenPromptBase { PromptMoney _prmpt; public GenPromptMoney(PromptMoney prmptParms) { _prmpt = prmptParms; InputValueType = _prmpt.InputValueType; } public override void ParseInput(string result) { _prmpt.ResultValue = decimal.Parse(result); } public override bool TooLow { get { return _prmpt.TooLow; } } } /// &lt;summary&gt; /// Derived Generic 'Value' class of 'GenPromptBase' /// &lt;/summary&gt; public class GenPromptValue : GenPromptBase { PromptValue _prmpt; public GenPromptValue(PromptValue prmptParms) { _prmpt = prmptParms; InputValueType = _prmpt.InputValueType; } public override void ParseInput(string result) { _prmpt.ResultValue = int.Parse(result); } public override bool TooLow { get { return _prmpt.TooLow; } } } /// &lt;summary&gt; /// Generic Prompt Class /// &lt;/summary&gt; public class GenPrompt&lt;Z&gt; where Z: struct, IComparable { public string InputValueType { get; set; } public Z? MinValue; public Z? ResultValue; public Z? MaxValue; public bool TooLow { get { return this.MinValue.HasValue &amp;&amp; (this.MinValue.Value.CompareTo(this.ResultValue.Value) &gt;= 0); } } } /// &lt;summary&gt; /// Derived 'Money' class of 'GenPrompt« decimal? »' /// &lt;/summary&gt; public class PromptMoney : GenPrompt&lt;decimal&gt; { public PromptMoney( decimal? minValue = null, decimal? maxValue = null, string inputValueType = Constants.U_GOI_FORMAT_OPTION_MONEY) { InputValueType = inputValueType; MinValue = minValue; MaxValue = maxValue; ResultValue = null; } } /// &lt;summary&gt; /// Derived 'Value' class of 'GenPrompt« int? »' /// &lt;/summary&gt; public class PromptValue : GenPrompt&lt;int&gt; { public PromptValue( int? minValue = null, int? maxValue = null, string inputValueType = Constants.U_GOI_FORMAT_OPTION_NUMBER) { InputValueType = inputValueType; MinValue = minValue; MaxValue = maxValue; ResultValue = null; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload