aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Shared/SQL/RemoteSqlDataSet.cs
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2020-08-13 19:51:57 +0300
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2020-08-13 19:51:57 +0300
commit33f4369a4a30c3e4e9b96d4b8f22aa8f537e7796 (patch)
tree68c91cc970bde94d01a119bc1a404bd442250b88 /Software/Visual_Studio/PPC/Tango.PPC.Shared/SQL/RemoteSqlDataSet.cs
parent2bd7dc98153dd2f0eff5bdaabd89592313ee571e (diff)
parentf0c574a21a02968b227963ae728a2c25801c94ea (diff)
downloadTango-33f4369a4a30c3e4e9b96d4b8f22aa8f537e7796.tar.gz
Tango-33f4369a4a30c3e4e9b96d4b8f22aa8f537e7796.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
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.cs35
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>();