aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Scripting/TestApp/Properties/Resources.Designer.cs
blob: 08bc18064e03723b65e465b37bd238479fb1830a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace TestApp.Properties
{


    /// <summary>
    ///   A strongly-typed resource class, for looking up localized strings, etc.
    /// </summary>
    // This class was auto-generated by the StronglyTypedResourceBuilder
    // class via a tool like ResGen or Visual Studio.
    // To add or remove a member, edit your .ResX file then rerun ResGen
    // with the /str option, or rebuild your VS project.
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    internal class Resources
    {

        private static global::System.Resources.ResourceManager resourceMan;

        private static global::System.Globalization.CultureInfo resourceCulture;

        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        internal Resources()
        {
        }

        /// <summary>
        ///   Returns the cached ResourceManager instance used by this class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Resources.ResourceManager ResourceManager
        {
            get
            {
                if ((resourceMan == null))
                {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TestApp.Properties.Resources", typeof(Resources).Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }

        /// <summary>
        ///   Overrides the current thread's CurrentUICulture property for all
        ///   resource lookups using this strongly typed resource class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Globalization.CultureInfo Culture
        {
            get
            {
                return resourceCulture;
            }
            set
            {
                resourceCulture = value;
            }
        }
    }
}
="w"> } } /// <summary> /// Initializes a new instance of the <see cref="RemoteSqlDataSet"/> class. /// </summary> public RemoteSqlDataSet() { Columns = new RemoteSqlColumnCollection(); Rows = new ObservableCollection<RemoteSqlRow>(); } private void OnRowsChanged() { if (Rows != null) { Rows.CollectionChanged -= Rows_CollectionChanged; Rows.CollectionChanged += Rows_CollectionChanged; InitRows(); } } private void Rows_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { InitRows(); } private void InitRows() { if (Rows != null) { foreach (var row in Rows.ToList()) { row.Init( (key) => { return row.Values[Columns.GetIndexOf(key)]; }, (index) => { return row.Values[index]; }); } } } /// <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>(() => { bool columnsRead = false; RemoteSqlDataSet dataSet = new RemoteSqlDataSet(); try { while (reader.Read()) { RemoteSqlRow row = new RemoteSqlRow(); for (int i = 0; i < reader.FieldCount; i++) { if (!columnsRead) { dataSet.Columns.Add(new RemoteSqlColumn() { Name = reader.GetName(i) }); } row.Values.Add(reader.GetValue(i)); } columnsRead = true; dataSet.Rows.Add(row); } } finally { reader.Close(); } return dataSet; }); } /// <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>(); for (int i = 0; i < Columns.Count; i++) { columnsMaxLength.Add(i, Columns[i].Name.Length); } foreach (var row in Rows) { for (int i = 0; i < row.Values.Count; i++) { int valueLength = row.Values[i].ToStringSafe().Length; if (valueLength > columnsMaxLength[i]) { columnsMaxLength[i] = valueLength; } } } String str = String.Empty; for (int i = 0; i < Columns.Count; i++) { str += $"{Columns[i].Name.PadRight(columnsMaxLength[i])}{(i < Columns.Count - 1 ? " | " : "")}"; } int width = str.Length; str += Environment.NewLine + String.Empty.PadRight(width, '-'); foreach (var row in Rows) { str += Environment.NewLine; for (int i = 0; i < row.Values.Count; i++) { str += $"{row.Values[i].ToStringSafe().PadRight(columnsMaxLength[i])}{(i < Columns.Count - 1 ? " | " : "")}"; } } return str; } } }