Author: husted Date: Fri Jun 10 13:59:19 2005 New Revision: 190019 URL: http://svn.apache.org/viewcvs?rev=190019&view=rev Log: OVR-12 * Design IFieldTable and IFieldContext interfaces and default implementations.
Added: struts/sandbox/trunk/overdrive/Nexus/Core/Tables/ struts/sandbox/trunk/overdrive/Nexus/Core/Tables/IFieldContext.cs struts/sandbox/trunk/overdrive/Nexus/Core/Tables/IFieldTable.cs Added: struts/sandbox/trunk/overdrive/Nexus/Core/Tables/IFieldContext.cs URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Core/Tables/IFieldContext.cs?rev=190019&view=auto ============================================================================== --- struts/sandbox/trunk/overdrive/Nexus/Core/Tables/IFieldContext.cs (added) +++ struts/sandbox/trunk/overdrive/Nexus/Core/Tables/IFieldContext.cs Fri Jun 10 13:59:19 2005 @@ -0,0 +1,56 @@ +using System; +using System.Runtime.Serialization; + +namespace Nexus.Core.Tables +{ + /// <summary> + /// Properties common to controls, including Alert, Constraints, ControlType, and DataType. + /// </summary> + /// <remark><p> + /// Validation commands can use the FieldContext properties to verify input. + /// The FieldContext entries are made available through a FieldTable. + /// </p></remark> + public interface IFieldContext : ISerializable + { + /// <summary> + /// Intitial error message to display when Constraints fail. + /// </summary> + string Alert { get; set; } + + /// <summary> + /// Cannonical name of the Control Type (input, select, et al.). + /// </summary> + string ControlTypeName { get; set; } + + /// <summary> + /// Formatting instructions for the value, according to DateType. + /// </summary> + string DataFormat { get; set; } + + /// <summary> + /// Type of native data - Boolean, Byte Char, DateTime, Decimal, Double, Int16, Int32, Int64, SByte, Single, String, TimeSpan, UInt16, UInt32, UInt64. + /// </summary> + Type DataType { get; set; } + + /// <summary> + /// Cannonical name of the DataType. + /// </summary> + string DataTypeName { get; set; } + + /// <summary> + /// Hint - Gets or sets an onscreen or hover hint. + /// </summary> + string Hint { get; set; } + + /// <summary> + /// Name of the control (also dictionary key). + /// </summary> + string ID { get; set; } + + /// <summary> + /// the label for the control. + /// </summary> + string Label { get; set; } + + } +} \ No newline at end of file Added: struts/sandbox/trunk/overdrive/Nexus/Core/Tables/IFieldTable.cs URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/overdrive/Nexus/Core/Tables/IFieldTable.cs?rev=190019&view=auto ============================================================================== --- struts/sandbox/trunk/overdrive/Nexus/Core/Tables/IFieldTable.cs (added) +++ struts/sandbox/trunk/overdrive/Nexus/Core/Tables/IFieldTable.cs Fri Jun 10 13:59:19 2005 @@ -0,0 +1,64 @@ +using System.Collections; +using System.Runtime.Serialization; +using Agility.Core; +using Nexus.Validators; + +namespace Nexus.Core.Tables +{ + /// <summary> + /// Inventory of fields used by the application. + /// </summary> + public interface IFieldTable : IContext, ISerializable + { + + /// <summary> + /// Add a field to the set. + /// </summary> + IFieldContext AddField { set; } + + /// <summary> + /// Add a list of fields to the set. + /// </summary> + IList AddFields { set; } + + /// <summary> + /// If true, requires that all fields, including strings fields, be specified [FALSE]. + /// </summary> + bool Strict { set; get; } + + /// <summary> + /// For a given field id, return the Alert message. + /// </summary> + /// <param name="id">FieldContext ID</param> + /// <returns>Alert mesasge for FieldContext ID</returns> + string Alert (string id); + + /// <summary> + /// Utilitizing the FieldContext settings, convert and copy values from the Criteria into the main Context. + /// </summary> + /// <param name="context"></param> + /// <returns></returns> + bool Convert (IValidatorContext context); + + /// <summary> + /// Utilizing the FieldContext settings, format and copy values from the main Context into the Criteria. + /// </summary> + /// <param name="context"></param> + /// <returns></returns> + bool Format (IValidatorContext context); + + /// <summary> + /// Determine if the control is a simple value or a rich control, like a drop down list. + /// </summary> + /// <param name="name"></param> + /// <returns></returns> + bool IsRichControl (string name); + + /// <summary> + /// Obtains the FieldContext for the given ID. + /// </summary> + /// <param name="id">FieldContext ID</param> + /// <returns>FieldContext for ID</returns> + IFieldContext Get (string id); + } +} \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]