From bd72c7efe687dfaca6d4fd3c0fc2b5a39d57df55 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Wed, 12 Aug 2020 02:12:46 +0300 Subject: More work on proc_doc. Fixed app crash on code editor selection. --- .../PPC/Tango.PPC.Shared/SQL/RemoteSqlRow.cs | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Shared/SQL/RemoteSqlRow.cs') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/SQL/RemoteSqlRow.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/SQL/RemoteSqlRow.cs index bf6b0ba0c..dfabacfea 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Shared/SQL/RemoteSqlRow.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/SQL/RemoteSqlRow.cs @@ -10,28 +10,61 @@ using Tango.BL.Entities; namespace Tango.PPC.Shared.SQL { + /// + /// Represents a row. + /// + /// + /// + /// + /// The following example demonstrates how to set the connected machine's demo state and query for the connected machine's jobs. + /// + /// + /// + /// public class RemoteSqlRow { private Func _getFuncKey; private Func _getFuncIndex; + /// + /// Gets or sets the row values. + /// public List Values { get; set; } + /// + /// Initializes a new instance of the class. + /// public RemoteSqlRow() { Values = new List(); } + /// + /// Gets a row value by its column name. + /// + /// Name of the column. + /// The column value. public Object Get(String columnName) { return _getFuncKey.Invoke(columnName); } + /// + /// Gets a row value by its column index. + /// + /// Index of the column. + /// The column value. public Object Get(int columnIndex) { return _getFuncIndex.Invoke(columnIndex); } + /// + /// Gets a row value as type T by its column name. + /// + /// Expected column type. + /// Name of the column. + /// The column value. public T Get(String columnName) { var value = _getFuncKey.Invoke(columnName); @@ -46,6 +79,12 @@ namespace Tango.PPC.Shared.SQL } } + /// + /// Gets a row value by its column index. + /// + /// Expected column type + /// Index of the column. + /// The column value. public T Get(int columnIndex) { var value = _getFuncIndex.Invoke(columnIndex); @@ -66,11 +105,22 @@ namespace Tango.PPC.Shared.SQL _getFuncIndex = getFuncIndex; } + /// + /// Returns a that represents this instance. + /// + /// + /// A that represents this instance. + /// public override string ToString() { return String.Join(", ", Values); } + /// + /// Creates an object of type T and maps this row to it based on its properties decorated with . + /// + /// + /// public T Map() where T : class, new() { var obj = Activator.CreateInstance(); @@ -78,6 +128,11 @@ namespace Tango.PPC.Shared.SQL return obj; } + /// + /// Maps this row to the specified object based on its properties decorated with . + /// + /// Model type + /// The object. public void Map(T obj) where T : class { foreach (var prop in typeof(T).GetPropertiesWithAttribute()) -- cgit v1.3.1