diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-08-12 02:12:46 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-08-12 02:12:46 +0300 |
| commit | bd72c7efe687dfaca6d4fd3c0fc2b5a39d57df55 (patch) | |
| tree | 0d238b22049d445b40a25ca95f5fef2a1c725bbd /Software/Visual_Studio/PPC/Tango.PPC.Shared/SQL/RemoteSqlDataSet.cs | |
| parent | 3cfc4ee06b801e581107f24e691451cd291b6a70 (diff) | |
| download | Tango-bd72c7efe687dfaca6d4fd3c0fc2b5a39d57df55.tar.gz Tango-bd72c7efe687dfaca6d4fd3c0fc2b5a39d57df55.zip | |
More work on proc_doc.
Fixed app crash on code editor selection.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Shared/SQL/RemoteSqlDataSet.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.Shared/SQL/RemoteSqlDataSet.cs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Shared/SQL/RemoteSqlDataSet.cs b/Software/Visual_Studio/PPC/Tango.PPC.Shared/SQL/RemoteSqlDataSet.cs index 089908e5a..72b8d2eb2 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Shared/SQL/RemoteSqlDataSet.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Shared/SQL/RemoteSqlDataSet.cs @@ -9,17 +9,37 @@ using System.Threading.Tasks; namespace Tango.PPC.Shared.SQL { + /// <summary> + /// Represents remote database query result composed of rows and columns. + /// </summary> + /// <example> + /// <para> + /// <i> + /// The following example demonstrates how to set the connected machine's demo state and query for the connected machine's jobs. + /// </i> + /// </para> + /// <code lang="C#" source="../Tango.FSE.Procedures/Examples/Sql/Program.cs" title="Remote SQL" region="Example" /> + /// </example> public class RemoteSqlDataSet { + /// <summary> + /// Gets or sets the dataset columns. + /// </summary> public RemoteSqlColumnCollection Columns { get; set; } private ObservableCollection<RemoteSqlRow> _rows; + /// <summary> + /// Gets or sets the dataset rows. + /// </summary> public ObservableCollection<RemoteSqlRow> Rows { get { return _rows; } set { _rows = value; OnRowsChanged(); } } + /// <summary> + /// Initializes a new instance of the <see cref="RemoteSqlDataSet"/> class. + /// </summary> public RemoteSqlDataSet() { Columns = new RemoteSqlColumnCollection(); @@ -61,6 +81,11 @@ namespace Tango.PPC.Shared.SQL } } + /// <summary> + /// Creates a new <see cref="RemoteSqlDataSet"/> using the specified <see cref="SqlDataReader"/>. + /// </summary> + /// <param name="reader">The reader.</param> + /// <returns></returns> public static Task<RemoteSqlDataSet> Load(SqlDataReader reader) { return Task.Factory.StartNew<RemoteSqlDataSet>(() => @@ -100,11 +125,21 @@ namespace Tango.PPC.Shared.SQL }); } + /// <summary> + /// Returns a <see cref="System.String" /> that represents this instance. + /// </summary> + /// <returns> + /// A <see cref="System.String" /> that represents this instance. + /// </returns> public override string ToString() { return String.Join(", ", Columns.Select(x => x.Name)) + "\n" + String.Join(Environment.NewLine, Rows.Select(x => x.ToString())); } + /// <summary> + /// Formats this dataset as a string with columns and rows. + /// </summary> + /// <returns></returns> public String ToTableString() { Dictionary<int, int> columnsMaxLength = new Dictionary<int, int>(); |
