diff --git a/ABCNET.sln b/ABCNET.sln index d9d63b9..82d09c2 100644 --- a/ABCNET.sln +++ b/ABCNET.sln @@ -1,6 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 +# Visual Studio 2012 +# SharpDevelop 4.4 VisualStudioVersion = 16.0.29609.76 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ABCNET", "NETMouse - .NET release\ABCNET.csproj", "{738CF8B3-CE36-4BE8-B9DA-BE4759D6CF5B}" diff --git a/NETMouse - .NET release/ABCNET.csproj b/NETMouse - .NET release/ABCNET.csproj index ef96bf3..25695fa 100644 --- a/NETMouse - .NET release/ABCNET.csproj +++ b/NETMouse - .NET release/ABCNET.csproj @@ -55,6 +55,9 @@ ArrayE.cs + + ArrayE.cs + BaseE.cs @@ -75,6 +78,9 @@ MatrixE.cs + + MatrixE.cs + MatrixE.cs @@ -96,40 +102,55 @@ TupleE.cs - - - Array.cs + + ArrayU.cs + + + ArrayU.cs + + + + ArrayU.cs + + + + BaseU.cs + + + BaseU.cs + + + BaseU.cs - - Array.cs + + MatrixU.cs - - - Base.cs + + MatrixU.cs - - Base.cs + + MatrixU.cs - - Base.cs + + + + SequenceU.cs - - - Matrix.cs + + SequenceU.cs - - Matrix.cs + + SequenceU.cs - - - Sequence.cs + + + TupleU.cs - - Tuple.cs + + TupleU.cs - - - Tuple.cs + + TupleU.cs diff --git a/NETMouse - .NET release/Examples/C#/ABCNET.xml b/NETMouse - .NET release/Examples/C#/ABCNET.xml index 18af2ba..2d93b0e 100644 --- a/NETMouse - .NET release/Examples/C#/ABCNET.xml +++ b/NETMouse - .NET release/Examples/C#/ABCNET.xml @@ -1301,55 +1301,55 @@ Предоставляет функционал для работы с базовыми типами. - + Меняет местами значения двух переменных. Первая переменная. Вторая переменная. - + Читает значение типа Boolean. Приглашение к вводу. Значение. - + Читает значение типа Char. Приглашение к вводу. Значение. - + Читает значение типа Real. Приглашение к вводу. Значение. - + Читает значение типа Integer. Приглашение к вводу. Значение. - + Читает значение типа String. Приглашение к вводу. Значение. - + Генерирует случайное число [0..1). Число. - + Генерирует случайное число [low..high]. @@ -1357,7 +1357,7 @@ Верхняя граница диапазона. Число. - + Генерирует случайное число [low..high]. diff --git a/NETMouse - .NET release/Examples/PascalABC.NET/ABCNET.xml b/NETMouse - .NET release/Examples/PascalABC.NET/ABCNET.xml index 18af2ba..2d93b0e 100644 --- a/NETMouse - .NET release/Examples/PascalABC.NET/ABCNET.xml +++ b/NETMouse - .NET release/Examples/PascalABC.NET/ABCNET.xml @@ -1301,55 +1301,55 @@ Предоставляет функционал для работы с базовыми типами. - + Меняет местами значения двух переменных. Первая переменная. Вторая переменная. - + Читает значение типа Boolean. Приглашение к вводу. Значение. - + Читает значение типа Char. Приглашение к вводу. Значение. - + Читает значение типа Real. Приглашение к вводу. Значение. - + Читает значение типа Integer. Приглашение к вводу. Значение. - + Читает значение типа String. Приглашение к вводу. Значение. - + Генерирует случайное число [0..1). Число. - + Генерирует случайное число [low..high]. @@ -1357,7 +1357,7 @@ Верхняя граница диапазона. Число. - + Генерирует случайное число [low..high]. diff --git a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_1.pas b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_1.pas index 059f577..f64264e 100644 --- a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_1.pas +++ b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_1.pas @@ -2,6 +2,6 @@ uses ABCNET.Utils; uses ABCNET.Extensions; begin - Arr.Rand(Base.ReadInteger('N:'), -23, 34).Println(); - Base.ReadChar(); + Arr.Rand(BaseU.ReadInteger('N:'), -23, 34).Println(); + BaseU.ReadChar(); end. \ No newline at end of file diff --git a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_10.pas b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_10.pas index 7c7fd24..f405465 100644 --- a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_10.pas +++ b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_10.pas @@ -2,6 +2,6 @@ uses ABCNET.Utils; uses ABCNET.Extensions; begin - Arr.ReadInteger(Base.ReadInteger('N:'), 'Элемент {0}-ый:').Where(x -> x = 0).Count().Println(); - Base.ReadChar(); + Arr.ReadInteger(BaseU.ReadInteger('N:'), 'Элемент {0}-ый:').Where(x -> x = 0).Count().Println(); + BaseU.ReadChar(); end. \ No newline at end of file diff --git a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_11.pas b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_11.pas index 939d321..12df11e 100644 --- a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_11.pas +++ b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_11.pas @@ -2,6 +2,6 @@ uses ABCNET.Utils; uses ABCNET.Extensions; begin - Arr.ReadInteger(Base.ReadInteger('N:'), 'Элемент {0}-ый:').Where(x -> x mod 2 = 0).Count().Println(); - Base.ReadChar(); + Arr.ReadInteger(BaseU.ReadInteger('N:'), 'Элемент {0}-ый:').Where(x -> x mod 2 = 0).Count().Println(); + BaseU.ReadChar(); end. \ No newline at end of file diff --git a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_12.pas b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_12.pas index d0d7e28..953e833 100644 --- a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_12.pas +++ b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_12.pas @@ -2,7 +2,7 @@ uses ABCNET.Utils; uses ABCNET.Extensions; begin - var c := Base.ReadInteger('C:'); + var c := BaseU.ReadInteger('C:'); Arr.ReadInteger(10, 'Элемент {0}-ый:').Where(x -> x > c).Average().Println(); - Base.ReadChar(); + BaseU.ReadChar(); end. \ No newline at end of file diff --git a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_13.pas b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_13.pas index fb1ea7b..bc77782 100644 --- a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_13.pas +++ b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_13.pas @@ -2,6 +2,6 @@ uses ABCNET.Utils; uses ABCNET.Extensions; begin - Arr.ReadInteger(Base.ReadInteger('N:'), 'Элемент {0}-ый:').Where((x, i) -> i mod 2 = 0).Aggregate((a, b) -> a * b).Println(); - Base.ReadChar(); + Arr.ReadInteger(BaseU.ReadInteger('N:'), 'Элемент {0}-ый:').Where((x, i) -> i mod 2 = 0).Aggregate((a, b) -> a * b).Println(); + BaseU.ReadChar(); end. \ No newline at end of file diff --git a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_14.pas b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_14.pas index 253d97a..a5603ad 100644 --- a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_14.pas +++ b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_14.pas @@ -2,7 +2,7 @@ uses ABCNET.Utils; uses ABCNET.Extensions; begin - var a := Arr.ReadInteger(Base.ReadInteger('N:'), 'Элемент {0}-ый:'); + var a := Arr.ReadInteger(BaseU.ReadInteger('N:'), 'Элемент {0}-ый:'); var b := a.Where(x -> x mod 2 = 0).ToArray(); - Base.ReadChar(); + BaseU.ReadChar(); end. \ No newline at end of file diff --git a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_2.pas b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_2.pas index c5626de..178e533 100644 --- a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_2.pas +++ b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_2.pas @@ -2,6 +2,6 @@ uses ABCNET.Utils; uses ABCNET.Extensions; begin - Arr.ReadInteger(Base.ReadInteger('N:'), 'Элемент {0}-ый:').Aggregate((a, b) -> a * b).Println(); - Base.ReadChar(); + Arr.ReadInteger(BaseU.ReadInteger('N:'), 'Элемент {0}-ый:').Aggregate((a, b) -> a * b).Println(); + BaseU.ReadChar(); end. \ No newline at end of file diff --git a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_3.pas b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_3.pas index 587c891..c3b55bc 100644 --- a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_3.pas +++ b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_3.pas @@ -2,6 +2,6 @@ uses ABCNET.Utils; uses ABCNET.Extensions; begin - Arr.ReadInteger(Base.ReadInteger('N:'), 'Элемент {0}-ый:').Sum().Println(); - Base.ReadChar(); + Arr.ReadInteger(BaseU.ReadInteger('N:'), 'Элемент {0}-ый:').Sum().Println(); + BaseU.ReadChar(); end. \ No newline at end of file diff --git a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_4.pas b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_4.pas index a488ef1..33a3a34 100644 --- a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_4.pas +++ b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_4.pas @@ -2,6 +2,6 @@ uses ABCNET.Utils; uses ABCNET.Extensions; begin - Arr.ReadInteger(Base.ReadInteger('N:'), 'Элемент {0}-ый:').Average().Println(); - Base.ReadChar(); + Arr.ReadInteger(BaseU.ReadInteger('N:'), 'Элемент {0}-ый:').Average().Println(); + BaseU.ReadChar(); end. \ No newline at end of file diff --git a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_5.pas b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_5.pas index 35c7e1c..d63bc26 100644 --- a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_5.pas +++ b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_5.pas @@ -2,6 +2,6 @@ uses ABCNET.Utils; uses ABCNET.Extensions; begin - Arr.ReadInteger(Base.ReadInteger('N:'), 'Элемент {0}-ый:').Where((x, i) -> i mod 2 = 0).Sum().Println(); - Base.ReadChar(); + Arr.ReadInteger(BaseU.ReadInteger('N:'), 'Элемент {0}-ый:').Where((x, i) -> i mod 2 = 0).Sum().Println(); + BaseU.ReadChar(); end. \ No newline at end of file diff --git a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_6.pas b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_6.pas index 24ba051..f64bc29 100644 --- a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_6.pas +++ b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_6.pas @@ -2,7 +2,7 @@ uses ABCNET.Utils; uses ABCNET.Extensions; begin - Arr.Rand(Base.ReadInteger('N:'), -19, 26).Println() + Arr.Rand(BaseU.ReadInteger('N:'), -19, 26).Println() .Where((x, i) -> i mod 2 <> 0).Aggregate((a, b) -> a * b).Println(); - Base.ReadChar(); + BaseU.ReadChar(); end. \ No newline at end of file diff --git a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_7.pas b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_7.pas index 265fff3..64b2697 100644 --- a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_7.pas +++ b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_7.pas @@ -2,8 +2,8 @@ uses ABCNET.Utils; uses ABCNET.Extensions; begin - var t := Base.ReadInteger('T:'); - Arr.Rand(Base.ReadInteger('N:'), -56, 47).Println() + var t := BaseU.ReadInteger('T:'); + Arr.Rand(BaseU.ReadInteger('N:'), -56, 47).Println() .Where((x, i) -> (i mod 2 = 0) and (x > t)).Aggregate((a, b) -> a * b).Println(); - Base.ReadChar(); + BaseU.ReadChar(); end. \ No newline at end of file diff --git a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_8.pas b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_8.pas index cb77e21..4cbe040 100644 --- a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_8.pas +++ b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_8.pas @@ -2,6 +2,6 @@ uses ABCNET.Utils; uses ABCNET.Extensions; begin - Arr.ReadInteger(Base.ReadInteger('N:'), 'Элемент {0}-ый:').Min().Println(); - Base.ReadChar(); + Arr.ReadInteger(BaseU.ReadInteger('N:'), 'Элемент {0}-ый:').Min().Println(); + BaseU.ReadChar(); end. \ No newline at end of file diff --git a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_9.pas b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_9.pas index 050aae6..631062c 100644 --- a/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_9.pas +++ b/NETMouse - .NET release/Examples/PascalABC.NET/Arrays_9.pas @@ -3,6 +3,6 @@ uses ABCNET.Utils; uses ABCNET.Extensions; begin - Arr.Rand(Base.ReadInteger('N:'), -20, 25).Println().Numerate().MinBy(x -> x.Item).Index.Println(); - Base.ReadChar(); + Arr.Rand(BaseU.ReadInteger('N:'), -20, 25).Println().Numerate().MinBy(x -> x.Item).Index.Println(); + BaseU.ReadChar(); end. \ No newline at end of file diff --git a/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_1.pas b/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_1.pas index 493c47e..d33095d 100644 --- a/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_1.pas +++ b/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_1.pas @@ -2,6 +2,6 @@ uses ABCNET.Utils; uses ABCNET.Extensions; begin - Matr.Rand(Base.ReadInteger('N:'), Base.ReadInteger('M:'), -20, 25).Print(); - Base.ReadChar(); + Matr.Rand(BaseU.ReadInteger('N:'), BaseU.ReadInteger('M:'), -20, 25).Print(); + BaseU.ReadChar(); end. \ No newline at end of file diff --git a/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_10.pas b/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_10.pas index 22b77d1..eb1ee57 100644 --- a/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_10.pas +++ b/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_10.pas @@ -3,5 +3,5 @@ uses ABCNET.Extensions; begin Matr.Gen(3, 3, (i, j) -> i + 1).Print(); - Base.ReadChar(); + BaseU.ReadChar(); end. \ No newline at end of file diff --git a/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_11.pas b/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_11.pas index 218ac5d..239665b 100644 --- a/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_11.pas +++ b/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_11.pas @@ -25,6 +25,6 @@ function Max(self: array [,] of integer): integer; extensionmethod; end; begin - Matr.Rand(Base.ReadInteger('N:'), Base.ReadInteger('M:'), -27, 38).Print().Max().Println(); - Base.ReadChar(); + Matr.Rand(BaseU.ReadInteger('N:'), BaseU.ReadInteger('M:'), -27, 38).Print().Max().Println(); + BaseU.ReadChar(); end. \ No newline at end of file diff --git a/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_2.pas b/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_2.pas index 90a542a..8d362cf 100644 --- a/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_2.pas +++ b/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_2.pas @@ -17,6 +17,6 @@ function Sum(self: array [,] of integer): array of integer; extensionmethod; end; begin - Matr.ReadInteger(Base.ReadInteger('N:'), Base.ReadInteger('M:'), 'Элемент ({0}, {1})-ый:').Sum().Println(); - Base.ReadChar(); + Matr.ReadInteger(BaseU.ReadInteger('N:'), BaseU.ReadInteger('M:'), 'Элемент ({0}, {1})-ый:').Sum().Println(); + BaseU.ReadChar(); end. \ No newline at end of file diff --git a/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_3.pas b/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_3.pas index ed6bfcf..df8295a 100644 --- a/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_3.pas +++ b/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_3.pas @@ -18,6 +18,6 @@ function Min(self: array [,] of integer): integer; extensionmethod; end; begin - Matr.Rand(Base.ReadInteger('N:'), Base.ReadInteger('M:'), -30, 45).Print().Min().Println(); - Base.ReadChar(); + Matr.Rand(BaseU.ReadInteger('N:'), BaseU.ReadInteger('M:'), -30, 45).Print().Min().Println(); + BaseU.ReadChar(); end. \ No newline at end of file diff --git a/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_4.pas b/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_4.pas index 7018ffb..d101f21 100644 --- a/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_4.pas +++ b/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_4.pas @@ -24,6 +24,6 @@ function Min(self: array [,] of integer): (integer, integer); extensionmethod; end; begin - Matr.ReadInteger(Base.ReadInteger('N:'), Base.ReadInteger('M:'), 'Элемент ({0}, {1})-ый:').Min().Println(); - Base.ReadChar(); + Matr.ReadInteger(BaseU.ReadInteger('N:'), BaseU.ReadInteger('M:'), 'Элемент ({0}, {1})-ый:').Min().Println(); + BaseU.ReadChar(); end. \ No newline at end of file diff --git a/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_5.pas b/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_5.pas index a6c5cfb..dcf90b8 100644 --- a/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_5.pas +++ b/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_5.pas @@ -17,6 +17,6 @@ function Sum(self: array [,] of integer): array of integer; extensionmethod; end; begin - Matr.Rand(Base.ReadInteger('N:'), Base.ReadInteger('M:'), -19, 30).Print().Sum().Println(); - Base.ReadChar(); + Matr.Rand(BaseU.ReadInteger('N:'), BaseU.ReadInteger('M:'), -19, 30).Print().Sum().Println(); + BaseU.ReadChar(); end. \ No newline at end of file diff --git a/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_6.pas b/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_6.pas index 1d3e217..57402fc 100644 --- a/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_6.pas +++ b/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_6.pas @@ -18,6 +18,6 @@ function Count(self: array [,] of integer): array of integer; extensionmethod; end; begin - Matr.ReadInteger(Base.ReadInteger('N:'), Base.ReadInteger('M:'), 'Элемент ({0}, {1})-ый:').Count().Println(); - Base.ReadChar(); + Matr.ReadInteger(BaseU.ReadInteger('N:'), BaseU.ReadInteger('M:'), 'Элемент ({0}, {1})-ый:').Count().Println(); + BaseU.ReadChar(); end. \ No newline at end of file diff --git a/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_7.pas b/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_7.pas index 77a4029..b6d3959 100644 --- a/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_7.pas +++ b/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_7.pas @@ -3,5 +3,5 @@ uses ABCNET.Extensions; begin Matr.Gen(4, 4, (i, j) -> i = j ? 1 : 0).Print(); - Base.ReadChar(); + BaseU.ReadChar(); end. \ No newline at end of file diff --git a/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_8.pas b/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_8.pas index 959b71c..c2643af 100644 --- a/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_8.pas +++ b/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_8.pas @@ -19,6 +19,6 @@ function Count(self: array [,] of integer): array of integer; extensionmethod; end; begin - Matr.ReadInteger(Base.ReadInteger('N:'), Base.ReadInteger('M:'), 'Элемент ({0}, {1})-ый:').Count().Numerate().MaxBy(x -> x.Item).Index.Println(); - Base.ReadChar(); + Matr.ReadInteger(BaseU.ReadInteger('N:'), BaseU.ReadInteger('M:'), 'Элемент ({0}, {1})-ый:').Count().Numerate().MaxBy(x -> x.Item).Index.Println(); + BaseU.ReadChar(); end. \ No newline at end of file diff --git a/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_9.pas b/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_9.pas index 7602a77..83f4aa1 100644 --- a/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_9.pas +++ b/NETMouse - .NET release/Examples/PascalABC.NET/Matrices_9.pas @@ -18,10 +18,10 @@ function Sort(self: array [,] of integer): array [,] of integer; extensionmethod for var k := 0 to rowsCount - 1 do for var i := 0 to rowsCount - k - 2 do if result[i, j] > result[i + 1, j] then - Base.Swap(result[i, j], result[i + 1, j]); + BaseU.Swap(result[i, j], result[i + 1, j]); end; begin - Matr.Rand(Base.ReadInteger('N:'), Base.ReadInteger('M:'), -17, 26).Print().Sort().Print(); - Base.ReadChar(); + Matr.Rand(BaseU.ReadInteger('N:'), BaseU.ReadInteger('M:'), -17, 26).Print().Sort().Print(); + BaseU.ReadChar(); end. \ No newline at end of file diff --git a/NETMouse - .NET release/Extensions/ArrayE.Generators.cs b/NETMouse - .NET release/Extensions/ArrayE.Generators.cs index 3075f3e..44a3a0b 100644 --- a/NETMouse - .NET release/Extensions/ArrayE.Generators.cs +++ b/NETMouse - .NET release/Extensions/ArrayE.Generators.cs @@ -8,7 +8,9 @@ namespace ABCNET.Extensions /// public static partial class ArrayE { + #region public + /// /// Заполняет массив на основе функции селектора. /// @@ -58,7 +60,7 @@ public static void Random(this int[] array, int low = Int32BordersHelper.Low, in throw new ArgumentException(nameof(low)); for (int i = 0; i < array.Length; i++) - array[i] = Base.Random(low, high); + array[i] = BaseU.Random(low, high); } /// @@ -75,7 +77,7 @@ public static void Random(this double[] array, double low = DoubleBordersHelper. throw new ArgumentException(nameof(low)); for (int i = 0; i < array.Length; i++) - array[i] = Base.Random(low, high); + array[i] = BaseU.Random(low, high); } /// @@ -91,6 +93,8 @@ public static void Fill(this T[] array, T value) for (int i = 0; i < array.Length; i++) array[i] = value; } + #endregion public + } } diff --git a/NETMouse - .NET release/Extensions/ArrayE.Input.cs b/NETMouse - .NET release/Extensions/ArrayE.Input.cs index e34d2c9..f906c07 100644 --- a/NETMouse - .NET release/Extensions/ArrayE.Input.cs +++ b/NETMouse - .NET release/Extensions/ArrayE.Input.cs @@ -1,4 +1,5 @@ using System; +using System.Numerics; using ABCNET.Utils; namespace ABCNET.Extensions @@ -8,28 +9,67 @@ namespace ABCNET.Extensions /// public static partial class ArrayE { + #region public + /// /// Заполняет массив значениями типа Boolean. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] /// /// Массив. /// Приглашение к вводу. - public static void Read(this bool[] array, string prompt = EmptyStringHelper.Empty) + public static void Read(this bool[] array, string prompt = null) + { + if (array == null) + throw new ArgumentNullException(nameof(array)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int i = 0; + while (i < array.Length) + { + array[i] = BaseU.ReadBoolean(string.Format(prompt, i)); + i++; + } + } + + /// + /// Заполняет массив значениями типа Byte. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Массив. + /// Приглашение к вводу. + public static void Read(this byte[] array, string prompt = null) + { + if (array == null) + throw new ArgumentNullException(nameof(array)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int i = 0; + while (i < array.Length) + { + array[i] = BaseU.ReadByte(string.Format(prompt, i)); + i++; + } + } + + /// + /// Заполняет массив значениями типа SByte. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Массив. + /// Приглашение к вводу. + public static void Read(this sbyte[] array, string prompt = null) { if (array == null) throw new ArgumentNullException(nameof(array)); + prompt = prompt ?? EmptyStringHelper.Empty; + int i = 0; while (i < array.Length) - try - { - array[i] = Base.ReadBoolean(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, i)); - i++; - } - catch (Exception) - { - InputErrorHelper.Message.PrintLine(); - } + { + array[i] = BaseU.ReadSByte(string.Format(prompt, i)); + i++; + } } /// @@ -37,13 +77,39 @@ public static void Read(this bool[] array, string prompt = EmptyStringHelper.Emp /// /// Массив. /// Приглашение к вводу. - public static void Read(this char[] array, string prompt = EmptyStringHelper.Empty) + public static void Read(this char[] array, string prompt = null) + { + if (array == null) + throw new ArgumentNullException(nameof(array)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int i = 0; + while (i < array.Length) + { + array[i] = BaseU.ReadChar(string.Format(prompt, i)); + i++; + } + } + + /// + /// Заполняет массив значениями типа Decimal. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Массив. + /// Приглашение к вводу. + public static void Read(this decimal[] array, string prompt = null) { if (array == null) throw new ArgumentNullException(nameof(array)); - for (int i = 0; i < array.Length; i++) - array[i] = Base.ReadChar(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, i)); + prompt = prompt ?? EmptyStringHelper.Empty; + + int i = 0; + while (i < array.Length) + { + array[i] = BaseU.ReadDecimal(string.Format(prompt, i)); + i++; + } } /// @@ -51,22 +117,39 @@ public static void Read(this char[] array, string prompt = EmptyStringHelper.Emp /// /// Массив. /// Приглашение к вводу. - public static void Read(this double[] array, string prompt = EmptyStringHelper.Empty) + public static void Read(this double[] array, string prompt = null) + { + if (array == null) + throw new ArgumentNullException(nameof(array)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int i = 0; + while (i < array.Length) + { + array[i] = BaseU.ReadDouble(string.Format(prompt, i)); + i++; + } + } + + /// + /// Заполняет массив значениями типа Single. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Массив. + /// Приглашение к вводу. + public static void Read(this float[] array, string prompt = null) { if (array == null) throw new ArgumentNullException(nameof(array)); + prompt = prompt ?? EmptyStringHelper.Empty; + int i = 0; while (i < array.Length) - try - { - array[i] = Base.ReadDouble(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, i)); - i++; - } - catch (Exception) - { - InputErrorHelper.Message.PrintLine(); - } + { + array[i] = BaseU.ReadSingle(string.Format(prompt, i)); + i++; + } } /// @@ -74,22 +157,139 @@ public static void Read(this double[] array, string prompt = EmptyStringHelper.E /// /// Массив. /// Приглашение к вводу. - public static void Read(this int[] array, string prompt = EmptyStringHelper.Empty) + public static void Read(this int[] array, string prompt = null) { if (array == null) throw new ArgumentNullException(nameof(array)); + prompt = prompt ?? EmptyStringHelper.Empty; + int i = 0; while (i < array.Length) - try - { - array[i] = Base.ReadInt32(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, i)); - i++; - } - catch (Exception) - { - InputErrorHelper.Message.PrintLine(); - } + { + array[i] = BaseU.ReadInt32(string.Format(prompt, i)); + i++; + } + } + + /// + /// Заполняет массив значениями типа UInt32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Массив. + /// Приглашение к вводу. + public static void Read(this uint[] array, string prompt = null) + { + if (array == null) + throw new ArgumentNullException(nameof(array)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int i = 0; + while (i < array.Length) + { + array[i] = BaseU.ReadUInt32(string.Format(prompt, i)); + i++; + } + } + + /// + /// Заполняет массив значениями типа Int64. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Массив. + /// Приглашение к вводу. + public static void Read(this long[] array, string prompt = null) + { + if (array == null) + throw new ArgumentNullException(nameof(array)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int i = 0; + while (i < array.Length) + { + array[i] = BaseU.ReadInt64(string.Format(prompt, i)); + i++; + } + } + + /// + /// Заполняет массив значениями типа UInt64. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Массив. + /// Приглашение к вводу. + public static void Read(this ulong[] array, string prompt = null) + { + if (array == null) + throw new ArgumentNullException(nameof(array)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int i = 0; + while (i < array.Length) + { + array[i] = BaseU.ReadUInt64(string.Format(prompt, i)); + i++; + } + } + + /// + /// Заполняет массив значениями типа Int16. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Массив. + /// Приглашение к вводу. + public static void Read(this short[] array, string prompt = null) + { + if (array == null) + throw new ArgumentNullException(nameof(array)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int i = 0; + while (i < array.Length) + { + array[i] = BaseU.ReadInt16(string.Format(prompt, i)); + i++; + } + } + + /// + /// Заполняет массив значениями типа UInt16. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Массив. + /// Приглашение к вводу. + public static void Read(this ushort[] array, string prompt = null) + { + if (array == null) + throw new ArgumentNullException(nameof(array)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int i = 0; + while (i < array.Length) + { + array[i] = BaseU.ReadUInt16(string.Format(prompt, i)); + i++; + } + } + + /// + /// Заполняет массив значениями типа BigInteger. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Массив. + /// Приглашение к вводу. + public static void Read(this BigInteger[] array, string prompt = null) + { + if (array == null) + throw new ArgumentNullException(nameof(array)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int i = 0; + while (i < array.Length) + { + array[i] = BaseU.ReadBigInteger(string.Format(prompt, i)); + i++; + } } /// @@ -97,14 +297,22 @@ public static void Read(this int[] array, string prompt = EmptyStringHelper.Empt /// /// Массив. /// Приглашение к вводу. - public static void Read(this string[] array, string prompt = EmptyStringHelper.Empty) + public static void Read(this string[] array, string prompt = null) { if (array == null) throw new ArgumentNullException(nameof(array)); - for (int i = 0; i < array.Length; i++) - array[i] = Base.ReadString(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, i)); + prompt = prompt ?? EmptyStringHelper.Empty; + + int i = 0; + while (i < array.Length) + { + array[i] = BaseU.ReadString(string.Format(prompt, i)); + i++; + } } + #endregion public + } } diff --git a/NETMouse - .NET release/Extensions/ArrayE.Nullable.Input.cs b/NETMouse - .NET release/Extensions/ArrayE.Nullable.Input.cs new file mode 100644 index 0000000..74a7412 --- /dev/null +++ b/NETMouse - .NET release/Extensions/ArrayE.Nullable.Input.cs @@ -0,0 +1,301 @@ +using ABCNET.Utils; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Numerics; +using System.Text; + +namespace ABCNET.Extensions +{ + /// + /// Предоставляет функционал для работы с массивами. + /// + public static partial class ArrayE + { + + #region public + + /// + /// Заполняет массив значениями типа Boolean?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Массив. + /// Приглашение к вводу. + public static void Read(this bool?[] array, string prompt = null) + { + if (array == null) + throw new ArgumentNullException(nameof(array)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int i = 0; + while (i < array.Length) + { + array[i] = BaseU.Nullable.ReadBoolean(string.Format(prompt, i)); + i++; + } + } + + /// + /// Заполняет массив значениями типа Byte?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Массив. + /// Приглашение к вводу. + public static void Read(this byte?[] array, string prompt = null) + { + if (array == null) + throw new ArgumentNullException(nameof(array)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int i = 0; + while (i < array.Length) + { + array[i] = BaseU.Nullable.ReadByte(string.Format(prompt, i)); + i++; + } + } + + /// + /// Заполняет массив значениями типа SByte?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Массив. + /// Приглашение к вводу. + public static void Read(this sbyte?[] array, string prompt = null) + { + if (array == null) + throw new ArgumentNullException(nameof(array)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int i = 0; + while (i < array.Length) + { + array[i] = BaseU.Nullable.ReadSByte(string.Format(prompt, i)); + i++; + } + } + + /// + /// Заполняет массив значениями типа Char?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Массив. + /// Приглашение к вводу. + public static void Read(this char?[] array, string prompt = null) + { + if (array == null) + throw new ArgumentNullException(nameof(array)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int i = 0; + while (i < array.Length) + { + array[i] = BaseU.Nullable.ReadChar(string.Format(prompt, i)); + i++; + } + } + + /// + /// Заполняет массив значениями типа Decimal?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Массив. + /// Приглашение к вводу. + public static void Read(this decimal?[] array, string prompt = null) + { + if (array == null) + throw new ArgumentNullException(nameof(array)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int i = 0; + while (i < array.Length) + { + array[i] = BaseU.Nullable.ReadDecimal(string.Format(prompt, i)); + i++; + } + } + + /// + /// Заполняет массив значениями типа Double?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Массив. + /// Приглашение к вводу. + public static void Read(this double?[] array, string prompt = null) + { + if (array == null) + throw new ArgumentNullException(nameof(array)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int i = 0; + while (i < array.Length) + { + array[i] = BaseU.Nullable.ReadDouble(string.Format(prompt, i)); + i++; + } + } + + /// + /// Заполняет массив значениями типа Single?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Массив. + /// Приглашение к вводу. + public static void Read(this float?[] array, string prompt = null) + { + if (array == null) + throw new ArgumentNullException(nameof(array)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int i = 0; + while (i < array.Length) + { + array[i] = BaseU.Nullable.ReadSingle(string.Format(prompt, i)); + i++; + } + } + + /// + /// Заполняет массив значениями типа Int32?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Массив. + /// Приглашение к вводу. + public static void Read(this int?[] array, string prompt = null) + { + if (array == null) + throw new ArgumentNullException(nameof(array)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int i = 0; + while (i < array.Length) + { + array[i] = BaseU.Nullable.ReadInt32(string.Format(prompt, i)); + i++; + } + } + + /// + /// Заполняет массив значениями типа UInt32?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Массив. + /// Приглашение к вводу. + public static void Read(this uint?[] array, string prompt = null) + { + if (array == null) + throw new ArgumentNullException(nameof(array)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int i = 0; + while (i < array.Length) + { + array[i] = BaseU.Nullable.ReadUInt32(string.Format(prompt, i)); + i++; + } + } + + /// + /// Заполняет массив значениями типа Int64?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Массив. + /// Приглашение к вводу. + public static void Read(this long?[] array, string prompt = null) + { + if (array == null) + throw new ArgumentNullException(nameof(array)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int i = 0; + while (i < array.Length) + { + array[i] = BaseU.Nullable.ReadInt64(string.Format(prompt, i)); + i++; + } + } + + /// + /// Заполняет массив значениями типа UInt64?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Массив. + /// Приглашение к вводу. + public static void Read(this ulong?[] array, string prompt = null) + { + if (array == null) + throw new ArgumentNullException(nameof(array)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int i = 0; + while (i < array.Length) + { + array[i] = BaseU.Nullable.ReadUInt64(string.Format(prompt, i)); + i++; + } + } + + /// + /// Заполняет массив значениями типа Int16?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Массив. + /// Приглашение к вводу. + public static void Read(this short?[] array, string prompt = null) + { + if (array == null) + throw new ArgumentNullException(nameof(array)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int i = 0; + while (i < array.Length) + { + array[i] = BaseU.Nullable.ReadInt16(string.Format(prompt, i)); + i++; + } + } + + /// + /// Заполняет массив значениями типа UInt16?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Массив. + /// Приглашение к вводу. + public static void Read(this ushort?[] array, string prompt = null) + { + if (array == null) + throw new ArgumentNullException(nameof(array)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int i = 0; + while (i < array.Length) + { + array[i] = BaseU.Nullable.ReadUInt16(string.Format(prompt, i)); + i++; + } + } + + /// + /// Заполняет массив значениями типа BigInteger?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Массив. + /// Приглашение к вводу. + public static void Read(this BigInteger?[] array, string prompt = null) + { + if (array == null) + throw new ArgumentNullException(nameof(array)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int i = 0; + while (i < array.Length) + { + array[i] = BaseU.Nullable.ReadBigInteger(string.Format(prompt, i)); + i++; + } + } + + #endregion + + } +} \ No newline at end of file diff --git a/NETMouse - .NET release/Extensions/BaseE.Generators.cs b/NETMouse - .NET release/Extensions/BaseE.Generators.cs index 3a1a85a..18f3a4c 100644 --- a/NETMouse - .NET release/Extensions/BaseE.Generators.cs +++ b/NETMouse - .NET release/Extensions/BaseE.Generators.cs @@ -7,7 +7,9 @@ namespace ABCNET.Extensions /// public static partial class BaseE { + #region public + /// /// Создаёт последовательность от начального числа до конечного. /// @@ -50,6 +52,8 @@ public static IEnumerable Step(this int from, int step) from += step; } while (true); } + #endregion public + } } diff --git a/NETMouse - .NET release/Extensions/BaseE.Other.cs b/NETMouse - .NET release/Extensions/BaseE.Other.cs index f871dd0..35cd0c0 100644 --- a/NETMouse - .NET release/Extensions/BaseE.Other.cs +++ b/NETMouse - .NET release/Extensions/BaseE.Other.cs @@ -5,7 +5,9 @@ /// public static partial class BaseE { + #region public + /// /// Проверяет лежит ли число между другими двумя. /// @@ -16,9 +18,25 @@ public static partial class BaseE public static bool IsBetween(this int target, int firstBorder, int secondBorder) { if (firstBorder > secondBorder) - Utils.Base.Swap(ref firstBorder, ref secondBorder); + return (target >= secondBorder) && (target <= firstBorder); return (target >= firstBorder) && (target <= secondBorder); } + + /// + /// Проверяет лежит ли число между другими двумя. + /// + /// Число. + /// Первая граница. + /// Вторая граница. + /// Результат. + public static bool IsBetween(this int target, int firstBorder, bool equalsFirst, int secondBorder, bool equalsSecond) + { + if (firstBorder > secondBorder) + return (target > secondBorder || (equalsSecond && target == secondBorder)) && (target < firstBorder || (equalsFirst && target == firstBorder)); + return (target > firstBorder || (equalsFirst && target == firstBorder)) && (target < secondBorder || (equalsSecond && target == secondBorder)); + } + #endregion public + } } diff --git a/NETMouse - .NET release/Extensions/BaseE.Output.cs b/NETMouse - .NET release/Extensions/BaseE.Output.cs index 6936104..5fd321e 100644 --- a/NETMouse - .NET release/Extensions/BaseE.Output.cs +++ b/NETMouse - .NET release/Extensions/BaseE.Output.cs @@ -7,7 +7,9 @@ namespace ABCNET.Extensions /// public static partial class BaseE { + #region public + /// /// Boolean. /// @@ -183,6 +185,8 @@ public static int PrintLine(this int item) Console.WriteLine(item.NilOrString()); return item; } + #endregion public + } } \ No newline at end of file diff --git a/NETMouse - .NET release/Extensions/MatrixE.Generators.cs b/NETMouse - .NET release/Extensions/MatrixE.Generators.cs index 2193287..7ca4459 100644 --- a/NETMouse - .NET release/Extensions/MatrixE.Generators.cs +++ b/NETMouse - .NET release/Extensions/MatrixE.Generators.cs @@ -8,7 +8,9 @@ namespace ABCNET.Extensions /// public static partial class MatrixE { + #region public + /// /// Заполняет матрицу на основе функции селектора. /// @@ -43,7 +45,7 @@ public static void Random(this int[,] matrix, int low = Int32BordersHelper.Low, for (int i = 0; i < matrix.GetLength(0); i++) for (int j = 0; j < matrix.GetLength(1); j++) - matrix[i, j] = Base.Random(low, high); + matrix[i, j] = BaseU.Random(low, high); } /// @@ -61,7 +63,7 @@ public static void Random(this double[,] matrix, double low = DoubleBordersHelpe for (int i = 0; i < matrix.GetLength(0); i++) for (int j = 0; j < matrix.GetLength(1); j++) - matrix[i, j] = Base.Random(low, high); + matrix[i, j] = BaseU.Random(low, high); } /// @@ -79,6 +81,8 @@ public static void Fill(this T[,] matrix, T value) for (int j = 0; j < matrix.GetLength(1); j++) matrix[i, j] = value; } + #endregion public + } } diff --git a/NETMouse - .NET release/Extensions/MatrixE.Getters.cs b/NETMouse - .NET release/Extensions/MatrixE.Getters.cs index 0661864..4a0ba28 100644 --- a/NETMouse - .NET release/Extensions/MatrixE.Getters.cs +++ b/NETMouse - .NET release/Extensions/MatrixE.Getters.cs @@ -9,7 +9,9 @@ namespace ABCNET.Extensions /// public static partial class MatrixE { + #region public + /// /// Получает столбец матрицы. /// @@ -209,6 +211,7 @@ public static IEnumerable Rows(this T[,] matrix) yield return matrix.InternalGetRow(j); } } + #endregion public #region private @@ -282,7 +285,7 @@ private static TOutput[] InternalGetRow(this T[,] matrix, int index, int columnsCount = newMatrix.GetLength(1); for (int j = 0; j < columnsCount; j++) - Base.Swap(ref newMatrix[firstIndex, j], ref newMatrix[secondIndex, j]); + BaseU.Swap(ref newMatrix[firstIndex, j], ref newMatrix[secondIndex, j]); return newMatrix; } @@ -301,7 +304,7 @@ private static TOutput[] InternalGetRow(this T[,] matrix, int index, { newMatrix[firstIndex, j] = selector(newMatrix[firstIndex, j]); newMatrix[secondIndex, j] = selector(newMatrix[secondIndex, j]); - Base.Swap(ref newMatrix[firstIndex, j], ref newMatrix[secondIndex, j]); + BaseU.Swap(ref newMatrix[firstIndex, j], ref newMatrix[secondIndex, j]); } return newMatrix; @@ -319,7 +322,7 @@ private static TOutput[] InternalGetRow(this T[,] matrix, int index, int rowsCount = newMatrix.GetLength(0); for (int i = 0; i < rowsCount; i++) - Base.Swap(ref newMatrix[i, firstIndex], ref newMatrix[i, secondIndex]); + BaseU.Swap(ref newMatrix[i, firstIndex], ref newMatrix[i, secondIndex]); return newMatrix; } @@ -338,11 +341,13 @@ private static TOutput[] InternalGetRow(this T[,] matrix, int index, { newMatrix[i, firstIndex] = selector(newMatrix[i, firstIndex]); newMatrix[i, secondIndex] = selector(newMatrix[i, secondIndex]); - Base.Swap(ref newMatrix[i, firstIndex], ref newMatrix[i, secondIndex]); + BaseU.Swap(ref newMatrix[i, firstIndex], ref newMatrix[i, secondIndex]); } return newMatrix; } + #endregion private + } } diff --git a/NETMouse - .NET release/Extensions/MatrixE.Input.cs b/NETMouse - .NET release/Extensions/MatrixE.Input.cs index 7b6ba1c..60d8aa8 100644 --- a/NETMouse - .NET release/Extensions/MatrixE.Input.cs +++ b/NETMouse - .NET release/Extensions/MatrixE.Input.cs @@ -1,6 +1,8 @@ using System; +using System.Numerics; using ABCNET.Utils; + namespace ABCNET.Extensions { /// @@ -8,7 +10,9 @@ namespace ABCNET.Extensions /// public static partial class MatrixE { + #region public + /// /// Заполняет матрицу значениями типа Boolean. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] /// @@ -19,27 +23,59 @@ public static void Read(this bool[,] matrix, string prompt = EmptyStringHelper.E if (matrix == null) throw new ArgumentNullException(nameof(matrix)); - int i = 0; - int j = 0; + prompt = prompt ?? EmptyStringHelper.Empty; - while (i < matrix.GetLength(0)) + for (int i = 0; i < matrix.GetLength(0); i++) { - while (j < matrix.GetLength(1)) - try - { - matrix[i, j] = Base.ReadBoolean(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, i, j)); - j++; - } - catch (Exception) - { - Console.WriteLine(InputErrorHelper.Message); - } - - i++; - j = 0; + for (int j = 0; j < matrix.GetLength(1); j++) + { + matrix[i, j] = BaseU.ReadBoolean(string.Format(prompt, i, j)); + } } } + + /// + /// Заполняет матрицу значениями типа Byte. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Матрица. + /// Приглашение к вводу. + public static void Read(this byte[,] matrix, string prompt = EmptyStringHelper.Empty) + { + if (matrix == null) + throw new ArgumentNullException(nameof(matrix)); + + prompt = prompt ?? EmptyStringHelper.Empty; + for (int i = 0; i < matrix.GetLength(0); i++) + { + for (int j = 0; j < matrix.GetLength(1); j++) + { + matrix[i, j] = BaseU.ReadByte(string.Format(prompt, i, j)); + } + } + } + + /// + /// Заполняет матрицу значениями типа SByte. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Матрица. + /// Приглашение к вводу. + public static void Read(this sbyte[,] matrix, string prompt = EmptyStringHelper.Empty) + { + if (matrix == null) + throw new ArgumentNullException(nameof(matrix)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + for (int i = 0; i < matrix.GetLength(0); i++) + { + for (int j = 0; j < matrix.GetLength(1); j++) + { + matrix[i, j] = BaseU.ReadSByte(string.Format(prompt, i, j)); + } + } + } + /// /// Заполняет матрицу значениями типа Char. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] /// @@ -50,11 +86,38 @@ public static void Read(this char[,] matrix, string prompt = EmptyStringHelper.E if (matrix == null) throw new ArgumentNullException(nameof(matrix)); + prompt = prompt ?? EmptyStringHelper.Empty; + for (int i = 0; i < matrix.GetLength(0); i++) + { for (int j = 0; j < matrix.GetLength(1); j++) - matrix[i, j] = Base.ReadChar(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, i, j)); + { + matrix[i, j] = BaseU.ReadChar(string.Format(prompt, i, j)); + } + } } + + /// + /// Заполняет матрицу значениями типа Decimal. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Матрица. + /// Приглашение к вводу. + public static void Read(this decimal[,] matrix, string prompt = EmptyStringHelper.Empty) + { + if (matrix == null) + throw new ArgumentNullException(nameof(matrix)); + prompt = prompt ?? EmptyStringHelper.Empty; + + for (int i = 0; i < matrix.GetLength(0); i++) + { + for (int j = 0; j < matrix.GetLength(1); j++) + { + matrix[i, j] = BaseU.ReadDecimal(string.Format(prompt, i, j)); + } + } + } + /// /// Заполняет матрицу значениями типа Double. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] /// @@ -65,27 +128,38 @@ public static void Read(this double[,] matrix, string prompt = EmptyStringHelper if (matrix == null) throw new ArgumentNullException(nameof(matrix)); - int i = 0; - int j = 0; + prompt = prompt ?? EmptyStringHelper.Empty; - while (i < matrix.GetLength(0)) + for (int i = 0; i < matrix.GetLength(0); i++) { - while (j < matrix.GetLength(1)) - try - { - matrix[i, j] = Base.ReadDouble(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, i, j)); - j++; - } - catch (Exception) - { - Console.WriteLine(InputErrorHelper.Message); - } - - i++; - j = 0; + for (int j = 0; j < matrix.GetLength(1); j++) + { + matrix[i, j] = BaseU.ReadDouble(string.Format(prompt, i, j)); + } } } + + /// + /// Заполняет матрицу значениями типа Single. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Матрица. + /// Приглашение к вводу. + public static void Read(this float[,] matrix, string prompt = EmptyStringHelper.Empty) + { + if (matrix == null) + throw new ArgumentNullException(nameof(matrix)); + + prompt = prompt ?? EmptyStringHelper.Empty; + for (int i = 0; i < matrix.GetLength(0); i++) + { + for (int j = 0; j < matrix.GetLength(1); j++) + { + matrix[i, j] = BaseU.ReadSingle(string.Format(prompt, i, j)); + } + } + } + /// /// Заполняет матрицу значениями типа Int32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] /// @@ -96,27 +170,143 @@ public static void Read(this int[,] matrix, string prompt = EmptyStringHelper.Em if (matrix == null) throw new ArgumentNullException(nameof(matrix)); - int i = 0; - int j = 0; + prompt = prompt ?? EmptyStringHelper.Empty; - while (i < matrix.GetLength(0)) + for (int i = 0; i < matrix.GetLength(0); i++) { - while (j < matrix.GetLength(1)) - try - { - matrix[i, j] = Base.ReadInt32(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, i, j)); - j++; - } - catch (Exception) - { - Console.WriteLine(InputErrorHelper.Message); - } - - i++; - j = 0; + for (int j = 0; j < matrix.GetLength(1); j++) + { + matrix[i, j] = BaseU.ReadInt32(string.Format(prompt, i, j)); + } } } + + /// + /// Заполняет матрицу значениями типа UInt32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Матрица. + /// Приглашение к вводу. + public static void Read(this uint[,] matrix, string prompt = EmptyStringHelper.Empty) + { + if (matrix == null) + throw new ArgumentNullException(nameof(matrix)); + + prompt = prompt ?? EmptyStringHelper.Empty; + for (int i = 0; i < matrix.GetLength(0); i++) + { + for (int j = 0; j < matrix.GetLength(1); j++) + { + matrix[i, j] = BaseU.ReadUInt32(string.Format(prompt, i, j)); + } + } + } + + /// + /// Заполняет матрицу значениями типа Int64. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Матрица. + /// Приглашение к вводу. + public static void Read(this long[,] matrix, string prompt = EmptyStringHelper.Empty) + { + if (matrix == null) + throw new ArgumentNullException(nameof(matrix)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + for (int i = 0; i < matrix.GetLength(0); i++) + { + for (int j = 0; j < matrix.GetLength(1); j++) + { + matrix[i, j] = BaseU.ReadInt64(string.Format(prompt, i, j)); + } + } + } + + /// + /// Заполняет матрицу значениями типа UInt64. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Матрица. + /// Приглашение к вводу. + public static void Read(this ulong[,] matrix, string prompt = EmptyStringHelper.Empty) + { + if (matrix == null) + throw new ArgumentNullException(nameof(matrix)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + for (int i = 0; i < matrix.GetLength(0); i++) + { + for (int j = 0; j < matrix.GetLength(1); j++) + { + matrix[i, j] = BaseU.ReadUInt64(string.Format(prompt, i, j)); + } + } + } + + /// + /// Заполняет матрицу значениями типа Int16. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Матрица. + /// Приглашение к вводу. + public static void Read(this short[,] matrix, string prompt = EmptyStringHelper.Empty) + { + if (matrix == null) + throw new ArgumentNullException(nameof(matrix)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + for (int i = 0; i < matrix.GetLength(0); i++) + { + for (int j = 0; j < matrix.GetLength(1); j++) + { + matrix[i, j] = BaseU.ReadInt16(string.Format(prompt, i, j)); + } + } + } + + /// + /// Заполняет матрицу значениями типа UInt16. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Матрица. + /// Приглашение к вводу. + public static void Read(this ushort[,] matrix, string prompt = EmptyStringHelper.Empty) + { + if (matrix == null) + throw new ArgumentNullException(nameof(matrix)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + for (int i = 0; i < matrix.GetLength(0); i++) + { + for (int j = 0; j < matrix.GetLength(1); j++) + { + matrix[i, j] = BaseU.ReadUInt16(string.Format(prompt, i, j)); + } + } + } + + /// + /// Заполняет матрицу значениями типа BigInteger. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Матрица. + /// Приглашение к вводу. + public static void Read(this BigInteger[,] matrix, string prompt = EmptyStringHelper.Empty) + { + if (matrix == null) + throw new ArgumentNullException(nameof(matrix)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + for (int i = 0; i < matrix.GetLength(0); i++) + { + for (int j = 0; j < matrix.GetLength(1); j++) + { + matrix[i, j] = BaseU.ReadBigInteger(string.Format(prompt, i, j)); + } + } + } + /// /// Заполняет матрицу значениями типа String. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] /// @@ -127,10 +317,18 @@ public static void Read(this string[,] matrix, string prompt = EmptyStringHelper if (matrix == null) throw new ArgumentNullException(nameof(matrix)); + prompt = prompt ?? EmptyStringHelper.Empty; + for (int i = 0; i < matrix.GetLength(0); i++) + { for (int j = 0; j < matrix.GetLength(1); j++) - matrix[i, j] = Base.ReadString(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, i, j)); + { + matrix[i, j] = BaseU.ReadString(string.Format(prompt, i, j)); + } + } } + #endregion public + } } diff --git a/NETMouse - .NET release/Extensions/MatrixE.Nullable.Input.cs b/NETMouse - .NET release/Extensions/MatrixE.Nullable.Input.cs new file mode 100644 index 0000000..08d4796 --- /dev/null +++ b/NETMouse - .NET release/Extensions/MatrixE.Nullable.Input.cs @@ -0,0 +1,315 @@ +using ABCNET.Utils; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Numerics; +using System.Text; + +namespace ABCNET.Extensions +{ + /// + /// Предоставляет функционал для работы с базовыми типами. + /// + public static partial class MatrixE + { + + #region public + + /// + /// Заполняет матрицу значениями типа Boolean?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Матрица. + /// Приглашение к вводу. + public static void Read(this bool?[,] matrix, string prompt = EmptyStringHelper.Empty) + { + if (matrix == null) + throw new ArgumentNullException(nameof(matrix)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + for (int i = 0; i < matrix.GetLength(0); i++) + { + for (int j = 0; j < matrix.GetLength(1); j++) + { + matrix[i, j] = BaseU.Nullable.ReadBoolean(string.Format(prompt, i, j)); + } + } + } + + /// + /// Заполняет матрицу значениями типа Byte?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Матрица. + /// Приглашение к вводу. + public static void Read(this byte?[,] matrix, string prompt = EmptyStringHelper.Empty) + { + if (matrix == null) + throw new ArgumentNullException(nameof(matrix)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + for (int i = 0; i < matrix.GetLength(0); i++) + { + for (int j = 0; j < matrix.GetLength(1); j++) + { + matrix[i, j] = BaseU.Nullable.ReadByte(string.Format(prompt, i, j)); + } + } + } + + /// + /// Заполняет матрицу значениями типа SByte?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Матрица. + /// Приглашение к вводу. + public static void Read(this sbyte?[,] matrix, string prompt = EmptyStringHelper.Empty) + { + if (matrix == null) + throw new ArgumentNullException(nameof(matrix)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + for (int i = 0; i < matrix.GetLength(0); i++) + { + for (int j = 0; j < matrix.GetLength(1); j++) + { + matrix[i, j] = BaseU.Nullable.ReadSByte(string.Format(prompt, i, j)); + } + } + } + + /// + /// Заполняет матрицу значениями типа Char?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Матрица. + /// Приглашение к вводу. + public static void Read(this char?[,] matrix, string prompt = EmptyStringHelper.Empty) + { + if (matrix == null) + throw new ArgumentNullException(nameof(matrix)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + for (int i = 0; i < matrix.GetLength(0); i++) + { + for (int j = 0; j < matrix.GetLength(1); j++) + { + matrix[i, j] = BaseU.Nullable.ReadChar(string.Format(prompt, i, j)); + } + } + } + + /// + /// Заполняет матрицу значениями типа Decimal?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Матрица. + /// Приглашение к вводу. + public static void Read(this decimal?[,] matrix, string prompt = EmptyStringHelper.Empty) + { + if (matrix == null) + throw new ArgumentNullException(nameof(matrix)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + for (int i = 0; i < matrix.GetLength(0); i++) + { + for (int j = 0; j < matrix.GetLength(1); j++) + { + matrix[i, j] = BaseU.Nullable.ReadDecimal(string.Format(prompt, i, j)); + } + } + } + + /// + /// Заполняет матрицу значениями типа Double?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Матрица. + /// Приглашение к вводу. + public static void Read(this double?[,] matrix, string prompt = EmptyStringHelper.Empty) + { + if (matrix == null) + throw new ArgumentNullException(nameof(matrix)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + for (int i = 0; i < matrix.GetLength(0); i++) + { + for (int j = 0; j < matrix.GetLength(1); j++) + { + matrix[i, j] = BaseU.Nullable.ReadDouble(string.Format(prompt, i, j)); + } + } + } + + /// + /// Заполняет матрицу значениями типа Single?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Матрица. + /// Приглашение к вводу. + public static void Read(this float?[,] matrix, string prompt = EmptyStringHelper.Empty) + { + if (matrix == null) + throw new ArgumentNullException(nameof(matrix)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + for (int i = 0; i < matrix.GetLength(0); i++) + { + for (int j = 0; j < matrix.GetLength(1); j++) + { + matrix[i, j] = BaseU.Nullable.ReadSingle(string.Format(prompt, i, j)); + } + } + } + + /// + /// Заполняет матрицу значениями типа Int32?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Матрица. + /// Приглашение к вводу. + public static void Read(this int?[,] matrix, string prompt = EmptyStringHelper.Empty) + { + if (matrix == null) + throw new ArgumentNullException(nameof(matrix)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + for (int i = 0; i < matrix.GetLength(0); i++) + { + for (int j = 0; j < matrix.GetLength(1); j++) + { + matrix[i, j] = BaseU.Nullable.ReadInt32(string.Format(prompt, i, j)); + } + } + } + + /// + /// Заполняет матрицу значениями типа UInt32?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Матрица. + /// Приглашение к вводу. + public static void Read(this uint?[,] matrix, string prompt = EmptyStringHelper.Empty) + { + if (matrix == null) + throw new ArgumentNullException(nameof(matrix)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + for (int i = 0; i < matrix.GetLength(0); i++) + { + for (int j = 0; j < matrix.GetLength(1); j++) + { + matrix[i, j] = BaseU.Nullable.ReadUInt32(string.Format(prompt, i, j)); + } + } + } + + /// + /// Заполняет матрицу значениями типа Int64?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Матрица. + /// Приглашение к вводу. + public static void Read(this long?[,] matrix, string prompt = EmptyStringHelper.Empty) + { + if (matrix == null) + throw new ArgumentNullException(nameof(matrix)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + for (int i = 0; i < matrix.GetLength(0); i++) + { + for (int j = 0; j < matrix.GetLength(1); j++) + { + matrix[i, j] = BaseU.Nullable.ReadInt64(string.Format(prompt, i, j)); + } + } + } + + /// + /// Заполняет матрицу значениями типа UInt64?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Матрица. + /// Приглашение к вводу. + public static void Read(this ulong?[,] matrix, string prompt = EmptyStringHelper.Empty) + { + if (matrix == null) + throw new ArgumentNullException(nameof(matrix)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + for (int i = 0; i < matrix.GetLength(0); i++) + { + for (int j = 0; j < matrix.GetLength(1); j++) + { + matrix[i, j] = BaseU.Nullable.ReadUInt64(string.Format(prompt, i, j)); + } + } + } + + /// + /// Заполняет матрицу значениями типа Int16?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Матрица. + /// Приглашение к вводу. + public static void Read(this short?[,] matrix, string prompt = EmptyStringHelper.Empty) + { + if (matrix == null) + throw new ArgumentNullException(nameof(matrix)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + for (int i = 0; i < matrix.GetLength(0); i++) + { + for (int j = 0; j < matrix.GetLength(1); j++) + { + matrix[i, j] = BaseU.Nullable.ReadInt16(string.Format(prompt, i, j)); + } + } + } + + /// + /// Заполняет матрицу значениями типа UInt16?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Матрица. + /// Приглашение к вводу. + public static void Read(this ushort?[,] matrix, string prompt = EmptyStringHelper.Empty) + { + if (matrix == null) + throw new ArgumentNullException(nameof(matrix)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + for (int i = 0; i < matrix.GetLength(0); i++) + { + for (int j = 0; j < matrix.GetLength(1); j++) + { + matrix[i, j] = BaseU.Nullable.ReadUInt16(string.Format(prompt, i, j)); + } + } + } + + /// + /// Заполняет матрицу значениями типа BigInteger?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Матрица. + /// Приглашение к вводу. + public static void Read(this BigInteger?[,] matrix, string prompt = EmptyStringHelper.Empty) + { + if (matrix == null) + throw new ArgumentNullException(nameof(matrix)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + for (int i = 0; i < matrix.GetLength(0); i++) + { + for (int j = 0; j < matrix.GetLength(1); j++) + { + matrix[i, j] = BaseU.Nullable.ReadBigInteger(string.Format(prompt, i, j)); + } + } + } + + #endregion + + } +} diff --git a/NETMouse - .NET release/Extensions/MatrixE.Output.cs b/NETMouse - .NET release/Extensions/MatrixE.Output.cs index 06f1b38..5226e30 100644 --- a/NETMouse - .NET release/Extensions/MatrixE.Output.cs +++ b/NETMouse - .NET release/Extensions/MatrixE.Output.cs @@ -7,7 +7,9 @@ namespace ABCNET.Extensions /// public static partial class MatrixE { + #region public + /// /// Выводит матрицу. /// @@ -77,6 +79,7 @@ public static partial class MatrixE Console.WriteLine(); return matrix; } + #endregion public #region private @@ -137,6 +140,8 @@ public static partial class MatrixE return matrix; } + #endregion private + } } diff --git a/NETMouse - .NET release/Extensions/SequenceE.Getters.cs b/NETMouse - .NET release/Extensions/SequenceE.Getters.cs index 2f2a439..cc29c33 100644 --- a/NETMouse - .NET release/Extensions/SequenceE.Getters.cs +++ b/NETMouse - .NET release/Extensions/SequenceE.Getters.cs @@ -1,4 +1,5 @@ -using System; +using ABCNET.Utils; +using System; using System.Collections.Generic; using System.Linq; @@ -9,7 +10,9 @@ namespace ABCNET.Extensions /// public static partial class SequenceE { + #region public + /// /// Преобразует последовательность в кортеж. /// @@ -29,7 +32,7 @@ public static Tuple ToTuple2(this IEnumerable collection) b = en.Current; if (en.MoveNext()) throw new ArgumentException(nameof(collection)); - return Tuple.Create(a, b); + return TupleU.Of(a, b); } throw new ArgumentException(nameof(collection)); } @@ -59,7 +62,7 @@ public static Tuple ToTuple3(this IEnumerable collection) c = en.Current; if (en.MoveNext()) throw new ArgumentException(nameof(collection)); - return Tuple.Create(a, b, c); + return TupleU.Of(a, b, c); } throw new ArgumentException(nameof(collection)); } @@ -95,7 +98,7 @@ public static Tuple ToTuple4(this IEnumerable collection) d = en.Current; if (en.MoveNext()) throw new ArgumentException(nameof(collection)); - return Tuple.Create(a, b, c, d); + return TupleU.Of(a, b, c, d); } throw new ArgumentException(nameof(collection)); } @@ -137,7 +140,7 @@ public static Tuple ToTuple5(this IEnumerable collection) e = en.Current; if (en.MoveNext()) throw new ArgumentException(nameof(collection)); - return Tuple.Create(a, b, c, d, e); + return TupleU.Of(a, b, c, d, e); } throw new ArgumentException(nameof(collection)); } @@ -185,7 +188,7 @@ public static Tuple ToTuple6(this IEnumerable collection f = en.Current; if (en.MoveNext()) throw new ArgumentException(nameof(collection)); - return Tuple.Create(a, b, c, d, e, f); + return TupleU.Of(a, b, c, d, e, f); } throw new ArgumentException(nameof(collection)); } @@ -239,7 +242,7 @@ public static Tuple ToTuple7(this IEnumerable collect g = en.Current; if (en.MoveNext()) throw new ArgumentException(nameof(collection)); - return Tuple.Create(a, b, c, d, e, f, g); + return TupleU.Of(a, b, c, d, e, f, g); } throw new ArgumentException(nameof(collection)); } @@ -342,7 +345,7 @@ public static IEnumerable> Pairwise(this IEnumerable collectio while (enumerator.MoveNext()) { - yield return Tuple.Create(previous, enumerator.Current); + yield return TupleU.Of(previous, enumerator.Current); previous = enumerator.Current; } } @@ -370,7 +373,7 @@ public static IEnumerable> Pairwise(this IEn while (enumerator.MoveNext()) { TOutput current = selector(enumerator.Current); - yield return Tuple.Create(previous, current); + yield return TupleU.Of(previous, current); previous = current; } } @@ -431,7 +434,7 @@ public static IEnumerable> ZipTuple(this IEnumerable coll if (secondCollection == null) throw new ArgumentNullException(nameof(secondCollection)); - return collection.Zip(secondCollection, delegate (T x, T1 y) { return Tuple.Create(x, y); }); + return collection.Zip(secondCollection, delegate (T x, T1 y) { return TupleU.Of(x, y); }); } /// @@ -444,7 +447,7 @@ public static Tuple, IEnumerable> UnzipTuple(this IEnu if (collection == null) throw new ArgumentNullException(nameof(collection)); - return Tuple.Create(collection.Select(delegate (Tuple x) { return x.Item1; }), + return TupleU.Of(collection.Select(delegate (Tuple x) { return x.Item1; }), collection.Select(delegate (Tuple x) { return x.Item2; })); } @@ -705,6 +708,8 @@ public static PartitionResult Partition(this IEnumerable collection, Pr return new PartitionResult(trueList, falseList); } + #endregion public + } } diff --git a/NETMouse - .NET release/Extensions/SequenceE.Output.cs b/NETMouse - .NET release/Extensions/SequenceE.Output.cs index cffec6a..afe9448 100644 --- a/NETMouse - .NET release/Extensions/SequenceE.Output.cs +++ b/NETMouse - .NET release/Extensions/SequenceE.Output.cs @@ -8,7 +8,9 @@ namespace ABCNET.Extensions /// public static partial class SequenceE { + #region public + /// /// Выводит последовательность. /// @@ -130,6 +132,8 @@ public static IEnumerable PrintLinesBy(this IEnumerable collec Console.WriteLine(selector(item).NilOrString()); return collection; } + #endregion public + } } diff --git a/NETMouse - .NET release/Extensions/StringE.Output.cs b/NETMouse - .NET release/Extensions/StringE.Output.cs index dd6f350..501c345 100644 --- a/NETMouse - .NET release/Extensions/StringE.Output.cs +++ b/NETMouse - .NET release/Extensions/StringE.Output.cs @@ -7,7 +7,9 @@ namespace ABCNET.Extensions /// public static partial class StringE { + #region public + /// /// Выводит строку на экран. /// @@ -29,6 +31,8 @@ public static string PrintLine(this string input) Console.WriteLine(input.NilOrString()); return input; } + #endregion public + } } diff --git a/NETMouse - .NET release/Extensions/TupleE.Getters.cs b/NETMouse - .NET release/Extensions/TupleE.Getters.cs index 59a19bc..4e00f2d 100644 --- a/NETMouse - .NET release/Extensions/TupleE.Getters.cs +++ b/NETMouse - .NET release/Extensions/TupleE.Getters.cs @@ -8,7 +8,11 @@ namespace ABCNET.Extensions /// public static partial class TupleE { + #region public + + #region ToSequence + /// /// Преобразует кортеж в последовательность. /// @@ -19,79 +23,80 @@ public static IEnumerable ToSequence(this Tuple tuple) yield return tuple.Item1; yield return tuple.Item2; } - + /// - /// Добавляет элемент к кортежу. - /// - /// Кортеж. - /// Элемент. - /// Кортеж. - public static Tuple AddFirst(this Tuple tuple, T2 item) - { - return new Tuple(item, tuple.Item1, tuple.Item2); - } - - /// - /// Добавляет элемент к кортежу. + /// Преобразует кортеж в последовательность. /// /// Кортеж. - /// Элемент. - /// Кортеж. - public static Tuple Add(this Tuple tuple, T2 item) + /// Последовательность. + public static IEnumerable ToSequence(this Tuple tuple) { - return new Tuple(tuple.Item1, tuple.Item2, item); + yield return tuple.Item1; + yield return tuple.Item2; + yield return tuple.Item3; } - - - + /// /// Преобразует кортеж в последовательность. /// /// Кортеж. /// Последовательность. - public static IEnumerable ToSequence(this Tuple tuple) + public static IEnumerable ToSequence(this Tuple tuple) { yield return tuple.Item1; yield return tuple.Item2; yield return tuple.Item3; + yield return tuple.Item4; } - + /// - /// Добавляет элемент к кортежу. + /// Преобразует кортеж в последовательность. /// /// Кортеж. - /// Элемент. - /// Кортеж. - public static Tuple AddFirst(this Tuple tuple, T item) + /// Последовательность. + public static IEnumerable ToSequence(this Tuple tuple) { - return new Tuple(item, tuple.Item1, tuple.Item2, tuple.Item3); + yield return tuple.Item1; + yield return tuple.Item2; + yield return tuple.Item3; + yield return tuple.Item4; + yield return tuple.Item5; } - + /// - /// Добавляет элемент к кортежу. + /// Преобразует кортеж в последовательность. /// /// Кортеж. - /// Элемент. - /// Кортеж. - public static Tuple Add(this Tuple tuple, T item) + /// Последовательность. + public static IEnumerable ToSequence(this Tuple tuple) { - return new Tuple(tuple.Item1, tuple.Item2, tuple.Item3, item); + yield return tuple.Item1; + yield return tuple.Item2; + yield return tuple.Item3; + yield return tuple.Item4; + yield return tuple.Item5; + yield return tuple.Item6; } - - - + /// /// Преобразует кортеж в последовательность. /// /// Кортеж. /// Последовательность. - public static IEnumerable ToSequence(this Tuple tuple) + public static IEnumerable ToSequence(this Tuple tuple) { yield return tuple.Item1; yield return tuple.Item2; yield return tuple.Item3; yield return tuple.Item4; + yield return tuple.Item5; + yield return tuple.Item6; + yield return tuple.Item7; } + + #endregion + + #region AddFirst /// /// Добавляет элемент к кортежу. @@ -99,9 +104,9 @@ public static IEnumerable ToSequence(this Tuple tuple) /// Кортеж. /// Элемент. /// Кортеж. - public static Tuple AddFirst(this Tuple tuple, T item) + public static Tuple AddFirst(this Tuple tuple, T2 item) { - return new Tuple(item, tuple.Item1, tuple.Item2, tuple.Item3, tuple.Item4); + return new Tuple(item, tuple.Item1, tuple.Item2); } /// @@ -110,25 +115,20 @@ public static Tuple AddFirst(this Tuple tuple, T i /// Кортеж. /// Элемент. /// Кортеж. - public static Tuple Add(this Tuple tuple, T item) + public static Tuple AddFirst(this Tuple tuple, T3 item) { - return new Tuple(tuple.Item1, tuple.Item2, tuple.Item3, tuple.Item4, item); + return new Tuple(item, tuple.Item1, tuple.Item2, tuple.Item3); } - - /// - /// Преобразует кортеж в последовательность. + /// Добавляет элемент к кортежу. /// /// Кортеж. - /// Последовательность. - public static IEnumerable ToSequence(this Tuple tuple) + /// Элемент. + /// Кортеж. + public static Tuple AddFirst(this Tuple tuple, T4 item) { - yield return tuple.Item1; - yield return tuple.Item2; - yield return tuple.Item3; - yield return tuple.Item4; - yield return tuple.Item5; + return new Tuple(item, tuple.Item1, tuple.Item2, tuple.Item3, tuple.Item4); } /// @@ -137,9 +137,9 @@ public static IEnumerable ToSequence(this Tuple tuple) /// Кортеж. /// Элемент. /// Кортеж. - public static Tuple AddFirst(this Tuple tuple, T item) + public static Tuple AddFirst(this Tuple tuple, T5 item) { - return new Tuple(item, tuple.Item1, tuple.Item2, tuple.Item3, tuple.Item4, tuple.Item5); + return new Tuple(item, tuple.Item1, tuple.Item2, tuple.Item3, tuple.Item4, tuple.Item5); } /// @@ -148,26 +148,35 @@ public static Tuple AddFirst(this Tuple tupl /// Кортеж. /// Элемент. /// Кортеж. - public static Tuple Add(this Tuple tuple, T item) + public static Tuple AddFirst(this Tuple tuple, T6 item) { - return new Tuple(tuple.Item1, tuple.Item2, tuple.Item3, tuple.Item4, tuple.Item5, item); + return new Tuple(item, tuple.Item1, tuple.Item2, tuple.Item3, tuple.Item4, tuple.Item5, tuple.Item6); } + + #endregion + + #region Add - + /// + /// Добавляет элемент к кортежу. + /// + /// Кортеж. + /// Элемент. + /// Кортеж. + public static Tuple Add(this Tuple tuple, T2 item) + { + return new Tuple(tuple.Item1, tuple.Item2, item); + } /// - /// Преобразует кортеж в последовательность. + /// Добавляет элемент к кортежу. /// /// Кортеж. - /// Последовательность. - public static IEnumerable ToSequence(this Tuple tuple) + /// Элемент. + /// Кортеж. + public static Tuple Add(this Tuple tuple, T3 item) { - yield return tuple.Item1; - yield return tuple.Item2; - yield return tuple.Item3; - yield return tuple.Item4; - yield return tuple.Item5; - yield return tuple.Item6; + return new Tuple(tuple.Item1, tuple.Item2, tuple.Item3, item); } /// @@ -176,9 +185,9 @@ public static IEnumerable ToSequence(this Tuple tuple) /// Кортеж. /// Элемент. /// Кортеж. - public static Tuple AddFirst(this Tuple tuple, T item) + public static Tuple Add(this Tuple tuple, T4 item) { - return new Tuple(item, tuple.Item1, tuple.Item2, tuple.Item3, tuple.Item4, tuple.Item5, tuple.Item6); + return new Tuple(tuple.Item1, tuple.Item2, tuple.Item3, tuple.Item4, item); } /// @@ -187,26 +196,25 @@ public static Tuple AddFirst(this TupleКортеж. /// Элемент. /// Кортеж. - public static Tuple Add(this Tuple tuple, T item) + public static Tuple Add(this Tuple tuple, T5 item) { - return new Tuple(tuple.Item1, tuple.Item2, tuple.Item3, tuple.Item4, tuple.Item5, tuple.Item6, item); + return new Tuple(tuple.Item1, tuple.Item2, tuple.Item3, tuple.Item4, tuple.Item5, item); } /// - /// Преобразует кортеж в последовательность. + /// Добавляет элемент к кортежу. /// /// Кортеж. - /// Последовательность. - public static IEnumerable ToSequence(this Tuple tuple) + /// Элемент. + /// Кортеж. + public static Tuple Add(this Tuple tuple, T6 item) { - yield return tuple.Item1; - yield return tuple.Item2; - yield return tuple.Item3; - yield return tuple.Item4; - yield return tuple.Item5; - yield return tuple.Item6; - yield return tuple.Item7; + return new Tuple(tuple.Item1, tuple.Item2, tuple.Item3, tuple.Item4, tuple.Item5, tuple.Item6, item); } + + #endregion + #endregion public + } } diff --git a/NETMouse - .NET release/Extensions/TupleE.Output.cs b/NETMouse - .NET release/Extensions/TupleE.Output.cs index a34bf08..f7f396a 100644 --- a/NETMouse - .NET release/Extensions/TupleE.Output.cs +++ b/NETMouse - .NET release/Extensions/TupleE.Output.cs @@ -7,7 +7,9 @@ namespace ABCNET.Extensions /// public static partial class TupleE { + #region public + /// /// Выводит кортеж. /// @@ -15,7 +17,7 @@ public static partial class TupleE /// Кортеж. public static Tuple Print(this Tuple tuple) { - Console.Write(Utils.Tuple.Of(tuple.Item1.NilOrString(), tuple.Item2.NilOrString())); + Console.Write(Utils.TupleU.Of(tuple.Item1.NilOrString(), tuple.Item2.NilOrString())); return tuple; } @@ -30,7 +32,7 @@ public static Tuple Print(this Tuple tuple, Func fun if (func == null) throw new ArgumentNullException(nameof(func)); - return Utils.Tuple.Of(func(tuple.Item1), func(tuple.Item2)).Print(); + return Utils.TupleU.Of(func(tuple.Item1), func(tuple.Item2)).Print(); } /// @@ -44,7 +46,7 @@ public static Tuple PrintBy(this Tuple tuple, Func fun if (func == null) throw new ArgumentNullException(nameof(func)); - Utils.Tuple.Of(func(tuple.Item1), func(tuple.Item2)).Print(); + Utils.TupleU.Of(func(tuple.Item1), func(tuple.Item2)).Print(); return tuple; } @@ -55,7 +57,7 @@ public static Tuple PrintBy(this Tuple tuple, Func fun /// Кортеж. public static Tuple PrintLine(this Tuple tuple) { - Console.WriteLine(Utils.Tuple.Of(tuple.Item1.NilOrString(), tuple.Item2.NilOrString())); + Console.WriteLine(Utils.TupleU.Of(tuple.Item1.NilOrString(), tuple.Item2.NilOrString())); return tuple; } @@ -70,7 +72,7 @@ public static Tuple PrintLine(this Tuple tuple, Func if (func == null) throw new ArgumentNullException(nameof(func)); - return Utils.Tuple.Of(func(tuple.Item1), func(tuple.Item2)).PrintLine(); + return Utils.TupleU.Of(func(tuple.Item1), func(tuple.Item2)).PrintLine(); } /// @@ -84,7 +86,7 @@ public static Tuple PrintLineBy(this Tuple tuple, Func if (func == null) throw new ArgumentNullException(nameof(func)); - Utils.Tuple.Of(func(tuple.Item1), func(tuple.Item2)).PrintLine(); + Utils.TupleU.Of(func(tuple.Item1), func(tuple.Item2)).PrintLine(); return tuple; } @@ -111,7 +113,7 @@ public static Tuple PrintLines(this Tuple tuple, Func @@ -125,7 +127,7 @@ public static Tuple PrintLinesBy(this Tuple tuple, Func PrintLinesBy(this Tuple tuple, FuncКортеж. public static Tuple Print(this Tuple tuple) { - Console.Write(Utils.Tuple.Of(tuple.Item1.NilOrString(), tuple.Item2.NilOrString(), tuple.Item3.NilOrString())); + Console.Write(Utils.TupleU.Of(tuple.Item1.NilOrString(), tuple.Item2.NilOrString(), tuple.Item3.NilOrString())); return tuple; } @@ -151,7 +153,7 @@ public static Tuple Print(this Tuple tuple, Func @@ -165,7 +167,7 @@ public static Tuple PrintBy(this Tuple tuple, Func PrintBy(this Tuple tuple, FuncКортеж. public static Tuple PrintLine(this Tuple tuple) { - Console.WriteLine(Utils.Tuple.Of(tuple.Item1.NilOrString(), tuple.Item2.NilOrString(), tuple.Item3.NilOrString())); + Console.WriteLine(Utils.TupleU.Of(tuple.Item1.NilOrString(), tuple.Item2.NilOrString(), tuple.Item3.NilOrString())); return tuple; } @@ -191,7 +193,7 @@ public static Tuple PrintLine(this Tuple tuple, Func if (func == null) throw new ArgumentNullException(nameof(func)); - return Utils.Tuple.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3)).PrintLine(); + return Utils.TupleU.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3)).PrintLine(); } /// @@ -205,7 +207,7 @@ public static Tuple PrintLineBy(this Tuple tuple, Func< if (func == null) throw new ArgumentNullException(nameof(func)); - Utils.Tuple.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3)).PrintLine(); + Utils.TupleU.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3)).PrintLine(); return tuple; } @@ -233,7 +235,7 @@ public static Tuple PrintLines(this Tuple tuple, Fun if (func == null) throw new ArgumentNullException(nameof(func)); - return Utils.Tuple.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3)).PrintLines(); + return Utils.TupleU.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3)).PrintLines(); } /// @@ -247,7 +249,7 @@ public static Tuple PrintLinesBy(this Tuple tuple, Func if (func == null) throw new ArgumentNullException(nameof(func)); - Utils.Tuple.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3)).PrintLines(); + Utils.TupleU.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3)).PrintLines(); return tuple; } @@ -258,7 +260,7 @@ public static Tuple PrintLinesBy(this Tuple tuple, Func /// Кортеж. public static Tuple Print(this Tuple tuple) { - Console.Write(Utils.Tuple.Of(tuple.Item1.NilOrString(), tuple.Item2.NilOrString(), tuple.Item3.NilOrString(), + Console.Write(Utils.TupleU.Of(tuple.Item1.NilOrString(), tuple.Item2.NilOrString(), tuple.Item3.NilOrString(), tuple.Item4.NilOrString())); return tuple; } @@ -274,7 +276,7 @@ public static Tuple Print(this Tuple tuple, F if (func == null) throw new ArgumentNullException(nameof(func)); - return Utils.Tuple.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3), + return Utils.TupleU.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3), func(tuple.Item4)).Print(); } @@ -289,7 +291,7 @@ public static Tuple PrintBy(this Tuple tuple, Fun if (func == null) throw new ArgumentNullException(nameof(func)); - Utils.Tuple.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3), + Utils.TupleU.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3), func(tuple.Item4)).Print(); return tuple; } @@ -301,7 +303,7 @@ public static Tuple PrintBy(this Tuple tuple, Fun /// Кортеж. public static Tuple PrintLine(this Tuple tuple) { - Console.WriteLine(Utils.Tuple.Of(tuple.Item1.NilOrString(), tuple.Item2.NilOrString(), tuple.Item3.NilOrString(), + Console.WriteLine(Utils.TupleU.Of(tuple.Item1.NilOrString(), tuple.Item2.NilOrString(), tuple.Item3.NilOrString(), tuple.Item4.NilOrString())); return tuple; } @@ -317,7 +319,7 @@ public static Tuple PrintLine(this Tuple tupl if (func == null) throw new ArgumentNullException(nameof(func)); - return Utils.Tuple.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3), + return Utils.TupleU.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3), func(tuple.Item4)).PrintLine(); } @@ -332,7 +334,7 @@ public static Tuple PrintLineBy(this Tuple tuple, if (func == null) throw new ArgumentNullException(nameof(func)); - Utils.Tuple.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3), + Utils.TupleU.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3), func(tuple.Item4)).PrintLine(); return tuple; } @@ -362,7 +364,7 @@ public static Tuple PrintLines(this Tuple tup if (func == null) throw new ArgumentNullException(nameof(func)); - return Utils.Tuple.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3), func(tuple.Item4)).PrintLines(); + return Utils.TupleU.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3), func(tuple.Item4)).PrintLines(); } /// @@ -376,7 +378,7 @@ public static Tuple PrintLinesBy(this Tuple tuple if (func == null) throw new ArgumentNullException(nameof(func)); - Utils.Tuple.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3), func(tuple.Item4)).PrintLines(); + Utils.TupleU.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3), func(tuple.Item4)).PrintLines(); return tuple; } @@ -387,7 +389,7 @@ public static Tuple PrintLinesBy(this Tuple tuple /// Кортеж. public static Tuple Print(this Tuple tuple) { - Console.Write(Utils.Tuple.Of(tuple.Item1.NilOrString(), tuple.Item2.NilOrString(), tuple.Item3.NilOrString(), + Console.Write(Utils.TupleU.Of(tuple.Item1.NilOrString(), tuple.Item2.NilOrString(), tuple.Item3.NilOrString(), tuple.Item4.NilOrString(), tuple.Item5.NilOrString())); return tuple; } @@ -403,7 +405,7 @@ public static Tuple Print(this Tuple t if (func == null) throw new ArgumentNullException(nameof(func)); - return Utils.Tuple.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3), + return Utils.TupleU.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3), func(tuple.Item4), func(tuple.Item5)).Print(); } @@ -418,7 +420,7 @@ public static Tuple PrintBy(this Tuple tupl if (func == null) throw new ArgumentNullException(nameof(func)); - Utils.Tuple.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3), + Utils.TupleU.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3), func(tuple.Item4), func(tuple.Item5)).Print(); return tuple; } @@ -430,7 +432,7 @@ public static Tuple PrintBy(this Tuple tupl /// Кортеж. public static Tuple PrintLine(this Tuple tuple) { - Console.WriteLine(Utils.Tuple.Of(tuple.Item1.NilOrString(), tuple.Item2.NilOrString(), tuple.Item3.NilOrString(), + Console.WriteLine(Utils.TupleU.Of(tuple.Item1.NilOrString(), tuple.Item2.NilOrString(), tuple.Item3.NilOrString(), tuple.Item4.NilOrString(), tuple.Item5.NilOrString())); return tuple; } @@ -446,7 +448,7 @@ public static Tuple PrintLine(this Tuple PrintLineBy(this Tuple if (func == null) throw new ArgumentNullException(nameof(func)); - Utils.Tuple.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3), + Utils.TupleU.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3), func(tuple.Item4), func(tuple.Item5)).PrintLine(); return tuple; } @@ -492,7 +494,7 @@ public static Tuple PrintLines(this Tuple PrintLinesBy(this Tuple if (func == null) throw new ArgumentNullException(nameof(func)); - Utils.Tuple.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3), + Utils.TupleU.Of(func(tuple.Item1), func(tuple.Item2), func(tuple.Item3), func(tuple.Item4), func(tuple.Item5)).PrintLines(); return tuple; } @@ -519,7 +521,7 @@ public static Tuple PrintLinesBy(this Tuple /// Кортеж. public static Tuple Print(this Tuple tuple) { - Console.Write(Utils.Tuple.Of(tuple.Item1.NilOrString(), tuple.Item2.NilOrString(), tuple.Item3.NilOrString(), + Console.Write(Utils.TupleU.Of(tuple.Item1.NilOrString(), tuple.Item2.NilOrString(), tuple.Item3.NilOrString(), tuple.Item4.NilOrString(), tuple.Item5.NilOrString(), tuple.Item6.NilOrString())); return tuple; } @@ -535,7 +537,7 @@ public static Tuple Print(this Tuple PrintBy(this Tuple PrintBy(this TupleКортеж. public static Tuple PrintLine(this Tuple tuple) { - Console.WriteLine(Utils.Tuple.Of(tuple.Item1.NilOrString(), tuple.Item2.NilOrString(), tuple.Item3.NilOrString(), + Console.WriteLine(Utils.TupleU.Of(tuple.Item1.NilOrString(), tuple.Item2.NilOrString(), tuple.Item3.NilOrString(), tuple.Item4.NilOrString(), tuple.Item5.NilOrString(), tuple.Item6.NilOrString())); return tuple; } @@ -578,7 +580,7 @@ public static Tuple PrintLine(this Tuple PrintLineBy(this Tuple PrintLines(this Tuple PrintLinesBy(this Tuple PrintLinesBy(this TupleКортеж. public static Tuple Print(this Tuple tuple) { - Console.Write(Utils.Tuple.Of(tuple.Item1.NilOrString(), tuple.Item2.NilOrString(), tuple.Item3.NilOrString(), + Console.Write(Utils.TupleU.Of(tuple.Item1.NilOrString(), tuple.Item2.NilOrString(), tuple.Item3.NilOrString(), tuple.Item4.NilOrString(), tuple.Item5.NilOrString(), tuple.Item6.NilOrString(), tuple.Item7.NilOrString())); return tuple; @@ -669,7 +671,7 @@ public static Tuple Print(this Tuple PrintBy(this Tuple PrintBy(this TupleКортеж. public static Tuple PrintLine(this Tuple tuple) { - Console.WriteLine(Utils.Tuple.Of(tuple.Item1.NilOrString(), tuple.Item2.NilOrString(), tuple.Item3.NilOrString(), + Console.WriteLine(Utils.TupleU.Of(tuple.Item1.NilOrString(), tuple.Item2.NilOrString(), tuple.Item3.NilOrString(), tuple.Item4.NilOrString(), tuple.Item5.NilOrString(), tuple.Item6.NilOrString(), tuple.Item7.NilOrString())); return tuple; @@ -715,7 +717,7 @@ public static Tuple PrintLine(this Tuple PrintLineBy(this Tuple PrintLines(this Tuple PrintLinesBy(this Tuple - /// Предоставляет функционал для работы с массивами. - /// - public static partial class Array - { - #region public - /// - /// Читает массив значений типа Boolean. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество элементов. - /// Приглашение к вводу. - /// Массив. - public static bool[] ReadBoolean(int count, string prompt = EmptyStringHelper.Empty) - { - if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count)); - - bool[] array = new bool[count]; - int i = 0; - while (i < count) - try - { - array[i] = Base.ReadBoolean(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, i)); - i++; - } - catch (Exception) - { - InputErrorHelper.Message.PrintLine(); - } - - return array; - } - - /// - /// Читает массив значений типа Char. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество элементов. - /// Приглашение к вводу. - /// Массив. - public static char[] ReadChar(int count, string prompt = EmptyStringHelper.Empty) - { - if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count)); - - char[] array = new char[count]; - for (int i = 0; i < count; i++) - array[i] = Base.ReadChar(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, i)); - - return array; - } - - /// - /// Читает массив значений типа Double. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество элементов. - /// Приглашение к вводу. - /// Массив. - public static double[] ReadDouble(int count, string prompt = EmptyStringHelper.Empty) - { - if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count)); - - double[] array = new double[count]; - int i = 0; - while (i < count) - try - { - array[i] = Base.ReadDouble(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, i)); - i++; - } - catch (Exception) - { - InputErrorHelper.Message.PrintLine(); - } - - return array; - } - - /// - /// Читает массив значений типа Int32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество элементов. - /// Приглашение к вводу. - /// Массив. - public static int[] ReadInt32(int count, string prompt = EmptyStringHelper.Empty) - { - if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count)); - - int[] array = new int[count]; - int i = 0; - while (i < count) - try - { - array[i] = Base.ReadInt32(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, i)); - i++; - } - catch (Exception) - { - InputErrorHelper.Message.PrintLine(); - } - - return array; - } - - /// - /// Читает массив значений типа String. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество элементов. - /// Приглашение к вводу. - /// Массив. - public static string[] ReadString(int count, string prompt = EmptyStringHelper.Empty) - { - if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count)); - - string[] array = new string[count]; - for (int i = 0; i < count; i++) - array[i] = Base.ReadString(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, i)); - return array; - } - - /// - /// Заполняет 2 массива значениями типа Boolean. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadBooleanTuple2(int count) - { - return Tuple.Of(ReadBoolean(count), ReadBoolean(count)); - } - - /// - /// Заполняет 2 массива значениями типа Char. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadCharTuple2(int count) - { - return Tuple.Of(ReadChar(count), ReadChar(count)); - } - - /// - /// Заполняет 2 массива значениями типа Int32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadInt32Tuple2(int count) - { - return Tuple.Of(ReadInt32(count), ReadInt32(count)); - } - - /// - /// Заполняет 2 массива значениями типа Double. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadDoubleTuple2(int count) - { - return Tuple.Of(ReadDouble(count), ReadDouble(count)); - } - - /// - /// Заполняет 2 массива значениями типа String. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadStringTuple2(int count) - { - return Tuple.Of(ReadString(count), ReadString(count)); - } - - /// - /// Заполняет 3 массива значениями типа Boolean. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadBooleanTuple3(int count) - { - return Tuple.Of(ReadBoolean(count), ReadBoolean(count), ReadBoolean(count)); - } - - /// - /// Заполняет 3 массива значениями типа Char. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadCharTuple3(int count) - { - return Tuple.Of(ReadChar(count), ReadChar(count), ReadChar(count)); - } - - /// - /// Заполняет 3 массива значениями типа Int32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadInt32Tuple3(int count) - { - return Tuple.Of(ReadInt32(count), ReadInt32(count), ReadInt32(count)); - } - - /// - /// Заполняет 3 массива значениями типа Double. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadDoubleTuple3(int count) - { - return Tuple.Of(ReadDouble(count), ReadDouble(count), ReadDouble(count)); - } - - /// - /// Заполняет 3 массива значениями типа String. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadStringTuple3(int count) - { - return Tuple.Of(ReadString(count), ReadString(count), ReadString(count)); - } - - /// - /// Заполняет 4 массива значениями типа Boolean. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadBooleanTuple4(int count) - { - return Tuple.Of(ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count)); - } - - /// - /// Заполняет 4 массива значениями типа Char. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadCharTuple4(int count) - { - return Tuple.Of(ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count)); - } - - /// - /// Заполняет 4 массива значениями типа Int32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadInt32Tuple4(int count) - { - return Tuple.Of(ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count)); - } - - /// - /// Заполняет 4 массива значениями типа Double. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadDoubleTuple4(int count) - { - return Tuple.Of(ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count)); - } - - /// - /// Заполняет 4 массива значениями типа String. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadStringTuple4(int count) - { - return Tuple.Of(ReadString(count), ReadString(count), ReadString(count), ReadString(count)); - } - - /// - /// Заполняет 5 массива значениями типа Boolean. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadBooleanTuple5(int count) - { - return Tuple.Of(ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count)); - } - - /// - /// Заполняет 5 массива значениями типа Char. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadCharTuple5(int count) - { - return Tuple.Of(ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count)); - } - - /// - /// Заполняет 5 массива значениями типа Int32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadInt32Tuple5(int count) - { - return Tuple.Of(ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count)); - } - - /// - /// Заполняет 5 массива значениями типа Double. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadDoubleTuple5(int count) - { - return Tuple.Of(ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count)); - } - - /// - /// Заполняет 5 массива значениями типа String. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadStringTuple5(int count) - { - return Tuple.Of(ReadString(count), ReadString(count), ReadString(count), ReadString(count), ReadString(count)); - } - - /// - /// Заполняет 6 массива значениями типа Boolean. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadBooleanTuple6(int count) - { - return Tuple.Of(ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count)); - } - - /// - /// Заполняет 6 массива значениями типа Char. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadCharTuple6(int count) - { - return Tuple.Of(ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count)); - } - - /// - /// Заполняет 6 массива значениями типа Int32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadInt32Tuple6(int count) - { - return Tuple.Of(ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count)); - } - - /// - /// Заполняет 6 массива значениями типа Double. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadDoubleTuple6(int count) - { - return Tuple.Of(ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count)); - } - - /// - /// Заполняет 6 массива значениями типа String. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadStringTuple6(int count) - { - return Tuple.Of(ReadString(count), ReadString(count), ReadString(count), ReadString(count), ReadString(count), ReadString(count)); - } - - /// - /// Заполняет 7 массива значениями типа Boolean. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadBooleanTuple7(int count) - { - return Tuple.Of(ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count)); - } - - /// - /// Заполняет 7 массива значениями типа Char. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadCharTuple7(int count) - { - return Tuple.Of(ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count)); - } - - /// - /// Заполняет 7 массива значениями типа Int32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadInt32Tuple7(int count) - { - return Tuple.Of(ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count)); - } - - /// - /// Заполняет 7 массива значениями типа Double. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadDoubleTuple7(int count) - { - return Tuple.Of(ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count)); - } - - /// - /// Заполняет 7 массива значениями типа String. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Размер массива. - /// Кортеж. - public static Tuple ReadStringTuple7(int count) - { - return Tuple.Of(ReadString(count), ReadString(count), ReadString(count), ReadString(count), ReadString(count), ReadString(count), ReadString(count)); - } - #endregion public - } -} diff --git a/NETMouse - .NET release/Utils/Array.Generators.cs b/NETMouse - .NET release/Utils/ArrayU.Generators.cs similarity index 97% rename from NETMouse - .NET release/Utils/Array.Generators.cs rename to NETMouse - .NET release/Utils/ArrayU.Generators.cs index 8a50d93..dc3c707 100644 --- a/NETMouse - .NET release/Utils/Array.Generators.cs +++ b/NETMouse - .NET release/Utils/ArrayU.Generators.cs @@ -5,9 +5,11 @@ namespace ABCNET.Utils /// /// Предоставляет функционал для работы с массивами. /// - public static partial class Array + public static partial class ArrayU { + #region public + /// /// Создаёт массив из указанных значений. /// @@ -80,7 +82,7 @@ public static int[] Random(int count, int low = Int32BordersHelper.Low, int high int[] source = new int[count]; for (int i = 0; i < source.Length; i++) - source[i] = Base.Random(low, high); + source[i] = BaseU.Random(low, high); return source; } @@ -101,7 +103,7 @@ public static double[] Random(int count, double low = DoubleBordersHelper.Low, d double[] source = new double[count]; for (int i = 0; i < source.Length; i++) - source[i] = Base.Random(low, high); + source[i] = BaseU.Random(low, high); return source; } @@ -123,6 +125,8 @@ public static T[] Fill(int count, T value) return source; } + #endregion public + } -} +} \ No newline at end of file diff --git a/NETMouse - .NET release/Utils/ArrayU.Input.cs b/NETMouse - .NET release/Utils/ArrayU.Input.cs new file mode 100644 index 0000000..c75a132 --- /dev/null +++ b/NETMouse - .NET release/Utils/ArrayU.Input.cs @@ -0,0 +1,1245 @@ +using System; +using System.Numerics; + +namespace ABCNET.Utils +{ + /// + /// Предоставляет функционал для работы с массивами. + /// + public static partial class ArrayU + { + + #region public + + #region one-array + + /// + /// Читает массив значений типа Boolean. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static bool[] ReadBoolean(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + bool[] array = new bool[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.ReadBoolean(string.Format(prompt, i)); + + return array; + } + + /// + /// Читает массив значений типа Byte. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static byte[] ReadByte(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + byte[] array = new byte[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.ReadByte(string.Format(prompt, i)); + + return array; + } + + /// + /// Читает массив значений типа SByte. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static sbyte[] ReadSByte(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + sbyte[] array = new sbyte[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.ReadSByte(string.Format(prompt, i)); + + return array; + } + + /// + /// Читает массив значений типа Char. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static char[] ReadChar(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + char[] array = new char[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.ReadChar(string.Format(prompt, i)); + + return array; + } + + /// + /// Читает массив значений типа Decimal. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static decimal[] ReadDecimal(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + decimal[] array = new decimal[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.ReadDecimal(string.Format(prompt, i)); + + return array; + } + + /// + /// Читает массив значений типа Double. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static double[] ReadDouble(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + double[] array = new double[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.ReadDouble(string.Format(prompt, i)); + + return array; + } + + /// + /// Читает массив значений типа Single. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static float[] ReadSingle(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + float[] array = new float[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.ReadSingle(string.Format(prompt, i)); + + return array; + } + + /// + /// Читает массив значений типа Int32. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static int[] ReadInt32(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int[] array = new int[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.ReadInt32(string.Format(prompt, i)); + + return array; + } + + /// + /// Читает массив значений типа UInt32. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static uint[] ReadUInt32(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + uint[] array = new uint[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.ReadUInt32(string.Format(prompt, i)); + + return array; + } + + /// + /// Читает массив значений типа Int64. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static long[] ReadInt64(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + long[] array = new long[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.ReadInt64(string.Format(prompt, i)); + + return array; + } + + /// + /// Читает массив значений типа UInt64. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static ulong[] ReadUInt64(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + ulong[] array = new ulong[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.ReadUInt64(string.Format(prompt, i)); + + return array; + } + + /// + /// Читает массив значений типа Int16. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static short[] ReadInt16(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + short[] array = new short[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.ReadInt16(string.Format(prompt, i)); + + return array; + } + + /// + /// Читает массив значений типа UInt16. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static ushort[] ReadUInt16(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + ushort[] array = new ushort[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.ReadUInt16(string.Format(prompt, i)); + + return array; + } + + /// + /// Читает массив значений типа String. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static string[] ReadString(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + string[] array = new string[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.ReadString(string.Format(prompt, i)); + + return array; + } + + /// + /// Читает массив значений типа BigInteger. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static BigInteger[] ReadBigInteger(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + BigInteger[] array = new BigInteger[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.ReadBigInteger(string.Format(prompt, i)); + + return array; + } + + #endregion one-array + + #region two-arrays + + /// + /// Читает 2 массива значений типа Boolean. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadBooleanTuple2(int count) + { + return TupleU.Of(ReadBoolean(count), ReadBoolean(count)); + } + + /// + /// Читает 2 массива значений типа Byte. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadByteTuple2(int count) + { + return TupleU.Of(ReadByte(count), ReadByte(count)); + } + + /// + /// Читает 2 массива значений типа SByte. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadSByteTuple2(int count) + { + return TupleU.Of(ReadSByte(count), ReadSByte(count)); + } + + /// + /// Читает 2 массива значений типа Char. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadCharTuple2(int count) + { + return TupleU.Of(ReadChar(count), ReadChar(count)); + } + + /// + /// Читает 2 массива значений типа Decimal. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadDecimalTuple2(int count) + { + return TupleU.Of(ReadDecimal(count), ReadDecimal(count)); + } + + /// + /// Читает 2 массива значений типа Double. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadDoubleTuple2(int count) + { + return TupleU.Of(ReadDouble(count), ReadDouble(count)); + } + + /// + /// Читает 2 массива значений типа Single. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadSingleTuple2(int count) + { + return TupleU.Of(ReadSingle(count), ReadSingle(count)); + } + + /// + /// Читает 2 массива значений типа Int32. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt32Tuple2(int count) + { + return TupleU.Of(ReadInt32(count), ReadInt32(count)); + } + + /// + /// Читает 2 массива значений типа UInt32. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt32Tuple2(int count) + { + return TupleU.Of(ReadUInt32(count), ReadUInt32(count)); + } + + /// + /// Читает 2 массива значений типа Int64. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt64Tuple2(int count) + { + return TupleU.Of(ReadInt64(count), ReadInt64(count)); + } + + /// + /// Читает 2 массива значений типа UInt64. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt64Tuple2(int count) + { + return TupleU.Of(ReadUInt64(count), ReadUInt64(count)); + } + + /// + /// Читает 2 массива значений типа Int16. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt16Tuple2(int count) + { + return TupleU.Of(ReadInt16(count), ReadInt16(count)); + } + + /// + /// Читает 2 массива значений типа UInt16. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt16Tuple2(int count) + { + return TupleU.Of(ReadUInt16(count), ReadUInt16(count)); + } + + /// + /// Читает 2 массива значений типа BigInteger. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadBigIntegerTuple2(int count) + { + return TupleU.Of(ReadBigInteger(count), ReadBigInteger(count)); + } + + /// + /// Читает 2 массива значений типа String. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadStringTuple2(int count) + { + return TupleU.Of(ReadString(count), ReadString(count)); + } + + #endregion two-arrays + + #region three-arrays + + /// + /// Читает 3 массива значений типа Boolean. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadBooleanTuple3(int count) + { + return TupleU.Of(ReadBoolean(count), ReadBoolean(count), ReadBoolean(count)); + } + + /// + /// Читает 3 массива значений типа Byte. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadByteTuple3(int count) + { + return TupleU.Of(ReadByte(count), ReadByte(count), ReadByte(count)); + } + + /// + /// Читает 3 массива значений типа SByte. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadSByteTuple3(int count) + { + return TupleU.Of(ReadSByte(count), ReadSByte(count), ReadSByte(count)); + } + + /// + /// Читает 3 массива значений типа Char. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadCharTuple3(int count) + { + return TupleU.Of(ReadChar(count), ReadChar(count), ReadChar(count)); + } + + /// + /// Читает 3 массива значений типа Decimal. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadDecimalTuple3(int count) + { + return TupleU.Of(ReadDecimal(count), ReadDecimal(count), ReadDecimal(count)); + } + + /// + /// Читает 3 массива значений типа Double. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadDoubleTuple3(int count) + { + return TupleU.Of(ReadDouble(count), ReadDouble(count), ReadDouble(count)); + } + + /// + /// Читает 3 массива значений типа Single. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadSingleTuple3(int count) + { + return TupleU.Of(ReadSingle(count), ReadSingle(count), ReadSingle(count)); + } + + /// + /// Читает 3 массива значений типа Int32. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt32Tuple3(int count) + { + return TupleU.Of(ReadInt32(count), ReadInt32(count), ReadInt32(count)); + } + + /// + /// Читает 3 массива значений типа UInt32. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt32Tuple3(int count) + { + return TupleU.Of(ReadUInt32(count), ReadUInt32(count), ReadUInt32(count)); + } + + /// + /// Читает 3 массива значений типа Int64. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt64Tuple3(int count) + { + return TupleU.Of(ReadInt64(count), ReadInt64(count), ReadInt64(count)); + } + + /// + /// Читает 3 массива значений типа UInt64. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt64Tuple3(int count) + { + return TupleU.Of(ReadUInt64(count), ReadUInt64(count), ReadUInt64(count)); + } + + /// + /// Читает 3 массива значений типа Int16. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt16Tuple3(int count) + { + return TupleU.Of(ReadInt16(count), ReadInt16(count), ReadInt16(count)); + } + + /// + /// Читает 3 массива значений типа UInt16. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt16Tuple3(int count) + { + return TupleU.Of(ReadUInt16(count), ReadUInt16(count), ReadUInt16(count)); + } + + /// + /// Читает 3 массива значений типа BigInteger. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadBigIntegerTuple3(int count) + { + return TupleU.Of(ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count)); + } + + /// + /// Читает 3 массива значений типа String. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadStringTuple3(int count) + { + return TupleU.Of(ReadString(count), ReadString(count), ReadString(count)); + } + + #endregion three-arrays + + #region four-arrays + + /// + /// Читает 4 массива значений типа Boolean. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadBooleanTuple4(int count) + { + return TupleU.Of(ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count)); + } + + /// + /// Читает 4 массива значений типа Byte. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadByteTuple4(int count) + { + return TupleU.Of(ReadByte(count), ReadByte(count), ReadByte(count), ReadByte(count)); + } + + /// + /// Читает 4 массива значений типа SByte. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadSByteTuple4(int count) + { + return TupleU.Of(ReadSByte(count), ReadSByte(count), ReadSByte(count), ReadSByte(count)); + } + + /// + /// Читает 4 массива значений типа Char. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadCharTuple4(int count) + { + return TupleU.Of(ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count)); + } + + /// + /// Читает 4 массива значений типа Decimal. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadDecimalTuple4(int count) + { + return TupleU.Of(ReadDecimal(count), ReadDecimal(count), ReadDecimal(count), ReadDecimal(count)); + } + + /// + /// Читает 4 массива значений типа Double. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadDoubleTuple4(int count) + { + return TupleU.Of(ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count)); + } + + /// + /// Читает 4 массива значений типа Single. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadSingleTuple4(int count) + { + return TupleU.Of(ReadSingle(count), ReadSingle(count), ReadSingle(count), ReadSingle(count)); + } + + /// + /// Читает 4 массива значений типа Int32. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt32Tuple4(int count) + { + return TupleU.Of(ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count)); + } + + /// + /// Читает 4 массива значений типа UInt32. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt32Tuple4(int count) + { + return TupleU.Of(ReadUInt32(count), ReadUInt32(count), ReadUInt32(count), ReadUInt32(count)); + } + + /// + /// Читает 4 массива значений типа Int64. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt64Tuple4(int count) + { + return TupleU.Of(ReadInt64(count), ReadInt64(count), ReadInt64(count), ReadInt64(count)); + } + + /// + /// Читает 4 массива значений типа UInt64. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt64Tuple4(int count) + { + return TupleU.Of(ReadUInt64(count), ReadUInt64(count), ReadUInt64(count), ReadUInt64(count)); + } + + /// + /// Читает 4 массива значений типа Int16. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt16Tuple4(int count) + { + return TupleU.Of(ReadInt16(count), ReadInt16(count), ReadInt16(count), ReadInt16(count)); + } + + /// + /// Читает 4 массива значений типа UInt16. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt16Tuple4(int count) + { + return TupleU.Of(ReadUInt16(count), ReadUInt16(count), ReadUInt16(count), ReadUInt16(count)); + } + + /// + /// Читает 4 массива значений типа BigInteger. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadBigIntegerTuple4(int count) + { + return TupleU.Of(ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count)); + } + + /// + /// Читает 4 массива значений типа String. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadStringTuple4(int count) + { + return TupleU.Of(ReadString(count), ReadString(count), ReadString(count), ReadString(count)); + } + + #endregion four-arrays + + #region five-arrays + + /// + /// Читает 5 массивов значений типа Boolean. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadBooleanTuple5(int count) + { + return TupleU.Of(ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count)); + } + + /// + /// Читает 5 массивов значений типа Byte. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadByteTuple5(int count) + { + return TupleU.Of(ReadByte(count), ReadByte(count), ReadByte(count), ReadByte(count), ReadByte(count)); + } + + /// + /// Читает 5 массивов значений типа SByte. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadSByteTuple5(int count) + { + return TupleU.Of(ReadSByte(count), ReadSByte(count), ReadSByte(count), ReadSByte(count), ReadSByte(count)); + } + + /// + /// Читает 5 массивов значений типа Char. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadCharTuple5(int count) + { + return TupleU.Of(ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count)); + } + + /// + /// Читает 5 массивов значений типа Decimal. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadDecimalTuple5(int count) + { + return TupleU.Of(ReadDecimal(count), ReadDecimal(count), ReadDecimal(count), ReadDecimal(count), ReadDecimal(count)); + } + + /// + /// Читает 5 массивов значений типа Double. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadDoubleTuple5(int count) + { + return TupleU.Of(ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count)); + } + + /// + /// Читает 5 массивов значений типа Single. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadSingleTuple5(int count) + { + return TupleU.Of(ReadSingle(count), ReadSingle(count), ReadSingle(count), ReadSingle(count), ReadSingle(count)); + } + + /// + /// Читает 5 массивов значений типа Int32. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt32Tuple5(int count) + { + return TupleU.Of(ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count)); + } + + /// + /// Читает 5 массивов значений типа UInt32. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt32Tuple5(int count) + { + return TupleU.Of(ReadUInt32(count), ReadUInt32(count), ReadUInt32(count), ReadUInt32(count), ReadUInt32(count)); + } + + /// + /// Читает 5 массивов значений типа Int64. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt64Tuple5(int count) + { + return TupleU.Of(ReadInt64(count), ReadInt64(count), ReadInt64(count), ReadInt64(count), ReadInt64(count)); + } + + /// + /// Читает 5 массивов значений типа UInt64. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt64Tuple5(int count) + { + return TupleU.Of(ReadUInt64(count), ReadUInt64(count), ReadUInt64(count), ReadUInt64(count), ReadUInt64(count)); + } + + /// + /// Читает 5 массивов значений типа Int16. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt16Tuple5(int count) + { + return TupleU.Of(ReadInt16(count), ReadInt16(count), ReadInt16(count), ReadInt16(count), ReadInt16(count)); + } + + /// + /// Читает 5 массивов значений типа UInt16. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt16Tuple5(int count) + { + return TupleU.Of(ReadUInt16(count), ReadUInt16(count), ReadUInt16(count), ReadUInt16(count), ReadUInt16(count)); + } + + /// + /// Читает 5 массивов значений типа BigInteger. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadBigIntegerTuple5(int count) + { + return TupleU.Of(ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count)); + } + + /// + /// Читает 5 массивов значений типа String. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadStringTuple5(int count) + { + return TupleU.Of(ReadString(count), ReadString(count), ReadString(count), ReadString(count), ReadString(count)); + } + + #endregion five-arrays + + #region six-arrays + + /// + /// Читает 6 массивов значений типа Boolean. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadBooleanTuple6(int count) + { + return TupleU.Of(ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count)); + } + + /// + /// Читает 6 массивов значений типа Byte. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadByteTuple6(int count) + { + return TupleU.Of(ReadByte(count), ReadByte(count), ReadByte(count), ReadByte(count), ReadByte(count), ReadByte(count)); + } + + /// + /// Читает 6 массивов значений типа SByte. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadSByteTuple6(int count) + { + return TupleU.Of(ReadSByte(count), ReadSByte(count), ReadSByte(count), ReadSByte(count), ReadSByte(count), ReadSByte(count)); + } + + /// + /// Читает 6 массивов значений типа Char. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadCharTuple6(int count) + { + return TupleU.Of(ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count)); + } + + /// + /// Читает 6 массивов значений типа Decimal. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadDecimalTuple6(int count) + { + return TupleU.Of(ReadDecimal(count), ReadDecimal(count), ReadDecimal(count), ReadDecimal(count), ReadDecimal(count), ReadDecimal(count)); + } + + /// + /// Читает 6 массивов значений типа Double. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadDoubleTuple6(int count) + { + return TupleU.Of(ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count)); + } + + /// + /// Читает 6 массивов значений типа Single. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadSingleTuple6(int count) + { + return TupleU.Of(ReadSingle(count), ReadSingle(count), ReadSingle(count), ReadSingle(count), ReadSingle(count), ReadSingle(count)); + } + + /// + /// Читает 6 массивов значений типа Int32. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt32Tuple6(int count) + { + return TupleU.Of(ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count)); + } + + /// + /// Читает 6 массивов значений типа UInt32. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt32Tuple6(int count) + { + return TupleU.Of(ReadUInt32(count), ReadUInt32(count), ReadUInt32(count), ReadUInt32(count), ReadUInt32(count), ReadUInt32(count)); + } + + /// + /// Читает 6 массивов значений типа Int64. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt64Tuple6(int count) + { + return TupleU.Of(ReadInt64(count), ReadInt64(count), ReadInt64(count), ReadInt64(count), ReadInt64(count), ReadInt64(count)); + } + + /// + /// Читает 6 массивов значений типа UInt64. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt64Tuple6(int count) + { + return TupleU.Of(ReadUInt64(count), ReadUInt64(count), ReadUInt64(count), ReadUInt64(count), ReadUInt64(count), ReadUInt64(count)); + } + + /// + /// Читает 6 массивов значений типа Int16. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt16Tuple6(int count) + { + return TupleU.Of(ReadInt16(count), ReadInt16(count), ReadInt16(count), ReadInt16(count), ReadInt16(count), ReadInt16(count)); + } + + /// + /// Читает 6 массивов значений типа UInt16. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt16Tuple6(int count) + { + return TupleU.Of(ReadUInt16(count), ReadUInt16(count), ReadUInt16(count), ReadUInt16(count), ReadUInt16(count), ReadUInt16(count)); + } + + /// + /// Читает 6 массивов значений типа BigInteger. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadBigIntegerTuple6(int count) + { + return TupleU.Of(ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count)); + } + + /// + /// Читает 6 массивов значений типа String. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadStringTuple6(int count) + { + return TupleU.Of(ReadString(count), ReadString(count), ReadString(count), ReadString(count), ReadString(count), ReadString(count)); + } + + #endregion six-arrays + + #region seven-arrays + + /// + /// Читает 7 массивов значений типа Boolean. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadBooleanTuple7(int count) + { + return TupleU.Of(ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count)); + } + + /// + /// Читает 7 массивов значений типа Byte. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadByteTuple7(int count) + { + return TupleU.Of(ReadByte(count), ReadByte(count), ReadByte(count), ReadByte(count), ReadByte(count), ReadByte(count), ReadByte(count)); + } + + /// + /// Читает 7 массивов значений типа SByte. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadSByteTuple7(int count) + { + return TupleU.Of(ReadSByte(count), ReadSByte(count), ReadSByte(count), ReadSByte(count), ReadSByte(count), ReadSByte(count), ReadSByte(count)); + } + + /// + /// Читает 7 массивов значений типа Char. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadCharTuple7(int count) + { + return TupleU.Of(ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count)); + } + + /// + /// Читает 7 массивов значений типа Decimal. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadDecimalTuple7(int count) + { + return TupleU.Of(ReadDecimal(count), ReadDecimal(count), ReadDecimal(count), ReadDecimal(count), ReadDecimal(count), ReadDecimal(count), ReadDecimal(count)); + } + + /// + /// Читает 7 массивов значений типа Double. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadDoubleTuple7(int count) + { + return TupleU.Of(ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count)); + } + + /// + /// Читает 7 массивов значений типа Single. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadSingleTuple7(int count) + { + return TupleU.Of(ReadSingle(count), ReadSingle(count), ReadSingle(count), ReadSingle(count), ReadSingle(count), ReadSingle(count), ReadSingle(count)); + } + + /// + /// Читает 7 массивов значений типа Int32. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt32Tuple7(int count) + { + return TupleU.Of(ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count)); + } + + /// + /// Читает 7 массивов значений типа UInt32. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt32Tuple7(int count) + { + return TupleU.Of(ReadUInt32(count), ReadUInt32(count), ReadUInt32(count), ReadUInt32(count), ReadUInt32(count), ReadUInt32(count), ReadUInt32(count)); + } + + /// + /// Читает 7 массивов значений типа Int64. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt64Tuple7(int count) + { + return TupleU.Of(ReadInt64(count), ReadInt64(count), ReadInt64(count), ReadInt64(count), ReadInt64(count), ReadInt64(count), ReadInt64(count)); + } + + /// + /// Читает 7 массивов значений типа UInt64. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt64Tuple7(int count) + { + return TupleU.Of(ReadUInt64(count), ReadUInt64(count), ReadUInt64(count), ReadUInt64(count), ReadUInt64(count), ReadUInt64(count), ReadUInt64(count)); + } + + /// + /// Читает 7 массивов значений типа Int16. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt16Tuple7(int count) + { + return TupleU.Of(ReadInt16(count), ReadInt16(count), ReadInt16(count), ReadInt16(count), ReadInt16(count), ReadInt16(count), ReadInt16(count)); + } + + /// + /// Читает 7 массивов значений типа UInt16. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt16Tuple7(int count) + { + return TupleU.Of(ReadUInt16(count), ReadUInt16(count), ReadUInt16(count), ReadUInt16(count), ReadUInt16(count), ReadUInt16(count), ReadUInt16(count)); + } + + /// + /// Читает 7 массивов значений типа BigInteger. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadBigIntegerTuple7(int count) + { + return TupleU.Of(ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count)); + } + + /// + /// Читает 7 массивов значений типа String. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadStringTuple7(int count) + { + return TupleU.Of(ReadString(count), ReadString(count), ReadString(count), ReadString(count), ReadString(count), ReadString(count), ReadString(count)); + } + + #endregion seven-arrays + + #endregion public + + } +} diff --git a/NETMouse - .NET release/Utils/ArrayU.Nullable.Input.cs b/NETMouse - .NET release/Utils/ArrayU.Nullable.Input.cs new file mode 100644 index 0000000..c688ad7 --- /dev/null +++ b/NETMouse - .NET release/Utils/ArrayU.Nullable.Input.cs @@ -0,0 +1,1171 @@ +using System; +using System.Numerics; + +namespace ABCNET.Utils +{ + /// + /// Предоставляет функционал для работы с массивами. + /// + public static partial class ArrayU + { + /// + /// Предоставляет функционал для работы с Nullable типами. + /// + public static partial class Nullable + { + + #region public + + #region one-array + + /// + /// Читает массив значений типа Boolean?. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static bool?[] ReadBoolean(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + bool?[] array = new bool?[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.Nullable.ReadBoolean(string.Format(prompt, i)); + + return array; + } + + /// + /// Читает массив значений типа Byte?. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static byte?[] ReadByte(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + byte?[] array = new byte?[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.Nullable.ReadByte(string.Format(prompt, i)); + + return array; + } + + /// + /// Читает массив значений типа SByte?. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static sbyte?[] ReadSByte(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + sbyte?[] array = new sbyte?[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.Nullable.ReadSByte(string.Format(prompt, i)); + + return array; + } + + /// + /// Читает массив значений типа Char?. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static char?[] ReadChar(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + char?[] array = new char?[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.Nullable.ReadChar(string.Format(prompt, i)); + + return array; + } + + /// + /// Читает массив значений типа Decimal?. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static decimal?[] ReadDecimal(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + decimal?[] array = new decimal?[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.Nullable.ReadDecimal(string.Format(prompt, i)); + + return array; + } + + /// + /// Читает массив значений типа Double?. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static double?[] ReadDouble(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + double?[] array = new double?[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.Nullable.ReadDouble(string.Format(prompt, i)); + + return array; + } + + /// + /// Читает массив значений типа Single?. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static float?[] ReadSingle(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + float?[] array = new float?[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.Nullable.ReadSingle(string.Format(prompt, i)); + + return array; + } + + /// + /// Читает массив значений типа Int32?. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static int?[] ReadInt32(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int?[] array = new int?[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.Nullable.ReadInt32(string.Format(prompt, i)); + + return array; + } + + /// + /// Читает массив значений типа UInt32?. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static uint?[] ReadUInt32(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + uint?[] array = new uint?[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.Nullable.ReadUInt32(string.Format(prompt, i)); + + return array; + } + + /// + /// Читает массив значений типа Int64?. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static long?[] ReadInt64(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + long?[] array = new long?[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.Nullable.ReadInt64(string.Format(prompt, i)); + + return array; + } + + /// + /// Читает массив значений типа UInt64?. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static ulong?[] ReadUInt64(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + ulong?[] array = new ulong?[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.Nullable.ReadUInt64(string.Format(prompt, i)); + + return array; + } + + /// + /// Читает массив значений типа Int16?. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static short?[] ReadInt16(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + short?[] array = new short?[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.Nullable.ReadInt16(string.Format(prompt, i)); + + return array; + } + + /// + /// Читает массив значений типа UInt16?. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static ushort?[] ReadUInt16(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + ushort?[] array = new ushort?[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.Nullable.ReadUInt16(string.Format(prompt, i)); + + return array; + } + + /// + /// Читает массив значений типа BigInteger?. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Массив. + public static BigInteger?[] ReadBigInteger(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + BigInteger?[] array = new BigInteger?[count]; + for (int i = 0; i < count; i++) + array[i] = BaseU.Nullable.ReadBigInteger(string.Format(prompt, i)); + + return array; + } + + #endregion one-array + + #region two-arrays + + /// + /// Читает 2 массива значений типа Boolean?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadBooleanTuple2(int count) + { + return TupleU.Of(ReadBoolean(count), ReadBoolean(count)); + } + + /// + /// Читает 2 массива значений типа Byte?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadByteTuple2(int count) + { + return TupleU.Of(ReadByte(count), ReadByte(count)); + } + + /// + /// Читает 2 массива значений типа SByte?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadSByteTuple2(int count) + { + return TupleU.Of(ReadSByte(count), ReadSByte(count)); + } + + /// + /// Читает 2 массива значений типа Char?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadCharTuple2(int count) + { + return TupleU.Of(ReadChar(count), ReadChar(count)); + } + + /// + /// Читает 2 массива значений типа Decimal?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadDecimalTuple2(int count) + { + return TupleU.Of(ReadDecimal(count), ReadDecimal(count)); + } + + /// + /// Читает 2 массива значений типа Double?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadDoubleTuple2(int count) + { + return TupleU.Of(ReadDouble(count), ReadDouble(count)); + } + + /// + /// Читает 2 массива значений типа Single?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadSingleTuple2(int count) + { + return TupleU.Of(ReadSingle(count), ReadSingle(count)); + } + + /// + /// Читает 2 массива значений типа Int32?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt32Tuple2(int count) + { + return TupleU.Of(ReadInt32(count), ReadInt32(count)); + } + + /// + /// Читает 2 массива значений типа UInt32?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt32Tuple2(int count) + { + return TupleU.Of(ReadUInt32(count), ReadUInt32(count)); + } + + /// + /// Читает 2 массива значений типа Int64?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt64Tuple2(int count) + { + return TupleU.Of(ReadInt64(count), ReadInt64(count)); + } + + /// + /// Читает 2 массива значений типа UInt64?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt64Tuple2(int count) + { + return TupleU.Of(ReadUInt64(count), ReadUInt64(count)); + } + + /// + /// Читает 2 массива значений типа Int16?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt16Tuple2(int count) + { + return TupleU.Of(ReadInt16(count), ReadInt16(count)); + } + + /// + /// Читает 2 массива значений типа UInt16?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt16Tuple2(int count) + { + return TupleU.Of(ReadUInt16(count), ReadUInt16(count)); + } + + /// + /// Читает 2 массива значений типа BigInteger?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadBigIntegerTuple2(int count) + { + return TupleU.Of(ReadBigInteger(count), ReadBigInteger(count)); + } + + #endregion two-arrays + + #region three-arrays + + /// + /// Читает 3 массива значений типа Boolean?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadBooleanTuple3(int count) + { + return TupleU.Of(ReadBoolean(count), ReadBoolean(count), ReadBoolean(count)); + } + + /// + /// Читает 3 массива значений типа Byte?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadByteTuple3(int count) + { + return TupleU.Of(ReadByte(count), ReadByte(count), ReadByte(count)); + } + + /// + /// Читает 3 массива значений типа SByte?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadSByteTuple3(int count) + { + return TupleU.Of(ReadSByte(count), ReadSByte(count), ReadSByte(count)); + } + + /// + /// Читает 3 массива значений типа Char?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadCharTuple3(int count) + { + return TupleU.Of(ReadChar(count), ReadChar(count), ReadChar(count)); + } + + /// + /// Читает 3 массива значений типа Decimal?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadDecimalTuple3(int count) + { + return TupleU.Of(ReadDecimal(count), ReadDecimal(count), ReadDecimal(count)); + } + + /// + /// Читает 3 массива значений типа Double?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadDoubleTuple3(int count) + { + return TupleU.Of(ReadDouble(count), ReadDouble(count), ReadDouble(count)); + } + + /// + /// Читает 3 массива значений типа Single?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadSingleTuple3(int count) + { + return TupleU.Of(ReadSingle(count), ReadSingle(count), ReadSingle(count)); + } + + /// + /// Читает 3 массива значений типа Int32?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt32Tuple3(int count) + { + return TupleU.Of(ReadInt32(count), ReadInt32(count), ReadInt32(count)); + } + + /// + /// Читает 3 массива значений типа UInt32?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt32Tuple3(int count) + { + return TupleU.Of(ReadUInt32(count), ReadUInt32(count), ReadUInt32(count)); + } + + /// + /// Читает 3 массива значений типа Int64?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt64Tuple3(int count) + { + return TupleU.Of(ReadInt64(count), ReadInt64(count), ReadInt64(count)); + } + + /// + /// Читает 3 массива значений типа UInt64?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt64Tuple3(int count) + { + return TupleU.Of(ReadUInt64(count), ReadUInt64(count), ReadUInt64(count)); + } + + /// + /// Читает 3 массива значений типа Int16?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt16Tuple3(int count) + { + return TupleU.Of(ReadInt16(count), ReadInt16(count), ReadInt16(count)); + } + + /// + /// Читает 3 массива значений типа UInt16?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt16Tuple3(int count) + { + return TupleU.Of(ReadUInt16(count), ReadUInt16(count), ReadUInt16(count)); + } + + /// + /// Читает 3 массива значений типа BigInteger?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadBigIntegerTuple3(int count) + { + return TupleU.Of(ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count)); + } + + #endregion three-arrays + + #region four-arrays + + /// + /// Читает 4 массива значений типа Boolean?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadBooleanTuple4(int count) + { + return TupleU.Of(ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count)); + } + + /// + /// Читает 4 массива значений типа Byte?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadByteTuple4(int count) + { + return TupleU.Of(ReadByte(count), ReadByte(count), ReadByte(count), ReadByte(count)); + } + + /// + /// Читает 4 массива значений типа SByte?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadSByteTuple4(int count) + { + return TupleU.Of(ReadSByte(count), ReadSByte(count), ReadSByte(count), ReadSByte(count)); + } + + /// + /// Читает 4 массива значений типа Char?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadCharTuple4(int count) + { + return TupleU.Of(ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count)); + } + + /// + /// Читает 4 массива значений типа Decimal?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadDecimalTuple4(int count) + { + return TupleU.Of(ReadDecimal(count), ReadDecimal(count), ReadDecimal(count), ReadDecimal(count)); + } + + /// + /// Читает 4 массива значений типа Double?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadDoubleTuple4(int count) + { + return TupleU.Of(ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count)); + } + + /// + /// Читает 4 массива значений типа Single?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadSingleTuple4(int count) + { + return TupleU.Of(ReadSingle(count), ReadSingle(count), ReadSingle(count), ReadSingle(count)); + } + + /// + /// Читает 4 массива значений типа Int32?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt32Tuple4(int count) + { + return TupleU.Of(ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count)); + } + + /// + /// Читает 4 массива значений типа UInt32?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt32Tuple4(int count) + { + return TupleU.Of(ReadUInt32(count), ReadUInt32(count), ReadUInt32(count), ReadUInt32(count)); + } + + /// + /// Читает 4 массива значений типа Int64?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt64Tuple4(int count) + { + return TupleU.Of(ReadInt64(count), ReadInt64(count), ReadInt64(count), ReadInt64(count)); + } + + /// + /// Читает 4 массива значений типа UInt64?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt64Tuple4(int count) + { + return TupleU.Of(ReadUInt64(count), ReadUInt64(count), ReadUInt64(count), ReadUInt64(count)); + } + + /// + /// Читает 4 массива значений типа Int16?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt16Tuple4(int count) + { + return TupleU.Of(ReadInt16(count), ReadInt16(count), ReadInt16(count), ReadInt16(count)); + } + + /// + /// Читает 4 массива значений типа UInt16?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt16Tuple4(int count) + { + return TupleU.Of(ReadUInt16(count), ReadUInt16(count), ReadUInt16(count), ReadUInt16(count)); + } + + /// + /// Читает 4 массива значений типа BigInteger?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadBigIntegerTuple4(int count) + { + return TupleU.Of(ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count)); + } + + #endregion four-arrays + + #region five-arrays + + /// + /// Читает 5 массивов значений типа Boolean?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadBooleanTuple5(int count) + { + return TupleU.Of(ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count)); + } + + /// + /// Читает 5 массивов значений типа Byte?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadByteTuple5(int count) + { + return TupleU.Of(ReadByte(count), ReadByte(count), ReadByte(count), ReadByte(count), ReadByte(count)); + } + + /// + /// Читает 5 массивов значений типа SByte?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadSByteTuple5(int count) + { + return TupleU.Of(ReadSByte(count), ReadSByte(count), ReadSByte(count), ReadSByte(count), ReadSByte(count)); + } + + /// + /// Читает 5 массивов значений типа Char?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadCharTuple5(int count) + { + return TupleU.Of(ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count)); + } + + /// + /// Читает 5 массивов значений типа Decimal?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadDecimalTuple5(int count) + { + return TupleU.Of(ReadDecimal(count), ReadDecimal(count), ReadDecimal(count), ReadDecimal(count), ReadDecimal(count)); + } + + /// + /// Читает 5 массивов значений типа Double?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadDoubleTuple5(int count) + { + return TupleU.Of(ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count)); + } + + /// + /// Читает 5 массивов значений типа Single?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadSingleTuple5(int count) + { + return TupleU.Of(ReadSingle(count), ReadSingle(count), ReadSingle(count), ReadSingle(count), ReadSingle(count)); + } + + /// + /// Читает 5 массивов значений типа Int32?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt32Tuple5(int count) + { + return TupleU.Of(ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count)); + } + + /// + /// Читает 5 массивов значений типа UInt32?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt32Tuple5(int count) + { + return TupleU.Of(ReadUInt32(count), ReadUInt32(count), ReadUInt32(count), ReadUInt32(count), ReadUInt32(count)); + } + + /// + /// Читает 5 массивов значений типа Int64?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt64Tuple5(int count) + { + return TupleU.Of(ReadInt64(count), ReadInt64(count), ReadInt64(count), ReadInt64(count), ReadInt64(count)); + } + + /// + /// Читает 5 массивов значений типа UInt64?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt64Tuple5(int count) + { + return TupleU.Of(ReadUInt64(count), ReadUInt64(count), ReadUInt64(count), ReadUInt64(count), ReadUInt64(count)); + } + + /// + /// Читает 5 массивов значений типа Int16?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt16Tuple5(int count) + { + return TupleU.Of(ReadInt16(count), ReadInt16(count), ReadInt16(count), ReadInt16(count), ReadInt16(count)); + } + + /// + /// Читает 5 массивов значений типа UInt16?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt16Tuple5(int count) + { + return TupleU.Of(ReadUInt16(count), ReadUInt16(count), ReadUInt16(count), ReadUInt16(count), ReadUInt16(count)); + } + + /// + /// Читает 5 массивов значений типа BigInteger?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadBigIntegerTuple5(int count) + { + return TupleU.Of(ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count)); + } + + #endregion five-arrays + + #region six-arrays + + /// + /// Читает 6 массивов значений типа Boolean?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadBooleanTuple6(int count) + { + return TupleU.Of(ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count)); + } + + /// + /// Читает 6 массивов значений типа Byte?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadByteTuple6(int count) + { + return TupleU.Of(ReadByte(count), ReadByte(count), ReadByte(count), ReadByte(count), ReadByte(count), ReadByte(count)); + } + + /// + /// Читает 6 массивов значений типа SByte?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadSByteTuple6(int count) + { + return TupleU.Of(ReadSByte(count), ReadSByte(count), ReadSByte(count), ReadSByte(count), ReadSByte(count), ReadSByte(count)); + } + + /// + /// Читает 6 массивов значений типа Char?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadCharTuple6(int count) + { + return TupleU.Of(ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count)); + } + + /// + /// Читает 6 массивов значений типа Decimal?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadDecimalTuple6(int count) + { + return TupleU.Of(ReadDecimal(count), ReadDecimal(count), ReadDecimal(count), ReadDecimal(count), ReadDecimal(count), ReadDecimal(count)); + } + + /// + /// Читает 6 массивов значений типа Double?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadDoubleTuple6(int count) + { + return TupleU.Of(ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count)); + } + + /// + /// Читает 6 массивов значений типа Single?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadSingleTuple6(int count) + { + return TupleU.Of(ReadSingle(count), ReadSingle(count), ReadSingle(count), ReadSingle(count), ReadSingle(count), ReadSingle(count)); + } + + /// + /// Читает 6 массивов значений типа Int32?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt32Tuple6(int count) + { + return TupleU.Of(ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count)); + } + + /// + /// Читает 6 массивов значений типа UInt32?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt32Tuple6(int count) + { + return TupleU.Of(ReadUInt32(count), ReadUInt32(count), ReadUInt32(count), ReadUInt32(count), ReadUInt32(count), ReadUInt32(count)); + } + + /// + /// Читает 6 массивов значений типа Int64?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt64Tuple6(int count) + { + return TupleU.Of(ReadInt64(count), ReadInt64(count), ReadInt64(count), ReadInt64(count), ReadInt64(count), ReadInt64(count)); + } + + /// + /// Читает 6 массивов значений типа UInt64?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt64Tuple6(int count) + { + return TupleU.Of(ReadUInt64(count), ReadUInt64(count), ReadUInt64(count), ReadUInt64(count), ReadUInt64(count), ReadUInt64(count)); + } + + /// + /// Читает 6 массивов значений типа Int16?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt16Tuple6(int count) + { + return TupleU.Of(ReadInt16(count), ReadInt16(count), ReadInt16(count), ReadInt16(count), ReadInt16(count), ReadInt16(count)); + } + + /// + /// Читает 6 массивов значений типа UInt16?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt16Tuple6(int count) + { + return TupleU.Of(ReadUInt16(count), ReadUInt16(count), ReadUInt16(count), ReadUInt16(count), ReadUInt16(count), ReadUInt16(count)); + } + + /// + /// Читает 6 массивов значений типа BigInteger?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadBigIntegerTuple6(int count) + { + return TupleU.Of(ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count)); + } + + #endregion six-arrays + + #region seven-arrays + + /// + /// Читает 7 массивов значений типа Boolean?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadBooleanTuple7(int count) + { + return TupleU.Of(ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count), ReadBoolean(count)); + } + + /// + /// Читает 7 массивов значений типа Byte?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadByteTuple7(int count) + { + return TupleU.Of(ReadByte(count), ReadByte(count), ReadByte(count), ReadByte(count), ReadByte(count), ReadByte(count), ReadByte(count)); + } + + /// + /// Читает 7 массивов значений типа SByte?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadSByteTuple7(int count) + { + return TupleU.Of(ReadSByte(count), ReadSByte(count), ReadSByte(count), ReadSByte(count), ReadSByte(count), ReadSByte(count), ReadSByte(count)); + } + + /// + /// Читает 7 массивов значений типа Char?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadCharTuple7(int count) + { + return TupleU.Of(ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count), ReadChar(count)); + } + + /// + /// Читает 7 массивов значений типа Decimal?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadDecimalTuple7(int count) + { + return TupleU.Of(ReadDecimal(count), ReadDecimal(count), ReadDecimal(count), ReadDecimal(count), ReadDecimal(count), ReadDecimal(count), ReadDecimal(count)); + } + + /// + /// Читает 7 массивов значений типа Double?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadDoubleTuple7(int count) + { + return TupleU.Of(ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count), ReadDouble(count)); + } + + /// + /// Читает 7 массивов значений типа Single?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadSingleTuple7(int count) + { + return TupleU.Of(ReadSingle(count), ReadSingle(count), ReadSingle(count), ReadSingle(count), ReadSingle(count), ReadSingle(count), ReadSingle(count)); + } + + /// + /// Читает 7 массивов значений типа Int32?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt32Tuple7(int count) + { + return TupleU.Of(ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count), ReadInt32(count)); + } + + /// + /// Читает 7 массивов значений типа UInt32?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt32Tuple7(int count) + { + return TupleU.Of(ReadUInt32(count), ReadUInt32(count), ReadUInt32(count), ReadUInt32(count), ReadUInt32(count), ReadUInt32(count), ReadUInt32(count)); + } + + /// + /// Читает 7 массивов значений типа Int64?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt64Tuple7(int count) + { + return TupleU.Of(ReadInt64(count), ReadInt64(count), ReadInt64(count), ReadInt64(count), ReadInt64(count), ReadInt64(count), ReadInt64(count)); + } + + /// + /// Читает 7 массивов значений типа UInt64?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt64Tuple7(int count) + { + return TupleU.Of(ReadUInt64(count), ReadUInt64(count), ReadUInt64(count), ReadUInt64(count), ReadUInt64(count), ReadUInt64(count), ReadUInt64(count)); + } + + /// + /// Читает 7 массивов значений типа Int16?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadInt16Tuple7(int count) + { + return TupleU.Of(ReadInt16(count), ReadInt16(count), ReadInt16(count), ReadInt16(count), ReadInt16(count), ReadInt16(count), ReadInt16(count)); + } + + /// + /// Читает 7 массивов значений типа UInt16?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadUInt16Tuple7(int count) + { + return TupleU.Of(ReadUInt16(count), ReadUInt16(count), ReadUInt16(count), ReadUInt16(count), ReadUInt16(count), ReadUInt16(count), ReadUInt16(count)); + } + + /// + /// Читает 7 массивов значений типа BigInteger?. + /// + /// Размер массива. + /// Кортеж. + public static Tuple ReadBigIntegerTuple7(int count) + { + return TupleU.Of(ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count), ReadBigInteger(count)); + } + + #endregion seven-arrays + + #endregion public + + } + } +} diff --git a/NETMouse - .NET release/Utils/Array.cs b/NETMouse - .NET release/Utils/ArrayU.cs similarity index 100% rename from NETMouse - .NET release/Utils/Array.cs rename to NETMouse - .NET release/Utils/ArrayU.cs diff --git a/NETMouse - .NET release/Utils/Base.Nullable.Input.cs b/NETMouse - .NET release/Utils/Base.Nullable.Input.cs deleted file mode 100644 index 4b2eafe..0000000 --- a/NETMouse - .NET release/Utils/Base.Nullable.Input.cs +++ /dev/null @@ -1,180 +0,0 @@ -using System.Numerics; -using System; - -namespace ABCNET.Utils -{ - /// - /// Предоставляет функционал для работы с базовыми типами. - /// - public static partial class Base - { - /// - /// Предоставляет функционал для работы с Nullable типами. - /// - public static partial class Nullable - { - #region public - /// - /// Читает значение типа Boolean?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Приглашение к вводу. - /// Значение. - public static bool? ReadBoolean(string prompt = EmptyStringHelper.Empty) - { - string result = InternalReadTrimmedString(prompt); - return result == NilStringHelper.Nil ? null : new bool?(bool.Parse(result)); - } - - /// - /// Читает значение типа Byte?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Приглашение к вводу. - /// Значение. - public static byte? ReadByte(string prompt = EmptyStringHelper.Empty) - { - string result = InternalReadTrimmedString(prompt); - return result == NilStringHelper.Nil ? null : new byte?(byte.Parse(result)); - } - - /// - /// Читает значение типа SByte?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Приглашение к вводу. - /// Значение. - public static sbyte? ReadSByte(string prompt = EmptyStringHelper.Empty) - { - string result = InternalReadTrimmedString(prompt); - return result == NilStringHelper.Nil ? null : new sbyte?(sbyte.Parse(result)); - } - - /// - /// Читает значение типа Char?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Приглашение к вводу. - /// Значение. - public static char? ReadChar(string prompt = EmptyStringHelper.Empty) - { - string result = InternalReadTrimmedString(prompt); - return result == NilStringHelper.Nil ? null : new char?(char.Parse(result)); - } - - /// - /// Читает значение типа Decimal?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Приглашение к вводу. - /// Значение. - public static decimal? ReadDecimal(string prompt = EmptyStringHelper.Empty) - { - string result = InternalReadTrimmedString(prompt); - return result == NilStringHelper.Nil ? null : new decimal?(decimal.Parse(result)); - } - - /// - /// Читает значение типа Double?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Приглашение к вводу. - /// Значение. - public static double? ReadDouble(string prompt = EmptyStringHelper.Empty) - { - string result = InternalReadTrimmedString(prompt); - return result == NilStringHelper.Nil ? null : new double?(double.Parse(result)); - } - - /// - /// Читает значение типа Single?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Приглашение к вводу. - /// Значение. - public static float? ReadSingle(string prompt = EmptyStringHelper.Empty) - { - string result = InternalReadTrimmedString(prompt); - return result == NilStringHelper.Nil ? null : new float?(float.Parse(result)); - } - - /// - /// Читает значение типа Int32?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Приглашение к вводу. - /// Значение. - public static int? ReadInt32(string prompt = EmptyStringHelper.Empty) - { - string result = InternalReadTrimmedString(prompt); - return result == NilStringHelper.Nil ? null : new int?(int.Parse(result)); - } - - /// - /// Читает значение типа UInt32?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Приглашение к вводу. - /// Значение. - public static uint? ReadUInt32(string prompt = EmptyStringHelper.Empty) - { - string result = InternalReadTrimmedString(prompt); - return result == NilStringHelper.Nil ? null : new uint?(uint.Parse(result)); - } - - /// - /// Читает значение типа Int64?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Приглашение к вводу. - /// Значение. - public static long? ReadInt64(string prompt = EmptyStringHelper.Empty) - { - string result = InternalReadTrimmedString(prompt); - return result == NilStringHelper.Nil ? null : new long?(long.Parse(result)); - } - - /// - /// Читает значение типа UInt64?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Приглашение к вводу. - /// Значение. - public static ulong? ReadUInt64(string prompt = EmptyStringHelper.Empty) - { - string result = InternalReadTrimmedString(prompt); - return result == NilStringHelper.Nil ? null : new ulong?(ulong.Parse(result)); - } - - /// - /// Читает значение типа Int16?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Приглашение к вводу. - /// Значение. - public static short? ReadInt16(string prompt = EmptyStringHelper.Empty) - { - string result = InternalReadTrimmedString(prompt); - return result == NilStringHelper.Nil ? null : new short?(short.Parse(result)); - } - - /// - /// Читает значение типа UInt16?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Приглашение к вводу. - /// Значение. - public static ushort? ReadUInt16(string prompt = EmptyStringHelper.Empty) - { - string result = InternalReadTrimmedString(prompt); - return result == NilStringHelper.Nil ? null : new ushort?(ushort.Parse(result)); - } - - /// - /// Читает значение типа BigInteger?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Приглашение к вводу. - /// Значение. - public static BigInteger? ReadBigInteger(string prompt = EmptyStringHelper.Empty) - { - string result = InternalReadTrimmedString(prompt); - return result == NilStringHelper.Nil ? null : new BigInteger?(BigInteger.Parse(result)); - } - #endregion public - - #region private - private static string InternalReadTrimmedString(string prompt) - { - return ReadString(prompt).Trim().ToLower(); - } - #endregion private - } - } -} diff --git a/NETMouse - .NET release/Utils/Base.Input.cs b/NETMouse - .NET release/Utils/BaseU.Input.cs similarity index 61% rename from NETMouse - .NET release/Utils/Base.Input.cs rename to NETMouse - .NET release/Utils/BaseU.Input.cs index a982973..336ec3c 100644 --- a/NETMouse - .NET release/Utils/Base.Input.cs +++ b/NETMouse - .NET release/Utils/BaseU.Input.cs @@ -7,44 +7,64 @@ namespace ABCNET.Utils /// /// . /// - public static partial class Base + public static partial class BaseU { + #region public + /// - /// Boolean. [ IDE PascalABC.NET.] + /// Boolean. /// /// . /// . public static bool ReadBoolean(string prompt = EmptyStringHelper.Empty) { prompt.Print(); - return bool.Parse(Console.ReadLine()); + bool result; + while (!bool.TryParse(Console.ReadLine(), out result)) + { + InputErrorHelper.Message.PrintLine(); + prompt.Print(); + } + return result; } /// - /// Byte. [ IDE PascalABC.NET.] + /// Byte. /// /// . /// . public static byte ReadByte(string prompt = EmptyStringHelper.Empty) { prompt.Print(); - return byte.Parse(Console.ReadLine()); + byte result; + while (!byte.TryParse(Console.ReadLine(), out result)) + { + InputErrorHelper.Message.PrintLine(); + prompt.Print(); + } + return result; } /// - /// SByte. [ IDE PascalABC.NET.] + /// SByte. /// /// . /// . public static sbyte ReadSByte(string prompt = EmptyStringHelper.Empty) { prompt.Print(); - return sbyte.Parse(Console.ReadLine()); + sbyte result; + while (!sbyte.TryParse(Console.ReadLine(), out result)) + { + InputErrorHelper.Message.PrintLine(); + prompt.Print(); + } + return result; } /// - /// Char. [ IDE PascalABC.NET.] + /// Char. /// /// . /// . @@ -55,106 +75,160 @@ public static char ReadChar(string prompt = EmptyStringHelper.Empty) } /// - /// Decimal. [ IDE PascalABC.NET.] + /// Decimal. /// /// . /// . public static decimal ReadDecimal(string prompt = EmptyStringHelper.Empty) { prompt.Print(); - return decimal.Parse(Console.ReadLine()); + decimal result; + while (!decimal.TryParse(Console.ReadLine(), out result)) + { + InputErrorHelper.Message.PrintLine(); + prompt.Print(); + } + return result; } /// - /// Double. [ IDE PascalABC.NET.] + /// Double. /// /// . /// . public static double ReadDouble(string prompt = EmptyStringHelper.Empty) { prompt.Print(); - return double.Parse(Console.ReadLine()); + double result; + while (!double.TryParse(Console.ReadLine(), out result)) + { + InputErrorHelper.Message.PrintLine(); + prompt.Print(); + } + return result; } /// - /// Single. [ IDE PascalABC.NET.] + /// Single. /// /// . /// . public static float ReadSingle(string prompt = EmptyStringHelper.Empty) { prompt.Print(); - return float.Parse(Console.ReadLine()); + float result; + while (!float.TryParse(Console.ReadLine(), out result)) + { + InputErrorHelper.Message.PrintLine(); + prompt.Print(); + } + return result; } /// - /// Int32. [ IDE PascalABC.NET.] + /// Int32. /// /// . /// . public static int ReadInt32(string prompt = EmptyStringHelper.Empty) { prompt.Print(); - return int.Parse(Console.ReadLine()); + int result; + while (!int.TryParse(Console.ReadLine(), out result)) + { + InputErrorHelper.Message.PrintLine(); + prompt.Print(); + } + return result; } /// - /// UInt32. [ IDE PascalABC.NET.] + /// UInt32. /// /// . /// . public static uint ReadUInt32(string prompt = EmptyStringHelper.Empty) { prompt.Print(); - return uint.Parse(Console.ReadLine()); + uint result; + while (!uint.TryParse(Console.ReadLine(), out result)) + { + InputErrorHelper.Message.PrintLine(); + prompt.Print(); + } + return result; } /// - /// Int64. [ IDE PascalABC.NET.] + /// Int64. /// /// . /// . public static long ReadInt64(string prompt = EmptyStringHelper.Empty) { prompt.Print(); - return long.Parse(Console.ReadLine()); + long result; + while (!long.TryParse(Console.ReadLine(), out result)) + { + InputErrorHelper.Message.PrintLine(); + prompt.Print(); + } + return result; } /// - /// UInt64. [ IDE PascalABC.NET.] + /// UInt64. /// /// . /// . public static ulong ReadUInt64(string prompt = EmptyStringHelper.Empty) { prompt.Print(); - return ulong.Parse(Console.ReadLine()); + ulong result; + while (!ulong.TryParse(Console.ReadLine(), out result)) + { + InputErrorHelper.Message.PrintLine(); + prompt.Print(); + } + return result; } /// - /// Int16. [ IDE PascalABC.NET.] + /// Int16. /// /// . /// . public static short ReadInt16(string prompt = EmptyStringHelper.Empty) { prompt.Print(); - return short.Parse(Console.ReadLine()); + short result; + while (!short.TryParse(Console.ReadLine(), out result)) + { + InputErrorHelper.Message.PrintLine(); + prompt.Print(); + } + return result; } /// - /// UInt16. [ IDE PascalABC.NET.] + /// UInt16. /// /// . /// . public static ushort ReadUInt16(string prompt = EmptyStringHelper.Empty) { prompt.Print(); - return ushort.Parse(Console.ReadLine()); + ushort result; + while (!ushort.TryParse(Console.ReadLine(), out result)) + { + InputErrorHelper.Message.PrintLine(); + prompt.Print(); + } + return result; } /// - /// String. [ IDE PascalABC.NET.] + /// String. /// /// . /// . @@ -165,30 +239,36 @@ public static string ReadString(string prompt = EmptyStringHelper.Empty) } /// - /// BigInteger. [ IDE PascalABC.NET.] + /// BigInteger. /// /// . /// . public static BigInteger ReadBigInteger(string prompt = EmptyStringHelper.Empty) { prompt.Print(); - return BigInteger.Parse(Console.ReadLine()); + BigInteger result; + while (!BigInteger.TryParse(Console.ReadLine(), out result)) + { + InputErrorHelper.Message.PrintLine(); + prompt.Print(); + } + return result; } - /// - /// [0;1). - /// + /// + /// [0;1). + /// /// . public static double Random() { return RandomHelper.Random.NextDouble(); } - /// - /// [0;1). - /// + /// + /// [0;1). + /// /// . - [Obsolete(ObsoletePABCSystemStyleHelper.Message + "Base.Random.")] + [Obsolete(ObsoletePABCSystemStyleHelper.Message + "BaseU.Random.")] public static double Rand() { return RandomHelper.Random.NextDouble(); @@ -214,7 +294,7 @@ public static int Random(int low, int high) /// . /// . /// . - [Obsolete(ObsoletePABCSystemStyleHelper.Message + "Base.Random.")] + [Obsolete(ObsoletePABCSystemStyleHelper.Message + "BaseU.Random.")] public static int Rand(int low, int high) { if (high < low) @@ -243,7 +323,7 @@ public static double Random(double low, double high) /// . /// . /// . - [Obsolete(ObsoletePABCSystemStyleHelper.Message + "Base.Random.")] + [Obsolete(ObsoletePABCSystemStyleHelper.Message + "BaseU.Random.")] public static double Rand(double low, double high) { if (high < low) @@ -251,6 +331,8 @@ public static double Rand(double low, double high) return low + Rand() * (high - low); } + #endregion public + } } \ No newline at end of file diff --git a/NETMouse - .NET release/Utils/BaseU.Nullable.Input.cs b/NETMouse - .NET release/Utils/BaseU.Nullable.Input.cs new file mode 100644 index 0000000..69684e4 --- /dev/null +++ b/NETMouse - .NET release/Utils/BaseU.Nullable.Input.cs @@ -0,0 +1,290 @@ +using System.Numerics; +using ABCNET.Extensions; + +namespace ABCNET.Utils +{ + /// + /// Предоставляет функционал для работы с базовыми типами. + /// + public static partial class BaseU + { + /// + /// Предоставляет функционал для работы с Nullable типами. + /// + public static partial class Nullable + { + + #region public + + /// + /// Читает значение типа Boolean?. + /// + /// Приглашение к вводу. + /// Значение. + public static bool? ReadBoolean(string prompt = EmptyStringHelper.Empty) + { + string resultString = InternalReadTrimmedString(prompt); + + bool result = default; + while ((resultString != NilStringHelper.Nil) && !bool.TryParse(resultString, out result)) + { + InputErrorHelper.Message.PrintLine(); + resultString = InternalReadTrimmedString(prompt); + } + + return resultString == NilStringHelper.Nil ? null : new bool?(result); + } + + /// + /// Читает значение типа Byte?. + /// + /// Приглашение к вводу. + /// Значение. + public static byte? ReadByte(string prompt = EmptyStringHelper.Empty) + { + string resultString = InternalReadTrimmedString(prompt); + + byte result = default; + while ((resultString != NilStringHelper.Nil) && !byte.TryParse(resultString, out result)) + { + InputErrorHelper.Message.PrintLine(); + resultString = InternalReadTrimmedString(prompt); + } + + return resultString == NilStringHelper.Nil ? null : new byte?(result); + } + + /// + /// Читает значение типа SByte?. + /// + /// Приглашение к вводу. + /// Значение. + public static sbyte? ReadSByte(string prompt = EmptyStringHelper.Empty) + { + string resultString = InternalReadTrimmedString(prompt); + + sbyte result = default; + while ((resultString != NilStringHelper.Nil) && !sbyte.TryParse(resultString, out result)) + { + InputErrorHelper.Message.PrintLine(); + resultString = InternalReadTrimmedString(prompt); + } + + return resultString == NilStringHelper.Nil ? null : new sbyte?(result); + } + + /// + /// Читает значение типа Char?. + /// + /// Приглашение к вводу. + /// Значение. + public static char? ReadChar(string prompt = EmptyStringHelper.Empty) + { + string result = InternalReadTrimmedString(prompt); + return result == NilStringHelper.Nil ? null : new char?(char.Parse(result)); + } + + /// + /// Читает значение типа Decimal?. + /// + /// Приглашение к вводу. + /// Значение. + public static decimal? ReadDecimal(string prompt = EmptyStringHelper.Empty) + { + string resultString = InternalReadTrimmedString(prompt); + + decimal result = default; + while ((resultString != NilStringHelper.Nil) && !decimal.TryParse(resultString, out result)) + { + InputErrorHelper.Message.PrintLine(); + resultString = InternalReadTrimmedString(prompt); + } + + return resultString == NilStringHelper.Nil ? null : new decimal?(result); + } + + /// + /// Читает значение типа Double?. + /// + /// Приглашение к вводу. + /// Значение. + public static double? ReadDouble(string prompt = EmptyStringHelper.Empty) + { + string resultString = InternalReadTrimmedString(prompt); + + double result = default; + while ((resultString != NilStringHelper.Nil) && !double.TryParse(resultString, out result)) + { + InputErrorHelper.Message.PrintLine(); + resultString = InternalReadTrimmedString(prompt); + } + + return resultString == NilStringHelper.Nil ? null : new double?(result); + } + + /// + /// Читает значение типа Single?. + /// + /// Приглашение к вводу. + /// Значение. + public static float? ReadSingle(string prompt = EmptyStringHelper.Empty) + { + string resultString = InternalReadTrimmedString(prompt); + + float result = default; + while ((resultString != NilStringHelper.Nil) && !float.TryParse(resultString, out result)) + { + InputErrorHelper.Message.PrintLine(); + resultString = InternalReadTrimmedString(prompt); + } + + return resultString == NilStringHelper.Nil ? null : new float?(result); + } + + /// + /// Читает значение типа Int32?. + /// + /// Приглашение к вводу. + /// Значение. + public static int? ReadInt32(string prompt = EmptyStringHelper.Empty) + { + string resultString = InternalReadTrimmedString(prompt); + + int result = default; + while ((resultString != NilStringHelper.Nil) && !int.TryParse(resultString, out result)) + { + InputErrorHelper.Message.PrintLine(); + resultString = InternalReadTrimmedString(prompt); + } + + return resultString == NilStringHelper.Nil ? null : new int?(result); + } + + /// + /// Читает значение типа UInt32?. + /// + /// Приглашение к вводу. + /// Значение. + public static uint? ReadUInt32(string prompt = EmptyStringHelper.Empty) + { + string resultString = InternalReadTrimmedString(prompt); + + uint result = default; + while ((resultString != NilStringHelper.Nil) && !uint.TryParse(resultString, out result)) + { + InputErrorHelper.Message.PrintLine(); + resultString = InternalReadTrimmedString(prompt); + } + + return resultString == NilStringHelper.Nil ? null : new uint?(result); + } + + /// + /// Читает значение типа Int64?. + /// + /// Приглашение к вводу. + /// Значение. + public static long? ReadInt64(string prompt = EmptyStringHelper.Empty) + { + string resultString = InternalReadTrimmedString(prompt); + + long result = default; + while ((resultString != NilStringHelper.Nil) && !long.TryParse(resultString, out result)) + { + InputErrorHelper.Message.PrintLine(); + resultString = InternalReadTrimmedString(prompt); + } + + return resultString == NilStringHelper.Nil ? null : new long?(result); + } + + /// + /// Читает значение типа UInt64?. + /// + /// Приглашение к вводу. + /// Значение. + public static ulong? ReadUInt64(string prompt = EmptyStringHelper.Empty) + { + string resultString = InternalReadTrimmedString(prompt); + + ulong result = default; + while ((resultString != NilStringHelper.Nil) && !ulong.TryParse(resultString, out result)) + { + InputErrorHelper.Message.PrintLine(); + resultString = InternalReadTrimmedString(prompt); + } + + return resultString == NilStringHelper.Nil ? null : new ulong?(result); + } + + /// + /// Читает значение типа Int16?. + /// + /// Приглашение к вводу. + /// Значение. + public static short? ReadInt16(string prompt = EmptyStringHelper.Empty) + { + string resultString = InternalReadTrimmedString(prompt); + + short result = default; + while ((resultString != NilStringHelper.Nil) && !short.TryParse(resultString, out result)) + { + InputErrorHelper.Message.PrintLine(); + resultString = InternalReadTrimmedString(prompt); + } + + return resultString == NilStringHelper.Nil ? null : new short?(result); + } + + /// + /// Читает значение типа UInt16?. + /// + /// Приглашение к вводу. + /// Значение. + public static ushort? ReadUInt16(string prompt = EmptyStringHelper.Empty) + { + string resultString = InternalReadTrimmedString(prompt); + + ushort result = default; + while ((resultString != NilStringHelper.Nil) && !ushort.TryParse(resultString, out result)) + { + InputErrorHelper.Message.PrintLine(); + resultString = InternalReadTrimmedString(prompt); + } + + return resultString == NilStringHelper.Nil ? null : new ushort?(result); + } + + /// + /// Читает значение типа BigInteger?. + /// + /// Приглашение к вводу. + /// Значение. + public static BigInteger? ReadBigInteger(string prompt = EmptyStringHelper.Empty) + { + string resultString = InternalReadTrimmedString(prompt); + + BigInteger result = default; + while ((resultString != NilStringHelper.Nil) && !BigInteger.TryParse(resultString, out result)) + { + InputErrorHelper.Message.PrintLine(); + resultString = InternalReadTrimmedString(prompt); + } + + return resultString == NilStringHelper.Nil ? null : new BigInteger?(result); + } + + #endregion public + + #region private + + private static string InternalReadTrimmedString(string prompt) + { + return ReadString(prompt).Trim().ToLower(); + } + + #endregion private + + } + } +} diff --git a/NETMouse - .NET release/Utils/Base.Other.cs b/NETMouse - .NET release/Utils/BaseU.Other.cs similarity index 93% rename from NETMouse - .NET release/Utils/Base.Other.cs rename to NETMouse - .NET release/Utils/BaseU.Other.cs index bd3300d..e424164 100644 --- a/NETMouse - .NET release/Utils/Base.Other.cs +++ b/NETMouse - .NET release/Utils/BaseU.Other.cs @@ -3,9 +3,11 @@ /// /// Предоставляет функционал для работы с базовыми типами. /// - public static partial class Base + public static partial class BaseU { + #region public + /// /// Меняет местами значения двух переменных. /// @@ -17,6 +19,8 @@ public static void Swap(ref T x, ref T y) x = y; y = z; } + #endregion public + } } diff --git a/NETMouse - .NET release/Utils/Base.cs b/NETMouse - .NET release/Utils/BaseU.cs similarity index 100% rename from NETMouse - .NET release/Utils/Base.cs rename to NETMouse - .NET release/Utils/BaseU.cs diff --git a/NETMouse - .NET release/Utils/Matrix.Input.cs b/NETMouse - .NET release/Utils/Matrix.Input.cs deleted file mode 100644 index d8a5ae9..0000000 --- a/NETMouse - .NET release/Utils/Matrix.Input.cs +++ /dev/null @@ -1,501 +0,0 @@ -using ABCNET.Extensions; -using System; - -namespace ABCNET.Utils -{ - /// - /// Предоставляет функционал для работы с матрицами. - /// - public static partial class Matrix - { - #region public - /// - /// Читает матрицу значений типа Boolean. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Приглашение к вводу. - /// Матрица. - public static bool[,] ReadBoolean(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) - { - if (rowsCount < 0) - throw new ArgumentOutOfRangeException(nameof(rowsCount)); - if (colsCount < 0) - throw new ArgumentOutOfRangeException(nameof(colsCount)); - - bool[,] source = new bool[rowsCount, colsCount]; - int i = 0; - int j = 0; - - while (i < rowsCount) - { - while (j < colsCount) - try - { - source[i, j] = Base.ReadBoolean(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, i, j)); - j++; - } - catch (Exception) - { - InputErrorHelper.Message.PrintLine(); - } - - i++; - j = 0; - } - - return source; - } - - /// - /// Читает матрицу значений типа Char. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Приглашение к вводу. - /// Матрица. - public static char[,] ReadChar(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) - { - if (rowsCount < 0) - throw new ArgumentOutOfRangeException(nameof(rowsCount)); - if (colsCount < 0) - throw new ArgumentOutOfRangeException(nameof(colsCount)); - - char[,] source = new char[rowsCount, colsCount]; - for (int i = 0; i < rowsCount; i++) - for (int j = 0; j < colsCount; j++) - source[i, j] = Base.ReadChar(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, i, j)); - - return source; - } - - /// - /// Читает матрицу значений типа Double. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Приглашение к вводу. - /// Матрица. - public static double[,] ReadDouble(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) - { - if (rowsCount < 0) - throw new ArgumentOutOfRangeException(nameof(rowsCount)); - if (colsCount < 0) - throw new ArgumentOutOfRangeException(nameof(colsCount)); - - double[,] source = new double[rowsCount, colsCount]; - int i = 0; - int j = 0; - - while (i < rowsCount) - { - while (j < colsCount) - try - { - source[i, j] = Base.ReadDouble(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, i, j)); - j++; - } - catch (Exception) - { - InputErrorHelper.Message.PrintLine(); - } - - i++; - j = 0; - } - - return source; - } - - /// - /// Читает матрицу значений типа Int32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Приглашение к вводу. - /// Матрица. - public static int[,] ReadInt32(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) - { - if (rowsCount < 0) - throw new ArgumentOutOfRangeException(nameof(rowsCount)); - if (colsCount < 0) - throw new ArgumentOutOfRangeException(nameof(colsCount)); - - int[,] source = new int[rowsCount, colsCount]; - int i = 0; - int j = 0; - - while (i < rowsCount) - { - while (j < colsCount) - try - { - source[i, j] = Base.ReadInt32(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, i, j)); - j++; - } - catch (Exception) - { - InputErrorHelper.Message.PrintLine(); - } - - i++; - j = 0; - } - - return source; - } - - /// - /// Читает матрицу значений типа String. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Приглашение к вводу. - /// Матрица. - public static string[,] ReadString(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) - { - if (rowsCount < 0) - throw new ArgumentOutOfRangeException(nameof(rowsCount)); - if (colsCount < 0) - throw new ArgumentOutOfRangeException(nameof(colsCount)); - - string[,] source = new string[rowsCount, colsCount]; - for (int i = 0; i < rowsCount; i++) - for (int j = 0; j < colsCount; j++) - source[i, j] = Base.ReadString(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, i, j)); - - return source; - } - - /// - /// Заполняет 2 массива значениями типа Boolean. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadBooleanTup2(int rowsCount, int colsCount) - { - return Tuple.Of(ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount)); - } - - /// - /// Заполняет 2 массива значениями типа Char. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadCharTup2(int rowsCount, int colsCount) - { - return Tuple.Of(ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount)); - } - - /// - /// Заполняет 2 массива значениями типа Int32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadInt32Tup2(int rowsCount, int colsCount) - { - return Tuple.Of(ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount)); - } - - /// - /// Заполняет 2 массива значениями типа Double. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadDoubleTup2(int rowsCount, int colsCount) - { - return Tuple.Of(ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount)); - } - - /// - /// Заполняет 2 массива значениями типа String. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadStringTup2(int rowsCount, int colsCount) - { - return Tuple.Of(ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount)); - } - - /// - /// Заполняет 3 массива значениями типа Boolean. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadBooleanTup3(int rowsCount, int colsCount) - { - return Tuple.Of(ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount)); - } - - /// - /// Заполняет 3 массива значениями типа Char. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadCharTup3(int rowsCount, int colsCount) - { - return Tuple.Of(ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount)); - } - - /// - /// Заполняет 3 массива значениями типа Int32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadInt32Tup3(int rowsCount, int colsCount) - { - return Tuple.Of(ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount)); - } - - /// - /// Заполняет 3 массива значениями типа Double. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadDoubleTup3(int rowsCount, int colsCount) - { - return Tuple.Of(ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount)); - } - - /// - /// Заполняет 3 массива значениями типа String. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadStringTup3(int rowsCount, int colsCount) - { - return Tuple.Of(ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount)); - } - - /// - /// Заполняет 4 массива значениями типа Boolean. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadBooleanTup4(int rowsCount, int colsCount) - { - return Tuple.Of(ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount)); - } - - /// - /// Заполняет 4 массива значениями типа Char. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadCharTup4(int rowsCount, int colsCount) - { - return Tuple.Of(ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount)); - } - - /// - /// Заполняет 4 массива значениями типа Int32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadInt32Tup4(int rowsCount, int colsCount) - { - return Tuple.Of(ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount)); - } - - /// - /// Заполняет 4 массива значениями типа Double. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadDoubleTup4(int rowsCount, int colsCount) - { - return Tuple.Of(ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount)); - } - - /// - /// Заполняет 4 массива значениями типа String. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadStringTup4(int rowsCount, int colsCount) - { - return Tuple.Of(ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount)); - } - - /// - /// Заполняет 5 массива значениями типа Boolean. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadBooleanTup5(int rowsCount, int colsCount) - { - return Tuple.Of(ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount)); - } - - /// - /// Заполняет 5 массива значениями типа Char. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadCharTup5(int rowsCount, int colsCount) - { - return Tuple.Of(ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount)); - } - - /// - /// Заполняет 5 массива значениями типа Int32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadInt32Tup5(int rowsCount, int colsCount) - { - return Tuple.Of(ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount)); - } - - /// - /// Заполняет 5 массива значениями типа Double. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadDoubleTup5(int rowsCount, int colsCount) - { - return Tuple.Of(ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount)); - } - - /// - /// Заполняет 5 массива значениями типа String. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadStringTup5(int rowsCount, int colsCount) - { - return Tuple.Of(ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount)); - } - - /// - /// Заполняет 6 массива значениями типа Boolean. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadBooleanTup6(int rowsCount, int colsCount) - { - return Tuple.Of(ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount)); - } - - /// - /// Заполняет 6 массива значениями типа Char. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadCharTup6(int rowsCount, int colsCount) - { - return Tuple.Of(ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount)); - } - - /// - /// Заполняет 6 массива значениями типа Int32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadInt32Tup6(int rowsCount, int colsCount) - { - return Tuple.Of(ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount)); - } - - /// - /// Заполняет 6 массива значениями типа Double. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadDoubleTup6(int rowsCount, int colsCount) - { - return Tuple.Of(ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount)); - } - - /// - /// Заполняет 6 массива значениями типа String. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadStringTup6(int rowsCount, int colsCount) - { - return Tuple.Of(ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount)); - } - - /// - /// Заполняет 6 массива значениями типа Boolean. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadBooleanTup7(int rowsCount, int colsCount) - { - return Tuple.Of(ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount)); - } - - /// - /// Заполняет 7 массива значениями типа Char. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadCharTup7(int rowsCount, int colsCount) - { - return Tuple.Of(ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount)); - } - - /// - /// Заполняет 7 массива значениями типа Int32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadInt32Tup7(int rowsCount, int colsCount) - { - return Tuple.Of(ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount)); - } - - /// - /// Заполняет 7 массива значениями типа Double. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadDoubleTup7(int rowsCount, int colsCount) - { - return Tuple.Of(ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount)); - } - - /// - /// Заполняет 2 массива значениями типа String. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Количество строк. - /// Количество столбцов. - /// Кортеж. - public static Tuple ReadStringTup7(int rowsCount, int colsCount) - { - return Tuple.Of(ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount)); - } - #endregion public - } -} diff --git a/NETMouse - .NET release/Utils/Matrix.Generators.cs b/NETMouse - .NET release/Utils/MatrixU.Generators.cs similarity index 97% rename from NETMouse - .NET release/Utils/Matrix.Generators.cs rename to NETMouse - .NET release/Utils/MatrixU.Generators.cs index fb4678b..03743e7 100644 --- a/NETMouse - .NET release/Utils/Matrix.Generators.cs +++ b/NETMouse - .NET release/Utils/MatrixU.Generators.cs @@ -5,9 +5,11 @@ namespace ABCNET.Utils /// /// . /// - public static partial class Matrix + public static partial class MatrixU { + #region public + /// /// . /// @@ -84,7 +86,7 @@ public static partial class Matrix int[,] source = new int[rowsCount, colsCount]; for (int i = 0; i < source.GetLength(0); i++) for (int j = 0; j < source.GetLength(1); j++) - source[i, j] = Base.Random(low, high); + source[i, j] = BaseU.Random(low, high); return source; } @@ -109,7 +111,7 @@ public static partial class Matrix double[,] source = new double[rowsCount, colsCount]; for (int i = 0; i < source.GetLength(0); i++) for (int j = 0; j < source.GetLength(1); j++) - source[i, j] = Base.Random(low, high); + source[i, j] = BaseU.Random(low, high); return source; } @@ -135,6 +137,8 @@ public static partial class Matrix return source; } + #endregion public + } } \ No newline at end of file diff --git a/NETMouse - .NET release/Utils/MatrixU.Input.cs b/NETMouse - .NET release/Utils/MatrixU.Input.cs new file mode 100644 index 0000000..f8074ba --- /dev/null +++ b/NETMouse - .NET release/Utils/MatrixU.Input.cs @@ -0,0 +1,1455 @@ +using System; +using System.Numerics; + +namespace ABCNET.Utils +{ + /// + /// Предоставляет функционал для работы с матрицами. + /// + public static partial class MatrixU + { + + #region public + + #region Read1 + + /// + /// Читает матрицу значений типа Boolean. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static bool[,] ReadBoolean(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + bool[,] source = new bool[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.ReadBoolean(string.Format(prompt, i, j)); + } + } + + return source; + } + + /// + /// Читает матрицу значений типа Byte. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static byte[,] ReadByte(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + byte[,] source = new byte[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.ReadByte(string.Format(prompt, i, j)); + } + } + + return source; + } + + /// + /// Читает матрицу значений типа SByte. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static sbyte[,] ReadSByte(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + sbyte[,] source = new sbyte[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.ReadSByte(string.Format(prompt, i, j)); + } + } + + return source; + } + + /// + /// Читает матрицу значений типа Char. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static char[,] ReadChar(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + char[,] source = new char[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.ReadChar(string.Format(prompt, i, j)); + } + } + + return source; + } + + /// + /// Читает матрицу значений типа Decimal. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static decimal[,] ReadDecimal(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + decimal[,] source = new decimal[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.ReadDecimal(string.Format(prompt, i, j)); + } + } + + return source; + } + + /// + /// Читает матрицу значений типа Double. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static double[,] ReadDouble(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + double[,] source = new double[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.ReadDouble(string.Format(prompt, i, j)); + } + } + + return source; + } + + /// + /// Читает матрицу значений типа Single. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static float[,] ReadSingle(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + float[,] source = new float[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.ReadSingle(string.Format(prompt, i, j)); + } + } + + return source; + } + + /// + /// Читает матрицу значений типа Int32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static int[,] ReadInt32(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int[,] source = new int[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.ReadInt32(string.Format(prompt, i, j)); + } + } + + return source; + } + + /// + /// Читает матрицу значений типа UInt32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static uint[,] ReadUInt32(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + uint[,] source = new uint[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.ReadUInt32(string.Format(prompt, i, j)); + } + } + + return source; + } + + /// + /// Читает матрицу значений типа Int64. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static long[,] ReadInt64(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + long[,] source = new long[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.ReadInt64(string.Format(prompt, i, j)); + } + } + + return source; + } + + /// + /// Читает матрицу значений типа UInt64. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static ulong[,] ReadUInt64(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + ulong[,] source = new ulong[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.ReadUInt64(string.Format(prompt, i, j)); + } + } + + return source; + } + + /// + /// Читает матрицу значений типа Int16. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static short[,] ReadInt16(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + short[,] source = new short[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.ReadInt16(string.Format(prompt, i, j)); + } + } + + return source; + } + + /// + /// Читает матрицу значений типа UInt16. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static ushort[,] ReadUInt16(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + ushort[,] source = new ushort[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.ReadUInt16(string.Format(prompt, i, j)); + } + } + + return source; + } + + /// + /// Читает матрицу значений типа BigInteger. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static BigInteger[,] ReadBigInteger(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + BigInteger[,] source = new BigInteger[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.ReadBigInteger(string.Format(prompt, i, j)); + } + } + + return source; + } + + /// + /// Читает матрицу значений типа String. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static string[,] ReadString(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + string[,] source = new string[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.ReadString(string.Format(prompt, i, j)); + } + } + + return source; + } + + #endregion + + #region Read2 + + /// + /// Читает 2 матрицы типа Boolean. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadBooleanTuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount)); + } + + /// + /// Читает 2 матрицы типа Byte. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadByteTuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount)); + } + + /// + /// Читает 2 матрицы типа SByte. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadSByteTuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount)); + } + + /// + /// Читает 2 матрицы типа Char. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadCharTuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount)); + } + + /// + /// Читает 2 матрицы типа Decimal. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadDecimalTuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount)); + } + + /// + /// Читает 2 матрицы типа Double. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadDoubleTuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount)); + } + + /// + /// Читает 2 матрицы типа Single. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadSingleTuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount)); + } + + /// + /// Читает 2 матрицы типа Int32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt32Tuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount)); + } + + /// + /// Читает 2 матрицы типа UInt32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt32Tuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount)); + } + + /// + /// Читает 2 матрицы типа Int64. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt64Tuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount)); + } + + /// + /// Читает 2 матрицы типа UInt64. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt64Tuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount)); + } + + /// + /// Читает 2 матрицы типа Int16. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt16Tuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount)); + } + + /// + /// Читает 2 матрицы типа UInt16. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt16Tuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount)); + } + + /// + /// Читает 2 матрицы типа BigInteger. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadBigIntegerTuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount)); + } + + /// + /// Читает 2 матрицы типа String. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadStringTuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount)); + } + + #endregion + + #region Read3 + + /// + /// Читает 3 матрицы типа Boolean. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadBooleanTuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount)); + } + + /// + /// Читает 3 матрицы типа Byte. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadByteTuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount)); + } + + /// + /// Читает 3 матрицы типа SByte. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadSByteTuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount)); + } + + /// + /// Читает 3 матрицы типа Char. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadCharTuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount)); + } + + /// + /// Читает 3 матрицы типа Decimal. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadDecimalTuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount)); + } + + /// + /// Читает 3 матрицы типа Double. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadDoubleTuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount)); + } + + /// + /// Читает 3 матрицы типа Single. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadSingleTuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount)); + } + + /// + /// Читает 3 матрицы типа Int32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt32Tuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount)); + } + + /// + /// Читает 3 матрицы типа UInt32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt32Tuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount)); + } + + /// + /// Читает 3 матрицы типа Int64. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt64Tuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount)); + } + + /// + /// Читает 3 матрицы типа UInt64. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt64Tuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount)); + } + + /// + /// Читает 3 матрицы типа Int16. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt16Tuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount)); + } + + /// + /// Читает 3 матрицы типа UInt16. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt16Tuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount)); + } + + /// + /// Читает 3 матрицы типа BigInteger. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadBigIntegerTuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount)); + } + + /// + /// Читает 3 матрицы типа String. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadStringTuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount)); + } + + #endregion + + #region Read4 + + /// + /// Читает 4 матрицы типа Boolean. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadBooleanTuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount)); + } + + /// + /// Читает 4 матрицы типа Byte. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadByteTuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount)); + } + + /// + /// Читает 4 матрицы типа SByte. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadSByteTuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount)); + } + + /// + /// Читает 4 матрицы типа Char. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadCharTuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount)); + } + + /// + /// Читает 4 матрицы типа Decimal. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadDecimalTuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount)); + } + + /// + /// Читает 4 матрицы типа Double. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadDoubleTuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount)); + } + + /// + /// Читает 4 матрицы типа Single. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadSingleTuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount)); + } + + /// + /// Читает 4 матрицы типа Int32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt32Tuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount)); + } + + /// + /// Читает 4 матрицы типа UInt32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt32Tuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount)); + } + + /// + /// Читает 4 матрицы типа Int64. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt64Tuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount)); + } + + /// + /// Читает 4 матрицы типа UInt64. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt64Tuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount)); + } + + /// + /// Читает 4 матрицы типа Int16. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt16Tuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount)); + } + + /// + /// Читает 4 матрицы типа UInt16. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt16Tuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount)); + } + + /// + /// Читает 4 матрицы типа BigInteger. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadBigIntegerTuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount)); + } + + /// + /// Читает 4 матрицы типа String. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadStringTuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount)); + } + + #endregion + + #region Read5 + + /// + /// Читает 5 матриц типа Boolean. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadBooleanTuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount)); + } + + /// + /// Читает 5 матриц типа Byte. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadByteTuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount)); + } + + /// + /// Читает 5 матриц типа SByte. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadSByteTuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount)); + } + + /// + /// Читает 5 матриц типа Char. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadCharTuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount)); + } + + /// + /// Читает 5 матриц типа Decimal. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadDecimalTuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount)); + } + + /// + /// Читает 5 матриц типа Double. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadDoubleTuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount)); + } + + /// + /// Читает 5 матриц типа Single. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadSingleTuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount)); + } + + /// + /// Читает 5 матриц типа Int32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt32Tuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount)); + } + + /// + /// Читает 5 матриц типа UInt32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt32Tuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount)); + } + + /// + /// Читает 5 матриц типа Int64. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt64Tuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount)); + } + + /// + /// Читает 5 матриц типа UInt64. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt64Tuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount)); + } + + /// + /// Читает 5 матриц типа Int16. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt16Tuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount)); + } + + /// + /// Читает 5 матриц типа UInt16. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt16Tuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount)); + } + + /// + /// Читает 5 матриц типа BigInteger. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadBigIntegerTuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount)); + } + + /// + /// Читает 5 матриц типа String. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadStringTuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount)); + } + + #endregion + + #region Read6 + + /// + /// Читает 6 матриц типа Boolean. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadBooleanTuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount)); + } + + /// + /// Читает 6 матриц типа Byte. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadByteTuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount)); + } + + /// + /// Читает 6 матриц типа SByte. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadSByteTuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount)); + } + + /// + /// Читает 6 матриц типа Char. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadCharTuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount)); + } + + /// + /// Читает 6 матриц типа Decimal. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadDecimalTuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount)); + } + + /// + /// Читает 6 матриц типа Double. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadDoubleTuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount)); + } + + /// + /// Читает 6 матриц типа Single. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadSingleTuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount)); + } + + /// + /// Читает 6 матриц типа Int32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt32Tuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount)); + } + + /// + /// Читает 6 матриц типа UInt32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt32Tuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount)); + } + + /// + /// Читает 6 матриц типа Int64. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt64Tuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount)); + } + + /// + /// Читает 6 матриц типа UInt64. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt64Tuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount)); + } + + /// + /// Читает 6 матриц типа Int16. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt16Tuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount)); + } + + /// + /// Читает 6 матриц типа UInt16. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt16Tuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount)); + } + + /// + /// Читает 6 матриц типа BigInteger. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadBigIntegerTuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount)); + } + + /// + /// Читает 6 матриц типа String. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadStringTuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount)); + } + + #endregion + + #region Read7 + + /// + /// Читает 7 матриц типа Boolean. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadBooleanTuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount)); + } + + /// + /// Читает 7 матриц типа Byte. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadByteTuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount)); + } + + /// + /// Читает 7 матриц типа SByte. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadSByteTuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount)); + } + + /// + /// Читает 7 матриц типа Char. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadCharTuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount)); + } + + /// + /// Читает 7 матриц типа Decimal. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadDecimalTuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount)); + } + + /// + /// Читает 7 матриц типа Double. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadDoubleTuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount)); + } + + /// + /// Читает 7 матриц типа Single. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadSingleTuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount)); + } + + /// + /// Читает 7 матриц типа Int32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt32Tuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount)); + } + + /// + /// Читает 7 матриц типа UInt32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt32Tuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount)); + } + + /// + /// Читает 7 матриц типа Int64. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt64Tuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount)); + } + + /// + /// Читает 7 матриц типа UInt64. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt64Tuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount)); + } + + /// + /// Читает 7 матриц типа Int16. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt16Tuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount)); + } + + /// + /// Читает 7 матриц типа UInt16. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt16Tuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount)); + } + + /// + /// Читает 7 матриц типа BigInteger. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadBigIntegerTuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount)); + } + + /// + /// Читает 7 матриц типа String. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadStringTuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount), ReadString(rowsCount, colsCount)); + } + + #endregion + + #endregion public + + } +} diff --git a/NETMouse - .NET release/Utils/MatrixU.Nullable.Input.cs b/NETMouse - .NET release/Utils/MatrixU.Nullable.Input.cs new file mode 100644 index 0000000..d973c66 --- /dev/null +++ b/NETMouse - .NET release/Utils/MatrixU.Nullable.Input.cs @@ -0,0 +1,1367 @@ +using System; +using System.Numerics; + +namespace ABCNET.Utils +{ + /// + /// Предоставляет функционал для работы с матрицами. + /// + public static partial class MatrixU + { + /// + /// Предоставляет функционал для работы с Nullable типами. + /// + public static partial class Nullable + { + + #region public + + #region Read1 + + /// + /// Читает матрицу значений типа Boolean?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static bool?[,] ReadBoolean(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + bool?[,] source = new bool?[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.Nullable.ReadBoolean(string.Format(prompt, i, j)); + } + } + + return source; + } + + /// + /// Читает матрицу значений типа Byte?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static byte?[,] ReadByte(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + byte?[,] source = new byte?[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.Nullable.ReadByte(string.Format(prompt, i, j)); + } + } + + return source; + } + + /// + /// Читает матрицу значений типа SByte?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static sbyte?[,] ReadSByte(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + sbyte?[,] source = new sbyte?[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.Nullable.ReadSByte(string.Format(prompt, i, j)); + } + } + + return source; + } + + /// + /// Читает матрицу значений типа Char?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static char?[,] ReadChar(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + char?[,] source = new char?[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.Nullable.ReadChar(string.Format(prompt, i, j)); + } + } + + return source; + } + + /// + /// Читает матрицу значений типа Decimal?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static decimal?[,] ReadDecimal(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + decimal?[,] source = new decimal?[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.Nullable.ReadDecimal(string.Format(prompt, i, j)); + } + } + + return source; + } + + /// + /// Читает матрицу значений типа Double?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static double?[,] ReadDouble(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + double?[,] source = new double?[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.Nullable.ReadDouble(string.Format(prompt, i, j)); + } + } + + return source; + } + + /// + /// Читает матрицу значений типа Single?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static float?[,] ReadSingle(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + float?[,] source = new float?[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.Nullable.ReadSingle(string.Format(prompt, i, j)); + } + } + + return source; + } + + /// + /// Читает матрицу значений типа Int32?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static int?[,] ReadInt32(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + int?[,] source = new int?[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.Nullable.ReadInt32(string.Format(prompt, i, j)); + } + } + + return source; + } + + /// + /// Читает матрицу значений типа UInt32?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static uint?[,] ReadUInt32(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + uint?[,] source = new uint?[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.Nullable.ReadUInt32(string.Format(prompt, i, j)); + } + } + + return source; + } + + /// + /// Читает матрицу значений типа Int64?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static long?[,] ReadInt64(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + long?[,] source = new long?[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.Nullable.ReadInt64(string.Format(prompt, i, j)); + } + } + + return source; + } + + /// + /// Читает матрицу значений типа UInt64?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static ulong?[,] ReadUInt64(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + ulong?[,] source = new ulong?[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.Nullable.ReadUInt64(string.Format(prompt, i, j)); + } + } + + return source; + } + + /// + /// Читает матрицу значений типа Int16?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static short?[,] ReadInt16(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + short?[,] source = new short?[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.Nullable.ReadInt16(string.Format(prompt, i, j)); + } + } + + return source; + } + + /// + /// Читает матрицу значений типа UInt16?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static ushort?[,] ReadUInt16(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + ushort?[,] source = new ushort?[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.Nullable.ReadUInt16(string.Format(prompt, i, j)); + } + } + + return source; + } + + /// + /// Читает матрицу значений типа BigInteger?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Приглашение к вводу. + /// Матрица. + public static BigInteger?[,] ReadBigInteger(int rowsCount, int colsCount, string prompt = EmptyStringHelper.Empty) + { + if (rowsCount < 0) + throw new ArgumentOutOfRangeException(nameof(rowsCount)); + if (colsCount < 0) + throw new ArgumentOutOfRangeException(nameof(colsCount)); + + prompt = prompt ?? EmptyStringHelper.Empty; + + BigInteger?[,] source = new BigInteger?[rowsCount, colsCount]; + for (int i = 0; i < rowsCount; i++) + { + for (int j = 0; j < colsCount; j++) + { + source[i, j] = BaseU.Nullable.ReadBigInteger(string.Format(prompt, i, j)); + } + } + + return source; + } + + #endregion + + #region Read2 + + /// + /// Читает 2 матрицы типа Boolean?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadBooleanTuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount)); + } + + /// + /// Читает 2 матрицы типа Byte?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadByteTuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount)); + } + + /// + /// Читает 2 матрицы типа SByte?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadSByteTuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount)); + } + + /// + /// Читает 2 матрицы типа Char?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadCharTuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount)); + } + + /// + /// Читает 2 матрицы типа Decimal?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadDecimalTuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount)); + } + + /// + /// Читает 2 матрицы типа Double?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadDoubleTuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount)); + } + + /// + /// Читает 2 матрицы типа Single?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadSingleTuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount)); + } + + /// + /// Читает 2 матрицы типа Int32?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt32Tuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount)); + } + + /// + /// Читает 2 матрицы типа UInt32?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt32Tuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount)); + } + + /// + /// Читает 2 матрицы типа Int64?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt64Tuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount)); + } + + /// + /// Читает 2 матрицы типа UInt64?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt64Tuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount)); + } + + /// + /// Читает 2 матрицы типа Int16?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt16Tuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount)); + } + + /// + /// Читает 2 матрицы типа UInt16?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt16Tuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount)); + } + + /// + /// Читает 2 матрицы типа BigInteger?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadBigIntegerTuple2(int rowsCount, int colsCount) + { + return TupleU.Of(ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount)); + } + + #endregion + + #region Read3 + + /// + /// Читает 3 матрицы типа Boolean?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadBooleanTuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount)); + } + + /// + /// Читает 3 матрицы типа Byte?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadByteTuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount)); + } + + /// + /// Читает 3 матрицы типа SByte?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadSByteTuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount)); + } + + /// + /// Читает 3 матрицы типа Char?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadCharTuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount)); + } + + /// + /// Читает 3 матрицы типа Decimal?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadDecimalTuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount)); + } + + /// + /// Читает 3 матрицы типа Double?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadDoubleTuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount)); + } + + /// + /// Читает 3 матрицы типа Single?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadSingleTuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount)); + } + + /// + /// Читает 3 матрицы типа Int32?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt32Tuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount)); + } + + /// + /// Читает 3 матрицы типа UInt32?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt32Tuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount)); + } + + /// + /// Читает 3 матрицы типа Int64?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt64Tuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount)); + } + + /// + /// Читает 3 матрицы типа UInt64?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt64Tuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount)); + } + + /// + /// Читает 3 матрицы типа Int16?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt16Tuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount)); + } + + /// + /// Читает 3 матрицы типа UInt16?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt16Tuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount)); + } + + /// + /// Читает 3 матрицы типа BigInteger?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadBigIntegerTuple3(int rowsCount, int colsCount) + { + return TupleU.Of(ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount)); + } + + #endregion + + #region Read4 + + /// + /// Читает 4 матрицы типа Boolean?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadBooleanTuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount)); + } + + /// + /// Читает 4 матрицы типа Byte?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadByteTuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount)); + } + + /// + /// Читает 4 матрицы типа SByte?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadSByteTuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount)); + } + + /// + /// Читает 4 матрицы типа Char?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadCharTuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount)); + } + + /// + /// Читает 4 матрицы типа Decimal?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadDecimalTuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount)); + } + + /// + /// Читает 4 матрицы типа Double?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadDoubleTuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount)); + } + + /// + /// Читает 4 матрицы типа Single?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadSingleTuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount)); + } + + /// + /// Читает 4 матрицы типа Int32?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt32Tuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount)); + } + + /// + /// Читает 4 матрицы типа UInt32?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt32Tuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount)); + } + + /// + /// Читает 4 матрицы типа Int64?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt64Tuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount)); + } + + /// + /// Читает 4 матрицы типа UInt64?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt64Tuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount)); + } + + /// + /// Читает 4 матрицы типа Int16?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt16Tuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount)); + } + + /// + /// Читает 4 матрицы типа UInt16?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt16Tuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount)); + } + + /// + /// Читает 4 матрицы типа BigInteger?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadBigIntegerTuple4(int rowsCount, int colsCount) + { + return TupleU.Of(ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount)); + } + + #endregion + + #region Read5 + + /// + /// Читает 5 матриц типа Boolean?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadBooleanTuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount)); + } + + /// + /// Читает 5 матриц типа Byte?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadByteTuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount)); + } + + /// + /// Читает 5 матриц типа SByte?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadSByteTuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount)); + } + + /// + /// Читает 5 матриц типа Char?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadCharTuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount)); + } + + /// + /// Читает 5 матриц типа Decimal?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadDecimalTuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount)); + } + + /// + /// Читает 5 матриц типа Double?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadDoubleTuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount)); + } + + /// + /// Читает 5 матриц типа Single?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadSingleTuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount)); + } + + /// + /// Читает 5 матриц типа Int32?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt32Tuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount)); + } + + /// + /// Читает 5 матриц типа UInt32?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt32Tuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount)); + } + + /// + /// Читает 5 матриц типа Int64?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt64Tuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount)); + } + + /// + /// Читает 5 матриц типа UInt64?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt64Tuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount)); + } + + /// + /// Читает 5 матриц типа Int16?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt16Tuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount)); + } + + /// + /// Читает 5 матриц типа UInt16?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt16Tuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount)); + } + + /// + /// Читает 5 матриц типа BigInteger?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadBigIntegerTuple5(int rowsCount, int colsCount) + { + return TupleU.Of(ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount)); + } + + #endregion + + #region Read6 + + /// + /// Читает 6 матриц типа Boolean?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadBooleanTuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount)); + } + + /// + /// Читает 6 матриц типа Byte?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadByteTuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount)); + } + + /// + /// Читает 6 матриц типа SByte?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadSByteTuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount)); + } + + /// + /// Читает 6 матриц типа Char?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadCharTuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount)); + } + + /// + /// Читает 6 матриц типа Decimal?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadDecimalTuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount)); + } + + /// + /// Читает 6 матриц типа Double?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadDoubleTuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount)); + } + + /// + /// Читает 6 матриц типа Single?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadSingleTuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount)); + } + + /// + /// Читает 6 матриц типа Int32?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt32Tuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount)); + } + + /// + /// Читает 6 матриц типа UInt32?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt32Tuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount)); + } + + /// + /// Читает 6 матриц типа Int64?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt64Tuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount)); + } + + /// + /// Читает 6 матриц типа UInt64?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt64Tuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount)); + } + + /// + /// Читает 6 матриц типа Int16?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt16Tuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount)); + } + + /// + /// Читает 6 матриц типа UInt16?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt16Tuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount)); + } + + /// + /// Читает 6 матриц типа BigInteger?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadBigIntegerTuple6(int rowsCount, int colsCount) + { + return TupleU.Of(ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount)); + } + + #endregion + + #region Read7 + + /// + /// Читает 7 матриц типа Boolean?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadBooleanTuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount), ReadBoolean(rowsCount, colsCount)); + } + + /// + /// Читает 7 матриц типа Byte?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadByteTuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount), ReadByte(rowsCount, colsCount)); + } + + /// + /// Читает 7 матриц типа SByte?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadSByteTuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount), ReadSByte(rowsCount, colsCount)); + } + + /// + /// Читает 7 матриц типа Char?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadCharTuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount), ReadChar(rowsCount, colsCount)); + } + + /// + /// Читает 7 матриц типа Decimal?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadDecimalTuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount), ReadDecimal(rowsCount, colsCount)); + } + + /// + /// Читает 7 матриц типа Double?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadDoubleTuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount), ReadDouble(rowsCount, colsCount)); + } + + /// + /// Читает 7 матриц типа Single?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadSingleTuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount), ReadSingle(rowsCount, colsCount)); + } + + /// + /// Читает 7 матриц типа Int32?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt32Tuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount), ReadInt32(rowsCount, colsCount)); + } + + /// + /// Читает 7 матриц типа UInt32?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt32Tuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount), ReadUInt32(rowsCount, colsCount)); + } + + /// + /// Читает 7 матриц типа Int64?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt64Tuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount), ReadInt64(rowsCount, colsCount)); + } + + /// + /// Читает 7 матриц типа UInt64?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt64Tuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount), ReadUInt64(rowsCount, colsCount)); + } + + /// + /// Читает 7 матриц типа Int16?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadInt16Tuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount), ReadInt16(rowsCount, colsCount)); + } + + /// + /// Читает 7 матриц типа UInt16?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadUInt16Tuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount), ReadUInt16(rowsCount, colsCount)); + } + + /// + /// Читает 7 матриц типа BigInteger?. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] + /// + /// Количество строк. + /// Количество столбцов. + /// Кортеж. + public static Tuple ReadBigIntegerTuple7(int rowsCount, int colsCount) + { + return TupleU.Of(ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount), ReadBigInteger(rowsCount, colsCount)); + } + + #endregion + + #endregion + + } + } +} diff --git a/NETMouse - .NET release/Utils/Matrix.cs b/NETMouse - .NET release/Utils/MatrixU.cs similarity index 100% rename from NETMouse - .NET release/Utils/Matrix.cs rename to NETMouse - .NET release/Utils/MatrixU.cs diff --git a/NETMouse - .NET release/Utils/Sequence.Generators.cs b/NETMouse - .NET release/Utils/SequenceU.Generators.cs similarity index 93% rename from NETMouse - .NET release/Utils/Sequence.Generators.cs rename to NETMouse - .NET release/Utils/SequenceU.Generators.cs index 0d0a25a..8e9db82 100644 --- a/NETMouse - .NET release/Utils/Sequence.Generators.cs +++ b/NETMouse - .NET release/Utils/SequenceU.Generators.cs @@ -6,9 +6,11 @@ namespace ABCNET.Utils /// /// . /// - public static partial class Sequence + public static partial class SequenceU { + #region public + /// /// . /// @@ -42,11 +44,11 @@ public static IEnumerable Random(int count, int low = Int32BordersHelper.Lo throw new ArgumentException(nameof(low)); for (int i = 0; i < count; i++) - yield return Base.Random(low, high); + yield return BaseU.Random(low, high); } /// - /// Real. + /// Double. /// /// . /// . @@ -60,7 +62,7 @@ public static IEnumerable Random(int count, double low = DoubleBordersHe throw new ArgumentException(nameof(low)); for (int i = 0; i < count; i++) - yield return Base.Random(low, high); + yield return BaseU.Random(low, high); } /// @@ -77,6 +79,8 @@ public static IEnumerable Fill(int count, T value) for (int i = 0; i < count; i++) yield return value; } + #endregion public + } } \ No newline at end of file diff --git a/NETMouse - .NET release/Utils/SequenceU.Input.cs b/NETMouse - .NET release/Utils/SequenceU.Input.cs new file mode 100644 index 0000000..b2e33f2 --- /dev/null +++ b/NETMouse - .NET release/Utils/SequenceU.Input.cs @@ -0,0 +1,1516 @@ +using System; +using System.Collections.Generic; +using System.Numerics; + +namespace ABCNET.Utils +{ + /// + /// Предоставляет функционал для работы с последовательностями. + /// + public static partial class Sequence + { + + #region public + + #region one-sequence + + /// + /// Читает последовательность типа Boolean с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadBoolean(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.ReadBoolean(count, prompt); + } + + /// + /// Читает последовательность типа Byte с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadByte(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.ReadByte(count, prompt); + } + + /// + /// Читает последовательность типа SByte с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadSByte(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.ReadSByte(count, prompt); + } + + /// + /// Читает последовательность типа Char с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadChar(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.ReadChar(count, prompt); + } + + /// + /// Читает последовательность типа Decimal с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadDecimal(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.ReadDecimal(count, prompt); + } + + /// + /// Читает последовательность типа Double с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadDouble(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.ReadDouble(count, prompt); + } + + /// + /// Читает последовательность типа Single с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadSingle(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.ReadSingle(count, prompt); + } + + /// + /// Читает последовательность типа Int32 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadInt32(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.ReadInt32(count, prompt); + } + + /// + /// Читает последовательность типа UInt32 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadUInt32(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.ReadUInt32(count, prompt); + } + + /// + /// Читает последовательность типа Int64 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadInt64(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.ReadInt64(count, prompt); + } + + /// + /// Читает последовательность типа UInt64 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadUInt64(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.ReadUInt64(count, prompt); + } + + /// + /// Читает последовательность типа Int16 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadInt16(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.ReadInt16(count, prompt); + } + + /// + /// Читает последовательность типа UInt16 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadUInt16(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.ReadUInt16(count, prompt); + } + + /// + /// Читает последовательность типа BigInteger с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadBigInteger(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.ReadBigInteger(count, prompt); + } + + /// + /// Читает последовательность типа String с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadString(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.ReadString(count, prompt); + } + + #endregion one-sequence + + #region two-sequences + + /// + /// Читает 2 последовательности типа Boolean с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadBooleanTuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadBoolean(count, prompt), ReadBoolean(count, prompt)); + } + + /// + /// Читает 2 последовательности типа Byte с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadByteTuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadByte(count, prompt), ReadByte(count, prompt)); + } + + /// + /// Читает 2 последовательности типа SByte с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadSByteTuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadSByte(count, prompt), ReadSByte(count, prompt)); + } + + /// + /// Читает 2 последовательности типа Char с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadCharTuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadChar(count, prompt), ReadChar(count, prompt)); + } + + /// + /// Читает 2 последовательности типа Decimal с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadDecimalTuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadDecimal(count, prompt), ReadDecimal(count, prompt)); + } + + /// + /// Читает 2 последовательности типа Double с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadDoubleTuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadDouble(count, prompt), ReadDouble(count, prompt)); + } + + /// + /// Читает 2 последовательности типа Single с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadSingleTuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadSingle(count, prompt), ReadSingle(count, prompt)); + } + + /// + /// Читает 2 последовательности типа Int32 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadInt32Tuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt32(count, prompt), ReadInt32(count, prompt)); + } + + /// + /// Читает 2 последовательности типа UInt32 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadUInt32Tuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt32(count, prompt), ReadUInt32(count, prompt)); + } + + /// + /// Читает 2 последовательности типа Int64 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadInt64Tuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt64(count, prompt), ReadInt64(count, prompt)); + } + + /// + /// Читает 2 последовательности типа UInt64 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadUInt64Tuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt64(count, prompt), ReadUInt64(count, prompt)); + } + + /// + /// Читает 2 последовательности типа Int16 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadInt16Tuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt16(count, prompt), ReadInt16(count, prompt)); + } + + /// + /// Читает 2 последовательности типа UInt16 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadUInt16Tuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt16(count, prompt), ReadUInt16(count, prompt)); + } + + /// + /// Читает 2 последовательности типа BigInteger с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadBigIntegerTuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadBigInteger(count, prompt), ReadBigInteger(count, prompt)); + } + + /// + /// Читает 2 последовательности типа String с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadStringTuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadString(count, prompt), ReadString(count, prompt)); + } + + #endregion two-sequences + + #region three-sequences + + /// + /// Читает 3 последовательности типа Boolean с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadBooleanTuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt)); + } + + /// + /// Читает 3 последовательности типа Byte с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadByteTuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt)); + } + + /// + /// Читает 3 последовательности типа SByte с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadSByteTuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt)); + } + + /// + /// Читает 3 последовательности типа Char с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadCharTuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt)); + } + + /// + /// Читает 3 последовательности типа Decimal с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadDecimalTuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt)); + } + + /// + /// Читает 3 последовательности типа Double с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadDoubleTuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt)); + } + + /// + /// Читает 3 последовательности типа Single с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadSingleTuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt)); + } + + /// + /// Читает 3 последовательности типа Int32 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadInt32Tuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt)); + } + + /// + /// Читает 3 последовательности типа UInt32 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadUInt32Tuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt)); + } + + /// + /// Читает 3 последовательности типа Int64 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadInt64Tuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt)); + } + + /// + /// Читает 3 последовательности типа UInt64 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadUInt64Tuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt)); + } + + /// + /// Читает 3 последовательности типа Int16 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadInt16Tuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt)); + } + + /// + /// Читает 3 последовательности типа UInt16 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadUInt16Tuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt)); + } + + /// + /// Читает 3 последовательности типа BigInteger с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadBigIntegerTuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt)); + } + + /// + /// Читает 3 последовательности типа String с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadStringTuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadString(count, prompt), ReadString(count, prompt), ReadString(count, prompt)); + } + + #endregion three-sequences + + #region four-sequences + + /// + /// Читает 4 последовательности типа Boolean с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadBooleanTuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt)); + } + + /// + /// Читает 4 последовательности типа Byte с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadByteTuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt)); + } + + /// + /// Читает 4 последовательности типа SByte с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadSByteTuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt)); + } + + /// + /// Читает 4 последовательности типа Char с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadCharTuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt)); + } + + /// + /// Читает 4 последовательности типа Decimal с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadDecimalTuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt)); + } + + /// + /// Читает 4 последовательности типа Double с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadDoubleTuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt)); + } + + /// + /// Читает 4 последовательности типа Single с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadSingleTuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt)); + } + + /// + /// Читает 4 последовательности типа Int32 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadInt32Tuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt)); + } + + /// + /// Читает 4 последовательности типа UInt32 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadUInt32Tuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt)); + } + + /// + /// Читает 4 последовательности типа Int64 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadInt64Tuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt)); + } + + /// + /// Читает 4 последовательности типа UInt64 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadUInt64Tuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt)); + } + + /// + /// Читает 4 последовательности типа Int16 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadInt16Tuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt)); + } + + /// + /// Читает 4 последовательности типа UInt16 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadUInt16Tuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt)); + } + + /// + /// Читает 4 последовательности типа BigInteger с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadBigIntegerTuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt)); + } + + /// + /// Читает 4 последовательности типа String с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadStringTuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadString(count, prompt), ReadString(count, prompt), ReadString(count, prompt), ReadString(count, prompt)); + } + + #endregion four-sequences + + #region five-sequences + + /// + /// Читает 5 последовательностей типа Boolean с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadBooleanTuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt)); + } + + /// + /// Читает 5 последовательностей типа Byte с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadByteTuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt)); + } + + /// + /// Читает 5 последовательностей типа SByte с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadSByteTuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt)); + } + + /// + /// Читает 5 последовательностей типа Char с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadCharTuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt)); + } + + /// + /// Читает 5 последовательностей типа Decimal с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadDecimalTuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt)); + } + + /// + /// Читает 5 последовательностей типа Double с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadDoubleTuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt)); + } + + /// + /// Читает 5 последовательностей типа Single с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadSingleTuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt)); + } + + /// + /// Читает 5 последовательностей типа Int32 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadInt32Tuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt)); + } + + /// + /// Читает 5 последовательностей типа UInt32 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadUInt32Tuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt)); + } + + /// + /// Читает 5 последовательностей типа Int64 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadInt64Tuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt)); + } + + /// + /// Читает 5 последовательностей типа UInt64 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadUInt64Tuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt)); + } + + /// + /// Читает 5 последовательностей типа Int16 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadInt16Tuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt)); + } + + /// + /// Читает 5 последовательностей типа UInt16 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadUInt16Tuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt)); + } + + /// + /// Читает 5 последовательностей типа BigInteger с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadBigIntegerTuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt)); + } + + /// + /// Читает 5 последовательностей типа String с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadStringTuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadString(count, prompt), ReadString(count, prompt), ReadString(count, prompt), ReadString(count, prompt), ReadString(count, prompt)); + } + + #endregion five-sequences + + #region six-sequences + + /// + /// Читает 6 последовательностей типа Boolean с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadBooleanTuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt)); + } + + /// + /// Читает 6 последовательностей типа Byte с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadByteTuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt)); + } + + /// + /// Читает 6 последовательностей типа SByte с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadSByteTuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt)); + } + + /// + /// Читает 6 последовательностей типа Char с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadCharTuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt)); + } + + /// + /// Читает 6 последовательностей типа Decimal с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadDecimalTuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt)); + } + + /// + /// Читает 6 последовательностей типа Double с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadDoubleTuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt)); + } + + /// + /// Читает 6 последовательностей типа Single с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadSingleTuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt)); + } + + /// + /// Читает 6 последовательностей типа Int32 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadInt32Tuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt)); + } + + /// + /// Читает 6 последовательностей типа UInt32 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadUInt32Tuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt)); + } + + /// + /// Читает 6 последовательностей типа Int64 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadInt64Tuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt)); + } + + /// + /// Читает 6 последовательностей типа UInt64 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadUInt64Tuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt)); + } + + /// + /// Читает 6 последовательностей типа Int16 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadInt16Tuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt)); + } + + /// + /// Читает 6 последовательностей типа UInt16 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadUInt16Tuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt)); + } + + /// + /// Читает 6 последовательностей типа BigInteger с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadBigIntegerTuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt)); + } + + /// + /// Читает 6 последовательностей типа String с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadStringTuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadString(count, prompt), ReadString(count, prompt), ReadString(count, prompt), ReadString(count, prompt), ReadString(count, prompt), ReadString(count, prompt)); + } + + #endregion six-sequences + + #region seven-sequences + + /// + /// Читает 7 последовательностей типа Boolean с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadBooleanTuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt)); + } + + /// + /// Читает 7 последовательностей типа Byte с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadByteTuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt)); + } + + /// + /// Читает 7 последовательностей типа SByte с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadSByteTuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt)); + } + + /// + /// Читает 7 последовательностей типа Char с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadCharTuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt)); + } + + /// + /// Читает 7 последовательностей типа Decimal с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadDecimalTuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt)); + } + + /// + /// Читает 7 последовательностей типа Double с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadDoubleTuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt)); + } + + /// + /// Читает 7 последовательностей типа Single с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadSingleTuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt)); + } + + /// + /// Читает 7 последовательностей типа Int32 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadInt32Tuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt)); + } + + /// + /// Читает 7 последовательностей типа UInt32 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadUInt32Tuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt)); + } + + /// + /// Читает 7 последовательностей типа Int64 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadInt64Tuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt)); + } + + /// + /// Читает 7 последовательностей типа UInt64 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadUInt64Tuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt)); + } + + /// + /// Читает 7 последовательностей типа Int16 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadInt16Tuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt)); + } + + /// + /// Читает 7 последовательностей типа UInt16 с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadUInt16Tuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt)); + } + + /// + /// Читает 7 последовательностей типа BigInteger с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadBigIntegerTuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt)); + } + + /// + /// Читает 7 последовательностей типа String с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadStringTuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadString(count, prompt), ReadString(count, prompt), ReadString(count, prompt), ReadString(count, prompt), ReadString(count, prompt), ReadString(count, prompt), ReadString(count, prompt)); + } + + #endregion seven-sequences + + #endregion public + + } +} diff --git a/NETMouse - .NET release/Utils/SequenceU.Nullable.Input.cs b/NETMouse - .NET release/Utils/SequenceU.Nullable.Input.cs new file mode 100644 index 0000000..952edda --- /dev/null +++ b/NETMouse - .NET release/Utils/SequenceU.Nullable.Input.cs @@ -0,0 +1,1424 @@ +using System; +using System.Collections.Generic; +using System.Numerics; + +namespace ABCNET.Utils +{ + /// + /// Предоставляет функционал для работы с последовательностями. + /// + public static partial class Sequence + { + /// + /// Предоставляет функционал для работы с Nullable типами. + /// + public static partial class Nullable + { + + #region public + + #region one-sequence + + /// + /// Читает последовательность типа Boolean? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadBoolean(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.Nullable.ReadBoolean(count, prompt); + } + + /// + /// Читает последовательность типа Byte? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadByte(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.Nullable.ReadByte(count, prompt); + } + + /// + /// Читает последовательность типа SByte? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadSByte(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.Nullable.ReadSByte(count, prompt); + } + + /// + /// Читает последовательность типа Char? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadChar(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.Nullable.ReadChar(count, prompt); + } + + /// + /// Читает последовательность типа Decimal? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadDecimal(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.Nullable.ReadDecimal(count, prompt); + } + + /// + /// Читает последовательность типа Double? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadDouble(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.Nullable.ReadDouble(count, prompt); + } + + /// + /// Читает последовательность типа Single? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadSingle(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.Nullable.ReadSingle(count, prompt); + } + + /// + /// Читает последовательность типа Int32? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadInt32(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.Nullable.ReadInt32(count, prompt); + } + + /// + /// Читает последовательность типа UInt32? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadUInt32(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.Nullable.ReadUInt32(count, prompt); + } + + /// + /// Читает последовательность типа Int64? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadInt64(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.Nullable.ReadInt64(count, prompt); + } + + /// + /// Читает последовательность типа UInt64? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadUInt64(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.Nullable.ReadUInt64(count, prompt); + } + + /// + /// Читает последовательность типа Int16? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadInt16(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.Nullable.ReadInt16(count, prompt); + } + + /// + /// Читает последовательность типа UInt16? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadUInt16(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.Nullable.ReadUInt16(count, prompt); + } + + /// + /// Читает последовательность типа BigInteger? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Последовательность. + public static IEnumerable ReadBigInteger(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return ArrayU.Nullable.ReadBigInteger(count, prompt); + } + + #endregion one-sequence + + #region two-sequences + + /// + /// Читает 2 последовательности типа Boolean? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadBooleanTuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadBoolean(count, prompt), ReadBoolean(count, prompt)); + } + + /// + /// Читает 2 последовательности типа Byte? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadByteTuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadByte(count, prompt), ReadByte(count, prompt)); + } + + /// + /// Читает 2 последовательности типа SByte? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadSByteTuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadSByte(count, prompt), ReadSByte(count, prompt)); + } + + /// + /// Читает 2 последовательности типа Char? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadCharTuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadChar(count, prompt), ReadChar(count, prompt)); + } + + /// + /// Читает 2 последовательности типа Decimal? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadDecimalTuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadDecimal(count, prompt), ReadDecimal(count, prompt)); + } + + /// + /// Читает 2 последовательности типа Double? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadDoubleTuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadDouble(count, prompt), ReadDouble(count, prompt)); + } + + /// + /// Читает 2 последовательности типа Single? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadSingleTuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadSingle(count, prompt), ReadSingle(count, prompt)); + } + + /// + /// Читает 2 последовательности типа Int32? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadInt32Tuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt32(count, prompt), ReadInt32(count, prompt)); + } + + /// + /// Читает 2 последовательности типа UInt32? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadUInt32Tuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt32(count, prompt), ReadUInt32(count, prompt)); + } + + /// + /// Читает 2 последовательности типа Int64? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadInt64Tuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt64(count, prompt), ReadInt64(count, prompt)); + } + + /// + /// Читает 2 последовательности типа UInt64? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadUInt64Tuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt64(count, prompt), ReadUInt64(count, prompt)); + } + + /// + /// Читает 2 последовательности типа Int16? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadInt16Tuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt16(count, prompt), ReadInt16(count, prompt)); + } + + /// + /// Читает 2 последовательности типа UInt16? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadUInt16Tuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt16(count, prompt), ReadUInt16(count, prompt)); + } + + /// + /// Читает 2 последовательности типа BigInteger? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable> ReadBigIntegerTuple2(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadBigInteger(count, prompt), ReadBigInteger(count, prompt)); + } + + #endregion two-sequences + + #region three-sequences + + /// + /// Читает 3 последовательности типа Boolean? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadBooleanTuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt)); + } + + /// + /// Читает 3 последовательности типа Byte? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadByteTuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt)); + } + + /// + /// Читает 3 последовательности типа SByte? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadSByteTuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt)); + } + + /// + /// Читает 3 последовательности типа Char? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadCharTuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt)); + } + + /// + /// Читает 3 последовательности типа Decimal? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadDecimalTuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt)); + } + + /// + /// Читает 3 последовательности типа Double? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadDoubleTuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt)); + } + + /// + /// Читает 3 последовательности типа Single? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadSingleTuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt)); + } + + /// + /// Читает 3 последовательности типа Int32? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadInt32Tuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt)); + } + + /// + /// Читает 3 последовательности типа UInt32? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadUInt32Tuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt)); + } + + /// + /// Читает 3 последовательности типа Int64? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadInt64Tuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt)); + } + + /// + /// Читает 3 последовательности типа UInt64? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadUInt64Tuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt)); + } + + /// + /// Читает 3 последовательности типа Int16? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadInt16Tuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt)); + } + + /// + /// Читает 3 последовательности типа UInt16? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadUInt16Tuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt)); + } + + /// + /// Читает 3 последовательности типа BigInteger? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable> ReadBigIntegerTuple3(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt)); + } + + #endregion three-sequences + + #region four-sequences + + /// + /// Читает 4 последовательности типа Boolean? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadBooleanTuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt)); + } + + /// + /// Читает 4 последовательности типа Byte? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadByteTuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt)); + } + + /// + /// Читает 4 последовательности типа SByte? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadSByteTuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt)); + } + + /// + /// Читает 4 последовательности типа Char? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadCharTuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt)); + } + + /// + /// Читает 4 последовательности типа Decimal? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadDecimalTuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt)); + } + + /// + /// Читает 4 последовательности типа Double? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadDoubleTuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt)); + } + + /// + /// Читает 4 последовательности типа Single? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadSingleTuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt)); + } + + /// + /// Читает 4 последовательности типа Int32? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadInt32Tuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt)); + } + + /// + /// Читает 4 последовательности типа UInt32? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadUInt32Tuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt)); + } + + /// + /// Читает 4 последовательности типа Int64? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadInt64Tuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt)); + } + + /// + /// Читает 4 последовательности типа UInt64? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadUInt64Tuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt)); + } + + /// + /// Читает 4 последовательности типа Int16? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadInt16Tuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt)); + } + + /// + /// Читает 4 последовательности типа UInt16? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadUInt16Tuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt)); + } + + /// + /// Читает 4 последовательности типа BigInteger? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable> ReadBigIntegerTuple4(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt)); + } + + #endregion four-sequences + + #region five-sequences + + /// + /// Читает 5 последовательностей типа Boolean? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadBooleanTuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt)); + } + + /// + /// Читает 5 последовательностей типа Byte? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadByteTuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt)); + } + + /// + /// Читает 5 последовательностей типа SByte? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadSByteTuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt)); + } + + /// + /// Читает 5 последовательностей типа Char? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadCharTuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt)); + } + + /// + /// Читает 5 последовательностей типа Decimal? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadDecimalTuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt)); + } + + /// + /// Читает 5 последовательностей типа Double? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadDoubleTuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt)); + } + + /// + /// Читает 5 последовательностей типа Single? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadSingleTuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt)); + } + + /// + /// Читает 5 последовательностей типа Int32? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadInt32Tuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt)); + } + + /// + /// Читает 5 последовательностей типа UInt32? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadUInt32Tuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt)); + } + + /// + /// Читает 5 последовательностей типа Int64? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadInt64Tuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt)); + } + + /// + /// Читает 5 последовательностей типа UInt64? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadUInt64Tuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt)); + } + + /// + /// Читает 5 последовательностей типа Int16? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadInt16Tuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt)); + } + + /// + /// Читает 5 последовательностей типа UInt16? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadUInt16Tuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt)); + } + + /// + /// Читает 5 последовательностей типа BigInteger? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadBigIntegerTuple5(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt)); + } + + #endregion five-sequences + + #region six-sequences + + /// + /// Читает 6 последовательностей типа Boolean? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadBooleanTuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt)); + } + + /// + /// Читает 6 последовательностей типа Byte? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadByteTuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt)); + } + + /// + /// Читает 6 последовательностей типа SByte? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadSByteTuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt)); + } + + /// + /// Читает 6 последовательностей типа Char? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadCharTuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt)); + } + + /// + /// Читает 6 последовательностей типа Decimal? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadDecimalTuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt)); + } + + /// + /// Читает 6 последовательностей типа Double? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadDoubleTuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt)); + } + + /// + /// Читает 6 последовательностей типа Single? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadSingleTuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt)); + } + + /// + /// Читает 6 последовательностей типа Int32? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadInt32Tuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt)); + } + + /// + /// Читает 6 последовательностей типа UInt32? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadUInt32Tuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt)); + } + + /// + /// Читает 6 последовательностей типа Int64? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadInt64Tuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt)); + } + + /// + /// Читает 6 последовательностей типа UInt64? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadUInt64Tuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt)); + } + + /// + /// Читает 6 последовательностей типа Int16? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadInt16Tuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt)); + } + + /// + /// Читает 6 последовательностей типа UInt16? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadUInt16Tuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt)); + } + + /// + /// Читает 6 последовательностей типа BigInteger? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadBigIntegerTuple6(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt)); + } + + #endregion six-sequences + + #region seven-sequences + + /// + /// Читает 7 последовательностей типа Boolean? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadBooleanTuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt), ReadBoolean(count, prompt)); + } + + /// + /// Читает 7 последовательностей типа Byte? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadByteTuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt), ReadByte(count, prompt)); + } + + /// + /// Читает 7 последовательностей типа SByte? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadSByteTuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt), ReadSByte(count, prompt)); + } + + /// + /// Читает 7 последовательностей типа Char? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadCharTuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt), ReadChar(count, prompt)); + } + + /// + /// Читает 7 последовательностей типа Decimal? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadDecimalTuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt), ReadDecimal(count, prompt)); + } + + /// + /// Читает 7 последовательностей типа Double? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadDoubleTuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt), ReadDouble(count, prompt)); + } + + /// + /// Читает 7 последовательностей типа Single? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadSingleTuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt), ReadSingle(count, prompt)); + } + + /// + /// Читает 7 последовательностей типа Int32? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadInt32Tuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt), ReadInt32(count, prompt)); + } + + /// + /// Читает 7 последовательностей типа UInt32? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadUInt32Tuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt), ReadUInt32(count, prompt)); + } + + /// + /// Читает 7 последовательностей типа Int64? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadInt64Tuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt), ReadInt64(count, prompt)); + } + + /// + /// Читает 7 последовательностей типа UInt64? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadUInt64Tuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt), ReadUInt64(count, prompt)); + } + + /// + /// Читает 7 последовательностей типа Int16? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadInt16Tuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt), ReadInt16(count, prompt)); + } + + /// + /// Читает 7 последовательностей типа UInt16? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadUInt16Tuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt), ReadUInt16(count, prompt)); + } + + /// + /// Читает 7 последовательностей типа BigInteger? с клавиатуры. + /// + /// Количество элементов. + /// Приглашение к вводу. + /// Кортеж. + public static Tuple, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable, IEnumerable> ReadBigIntegerTuple7(int count, string prompt = EmptyStringHelper.Empty) + { + if (count < 0) + throw new ArgumentOutOfRangeException(nameof(count)); + + return TupleU.Of(ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt), ReadBigInteger(count, prompt)); + } + + #endregion seven-sequences + + #endregion public + + } + } +} diff --git a/NETMouse - .NET release/Utils/Sequence.cs b/NETMouse - .NET release/Utils/SequenceU.cs similarity index 100% rename from NETMouse - .NET release/Utils/Sequence.cs rename to NETMouse - .NET release/Utils/SequenceU.cs diff --git a/NETMouse - .NET release/Utils/Tuple.Input.cs b/NETMouse - .NET release/Utils/Tuple.Input.cs deleted file mode 100644 index 63ee316..0000000 --- a/NETMouse - .NET release/Utils/Tuple.Input.cs +++ /dev/null @@ -1,195 +0,0 @@ -using ABCNET.Extensions; -using System; - -namespace ABCNET.Utils -{ - /// - /// Предоставляет функционал для работы с ссылочными кортежами. - /// - public static partial class Tuple - { - #region public - /// - /// Читает кортеж из двух значений типа Boolean. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Кортеж. - public static Tuple ReadBooleanTuple2(string prompt = EmptyStringHelper.Empty) - { - bool a = default; - bool b = default; - - ReadBooleanTupleItem(ref a, 0, prompt); - ReadBooleanTupleItem(ref b, 1, prompt); - - return Of(a, b); - } - - /// - /// Читает кортеж из трёх значений типа Boolean. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Кортеж. - public static Tuple ReadBooleanTuple3(string prompt = EmptyStringHelper.Empty) - { - bool a = default; - bool b = default; - bool c = default; - - ReadBooleanTupleItem(ref a, 0, prompt); - ReadBooleanTupleItem(ref b, 1, prompt); - ReadBooleanTupleItem(ref c, 2, prompt); - - return Of(a, b, c); - } - - /// - /// Читает кортеж из двух значений типа Char. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Кортеж. - public static Tuple ReadCharTuple2(string prompt = EmptyStringHelper.Empty) - { - return Of(Base.ReadChar(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, 0)), - Base.ReadChar(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, 1))); - } - - /// - /// Читает кортеж из трёх значений типа Char. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Кортеж. - public static Tuple ReadCharTuple3(string prompt = EmptyStringHelper.Empty) - { - return Of(Base.ReadChar(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, 0)), - Base.ReadChar(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, 1)), - Base.ReadChar(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, 2))); - } - - /// - /// Читает кортеж из двух значений типа Double. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Кортеж. - public static Tuple ReadDoubleTuple2(string prompt = EmptyStringHelper.Empty) - { - double a = default; - double b = default; - - ReadRealTupleItem(ref a, 0, prompt); - ReadRealTupleItem(ref b, 1, prompt); - - return Of(a, b); - } - - /// - /// Читает кортеж из трёх значений типа Double. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Кортеж. - public static Tuple ReadDoubleTuple3(string prompt = EmptyStringHelper.Empty) - { - double a = default; - double b = default; - double c = default; - - ReadRealTupleItem(ref a, 0, prompt); - ReadRealTupleItem(ref b, 1, prompt); - ReadRealTupleItem(ref c, 2, prompt); - - return Of(a, b, c); - } - - /// - /// Читает кортеж из двух значений типа Int32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Кортеж. - public static Tuple ReadInt32Tuple2(string prompt = EmptyStringHelper.Empty) - { - int a = default; - int b = default; - - ReadIntegerTupleItem(ref a, 0, prompt); - ReadIntegerTupleItem(ref b, 1, prompt); - - return Of(a, b); - } - - /// - /// Читает кортеж из трёх значений типа Int32. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Кортеж. - public static Tuple ReadInt32Tuple3(string prompt = EmptyStringHelper.Empty) - { - int a = default; - int b = default; - int c = default; - - ReadIntegerTupleItem(ref a, 0, prompt); - ReadIntegerTupleItem(ref b, 1, prompt); - ReadIntegerTupleItem(ref c, 2, prompt); - - return Of(a, b, c); - } - - /// - /// Читает кортеж из двух значений типа String. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Кортеж. - public static Tuple ReadStringTuple2(string prompt = EmptyStringHelper.Empty) - { - return Of(Base.ReadString(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, 0)), - Base.ReadString(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, 1))); - } - - /// - /// Читает кортеж из трёх значений типа String. [Не работает при запуске из под оболочки в IDE PascalABC.NET.] - /// - /// Кортеж. - public static Tuple ReadStringTuple3(string prompt = EmptyStringHelper.Empty) - { - return Of(Base.ReadString(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, 0)), - Base.ReadString(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, 1)), - Base.ReadString(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, 2))); - } - #endregion public - - #region private - private static void ReadBooleanTupleItem(ref bool field, int index, string prompt) - { - while (true) - try - { - field = Base.ReadBoolean(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, index)); - return; - } - catch (Exception) - { - InputErrorHelper.Message.PrintLine(); - } - } - - private static void ReadIntegerTupleItem(ref int field, int index, string prompt) - { - while (true) - try - { - field = Base.ReadInt32(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, index)); - return; - } - catch (Exception) - { - InputErrorHelper.Message.PrintLine(); - } - } - - private static void ReadRealTupleItem(ref double field, int index, string prompt) - { - while (true) - try - { - field = Base.ReadDouble(prompt is null ? EmptyStringHelper.Empty : string.Format(prompt, index)); - return; - } - catch (Exception) - { - InputErrorHelper.Message.PrintLine(); - } - } - #endregion private - } -} diff --git a/NETMouse - .NET release/Utils/Tuple.Generators.cs b/NETMouse - .NET release/Utils/TupleU.Generators.cs similarity index 91% rename from NETMouse - .NET release/Utils/Tuple.Generators.cs rename to NETMouse - .NET release/Utils/TupleU.Generators.cs index d67a445..7edf15c 100644 --- a/NETMouse - .NET release/Utils/Tuple.Generators.cs +++ b/NETMouse - .NET release/Utils/TupleU.Generators.cs @@ -5,9 +5,11 @@ namespace ABCNET.Utils /// /// . /// - public static partial class Tuple + public static partial class TupleU { + #region public + /// /// 2 . /// @@ -302,7 +304,7 @@ public static Tuple By7(T first, Func next) /// . public static Tuple Random2(int low = Int32BordersHelper.Low, int high = Int32BordersHelper.High) { - return Of(Base.Random(low, high), Base.Random(low, high)); + return Of(BaseU.Random(low, high), BaseU.Random(low, high)); } /// @@ -313,7 +315,7 @@ public static Tuple Random2(int low = Int32BordersHelper.Low, int high /// . public static Tuple Random3(int low = Int32BordersHelper.Low, int high = Int32BordersHelper.High) { - return Of(Base.Random(low, high), Base.Random(low, high), Base.Random(low, high)); + return Of(BaseU.Random(low, high), BaseU.Random(low, high), BaseU.Random(low, high)); } /// @@ -324,8 +326,8 @@ public static Tuple Random3(int low = Int32BordersHelper.Low, int /// . public static Tuple Random4(int low = Int32BordersHelper.Low, int high = Int32BordersHelper.High) { - return Of(Base.Random(low, high), Base.Random(low, high), Base.Random(low, high), - Base.Random(low, high)); + return Of(BaseU.Random(low, high), BaseU.Random(low, high), BaseU.Random(low, high), + BaseU.Random(low, high)); } /// @@ -336,8 +338,8 @@ public static Tuple Random4(int low = Int32BordersHelper.Low /// . public static Tuple Random5(int low = Int32BordersHelper.Low, int high = Int32BordersHelper.High) { - return Of(Base.Random(low, high), Base.Random(low, high), Base.Random(low, high), - Base.Random(low, high), Base.Random(low, high)); + return Of(BaseU.Random(low, high), BaseU.Random(low, high), BaseU.Random(low, high), + BaseU.Random(low, high), BaseU.Random(low, high)); } /// @@ -348,8 +350,8 @@ public static Tuple Random5(int low = Int32BordersHelpe /// . public static Tuple Random6(int low = Int32BordersHelper.Low, int high = Int32BordersHelper.High) { - return Of(Base.Random(low, high), Base.Random(low, high), Base.Random(low, high), - Base.Random(low, high), Base.Random(low, high), Base.Random(low, high)); + return Of(BaseU.Random(low, high), BaseU.Random(low, high), BaseU.Random(low, high), + BaseU.Random(low, high), BaseU.Random(low, high), BaseU.Random(low, high)); } /// @@ -360,9 +362,9 @@ public static Tuple Random6(int low = Int32Borders /// . public static Tuple Random7(int low = Int32BordersHelper.Low, int high = Int32BordersHelper.High) { - return Of(Base.Random(low, high), Base.Random(low, high), Base.Random(low, high), - Base.Random(low, high), Base.Random(low, high), Base.Random(low, high), - Base.Random(low, high)); + return Of(BaseU.Random(low, high), BaseU.Random(low, high), BaseU.Random(low, high), + BaseU.Random(low, high), BaseU.Random(low, high), BaseU.Random(low, high), + BaseU.Random(low, high)); } /// @@ -373,7 +375,7 @@ public static Tuple Random7(int low = Int32Bo /// . public static Tuple Random2(double low = DoubleBordersHelper.Low, double high = DoubleBordersHelper.High) { - return Of(Base.Random(low, high), Base.Random(low, high)); + return Of(BaseU.Random(low, high), BaseU.Random(low, high)); } /// @@ -384,7 +386,7 @@ public static Tuple Random2(double low = DoubleBordersHelper.Low /// . public static Tuple Random3(double low = DoubleBordersHelper.Low, double high = DoubleBordersHelper.High) { - return Of(Base.Random(low, high), Base.Random(low, high), Base.Random(low, high)); + return Of(BaseU.Random(low, high), BaseU.Random(low, high), BaseU.Random(low, high)); } /// @@ -395,8 +397,8 @@ public static Tuple Random3(double low = DoubleBordersHe /// . public static Tuple Random4(double low = DoubleBordersHelper.Low, double high = DoubleBordersHelper.High) { - return Of(Base.Random(low, high), Base.Random(low, high), Base.Random(low, high), - Base.Random(low, high)); + return Of(BaseU.Random(low, high), BaseU.Random(low, high), BaseU.Random(low, high), + BaseU.Random(low, high)); } /// @@ -407,8 +409,8 @@ public static Tuple Random4(double low = DoubleB /// . public static Tuple Random5(double low = DoubleBordersHelper.Low, double high = DoubleBordersHelper.High) { - return Of(Base.Random(low, high), Base.Random(low, high), Base.Random(low, high), - Base.Random(low, high), Base.Random(low, high)); + return Of(BaseU.Random(low, high), BaseU.Random(low, high), BaseU.Random(low, high), + BaseU.Random(low, high), BaseU.Random(low, high)); } /// @@ -419,8 +421,8 @@ public static Tuple Random5(double low = /// . public static Tuple Random6(double low = DoubleBordersHelper.Low, double high = DoubleBordersHelper.High) { - return Of(Base.Random(low, high), Base.Random(low, high), Base.Random(low, high), - Base.Random(low, high), Base.Random(low, high), Base.Random(low, high)); + return Of(BaseU.Random(low, high), BaseU.Random(low, high), BaseU.Random(low, high), + BaseU.Random(low, high), BaseU.Random(low, high), BaseU.Random(low, high)); } /// @@ -431,9 +433,9 @@ public static Tuple Random6(doub /// . public static Tuple Random7(double low = DoubleBordersHelper.Low, double high = DoubleBordersHelper.High) { - return Of(Base.Random(low, high), Base.Random(low, high), Base.Random(low, high), - Base.Random(low, high), Base.Random(low, high), Base.Random(low, high), - Base.Random(low, high)); + return Of(BaseU.Random(low, high), BaseU.Random(low, high), BaseU.Random(low, high), + BaseU.Random(low, high), BaseU.Random(low, high), BaseU.Random(low, high), + BaseU.Random(low, high)); } /// @@ -500,6 +502,8 @@ public static Tuple Fill7(T value) value, value, value, value); } + #endregion public + } } \ No newline at end of file diff --git a/NETMouse - .NET release/Utils/TupleU.Input.cs b/NETMouse - .NET release/Utils/TupleU.Input.cs new file mode 100644 index 0000000..8b01f78 --- /dev/null +++ b/NETMouse - .NET release/Utils/TupleU.Input.cs @@ -0,0 +1,1322 @@ +using System; +using System.Numerics; + +namespace ABCNET.Utils +{ + /// + /// Предоставляет функционал для работы с ссылочными кортежами. + /// + public static partial class TupleU + { + + #region public + + /// + /// Читает кортеж из двух значений типа BigInteger. + /// + /// Кортеж. + public static Tuple ReadBigIntegerTuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadBigInteger(string.Format(prompt, 0)), + BaseU.ReadBigInteger(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа BigInteger. + /// + /// Кортеж. + public static Tuple ReadBigIntegerTuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadBigInteger(string.Format(prompt, 0)), + BaseU.ReadBigInteger(string.Format(prompt, 1)), + BaseU.ReadBigInteger(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа BigInteger. + /// + /// Кортеж. + public static Tuple ReadBigIntegerTuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadBigInteger(string.Format(prompt, 0)), + BaseU.ReadBigInteger(string.Format(prompt, 1)), + BaseU.ReadBigInteger(string.Format(prompt, 2)), + BaseU.ReadBigInteger(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа BigInteger. + /// + /// Кортеж. + public static Tuple ReadBigIntegerTuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadBigInteger(string.Format(prompt, 0)), + BaseU.ReadBigInteger(string.Format(prompt, 1)), + BaseU.ReadBigInteger(string.Format(prompt, 2)), + BaseU.ReadBigInteger(string.Format(prompt, 3)), + BaseU.ReadBigInteger(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа BigInteger. + /// + /// Кортеж. + public static Tuple ReadBigIntegerTuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadBigInteger(string.Format(prompt, 0)), + BaseU.ReadBigInteger(string.Format(prompt, 1)), + BaseU.ReadBigInteger(string.Format(prompt, 2)), + BaseU.ReadBigInteger(string.Format(prompt, 3)), + BaseU.ReadBigInteger(string.Format(prompt, 4)), + BaseU.ReadBigInteger(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа BigInteger. + /// + /// Кортеж. + public static Tuple ReadBigIntegerTuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadBigInteger(string.Format(prompt, 0)), + BaseU.ReadBigInteger(string.Format(prompt, 1)), + BaseU.ReadBigInteger(string.Format(prompt, 2)), + BaseU.ReadBigInteger(string.Format(prompt, 3)), + BaseU.ReadBigInteger(string.Format(prompt, 4)), + BaseU.ReadBigInteger(string.Format(prompt, 5)), + BaseU.ReadBigInteger(string.Format(prompt, 6))); + } + + /// + /// Читает кортеж из двух значений типа Boolean. + /// + /// Кортеж. + public static Tuple ReadBooleanTuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadBoolean(string.Format(prompt, 0)), + BaseU.ReadBoolean(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа Boolean. + /// + /// Кортеж. + public static Tuple ReadBooleanTuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadBoolean(string.Format(prompt, 0)), + BaseU.ReadBoolean(string.Format(prompt, 1)), + BaseU.ReadBoolean(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа Boolean. + /// + /// Кортеж. + public static Tuple ReadBooleanTuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadBoolean(string.Format(prompt, 0)), + BaseU.ReadBoolean(string.Format(prompt, 1)), + BaseU.ReadBoolean(string.Format(prompt, 2)), + BaseU.ReadBoolean(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа Boolean. + /// + /// Кортеж. + public static Tuple ReadBooleanTuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadBoolean(string.Format(prompt, 0)), + BaseU.ReadBoolean(string.Format(prompt, 1)), + BaseU.ReadBoolean(string.Format(prompt, 2)), + BaseU.ReadBoolean(string.Format(prompt, 3)), + BaseU.ReadBoolean(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа Boolean. + /// + /// Кортеж. + public static Tuple ReadBooleanTuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadBoolean(string.Format(prompt, 0)), + BaseU.ReadBoolean(string.Format(prompt, 1)), + BaseU.ReadBoolean(string.Format(prompt, 2)), + BaseU.ReadBoolean(string.Format(prompt, 3)), + BaseU.ReadBoolean(string.Format(prompt, 4)), + BaseU.ReadBoolean(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа Boolean. + /// + /// Кортеж. + public static Tuple ReadBooleanTuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadBoolean(string.Format(prompt, 0)), + BaseU.ReadBoolean(string.Format(prompt, 1)), + BaseU.ReadBoolean(string.Format(prompt, 2)), + BaseU.ReadBoolean(string.Format(prompt, 3)), + BaseU.ReadBoolean(string.Format(prompt, 4)), + BaseU.ReadBoolean(string.Format(prompt, 5)), + BaseU.ReadBoolean(string.Format(prompt, 6))); + } + + /// + /// Читает кортеж из двух значений типа Byte. + /// + /// Кортеж. + public static Tuple ReadByteTuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadByte(string.Format(prompt, 0)), + BaseU.ReadByte(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа Byte. + /// + /// Кортеж. + public static Tuple ReadByteTuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadByte(string.Format(prompt, 0)), + BaseU.ReadByte(string.Format(prompt, 1)), + BaseU.ReadByte(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа Byte. + /// + /// Кортеж. + public static Tuple ReadByteTuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadByte(string.Format(prompt, 0)), + BaseU.ReadByte(string.Format(prompt, 1)), + BaseU.ReadByte(string.Format(prompt, 2)), + BaseU.ReadByte(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа Byte. + /// + /// Кортеж. + public static Tuple ReadByteTuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadByte(string.Format(prompt, 0)), + BaseU.ReadByte(string.Format(prompt, 1)), + BaseU.ReadByte(string.Format(prompt, 2)), + BaseU.ReadByte(string.Format(prompt, 3)), + BaseU.ReadByte(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа Byte. + /// + /// Кортеж. + public static Tuple ReadByteTuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadByte(string.Format(prompt, 0)), + BaseU.ReadByte(string.Format(prompt, 1)), + BaseU.ReadByte(string.Format(prompt, 2)), + BaseU.ReadByte(string.Format(prompt, 3)), + BaseU.ReadByte(string.Format(prompt, 4)), + BaseU.ReadByte(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа Byte. + /// + /// Кортеж. + public static Tuple ReadByteTuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadByte(string.Format(prompt, 0)), + BaseU.ReadByte(string.Format(prompt, 1)), + BaseU.ReadByte(string.Format(prompt, 2)), + BaseU.ReadByte(string.Format(prompt, 3)), + BaseU.ReadByte(string.Format(prompt, 4)), + BaseU.ReadByte(string.Format(prompt, 5)), + BaseU.ReadByte(string.Format(prompt, 6))); + } + + /// + /// Читает кортеж из двух значений типа Char. + /// + /// Кортеж. + public static Tuple ReadCharTuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadChar(string.Format(prompt, 0)), + BaseU.ReadChar(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа Char. + /// + /// Кортеж. + public static Tuple ReadCharTuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadChar(string.Format(prompt, 0)), + BaseU.ReadChar(string.Format(prompt, 1)), + BaseU.ReadChar(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа Char. + /// + /// Кортеж. + public static Tuple ReadCharTuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadChar(string.Format(prompt, 0)), + BaseU.ReadChar(string.Format(prompt, 1)), + BaseU.ReadChar(string.Format(prompt, 2)), + BaseU.ReadChar(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа Char. + /// + /// Кортеж. + public static Tuple ReadCharTuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadChar(string.Format(prompt, 0)), + BaseU.ReadChar(string.Format(prompt, 1)), + BaseU.ReadChar(string.Format(prompt, 2)), + BaseU.ReadChar(string.Format(prompt, 3)), + BaseU.ReadChar(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа Char. + /// + /// Кортеж. + public static Tuple ReadCharTuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadChar(string.Format(prompt, 0)), + BaseU.ReadChar(string.Format(prompt, 1)), + BaseU.ReadChar(string.Format(prompt, 2)), + BaseU.ReadChar(string.Format(prompt, 3)), + BaseU.ReadChar(string.Format(prompt, 4)), + BaseU.ReadChar(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа Char. + /// + /// Кортеж. + public static Tuple ReadCharTuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadChar(string.Format(prompt, 0)), + BaseU.ReadChar(string.Format(prompt, 1)), + BaseU.ReadChar(string.Format(prompt, 2)), + BaseU.ReadChar(string.Format(prompt, 3)), + BaseU.ReadChar(string.Format(prompt, 4)), + BaseU.ReadChar(string.Format(prompt, 5)), + BaseU.ReadChar(string.Format(prompt, 6))); + } + + /// + /// Читает кортеж из двух значений типа Decimal. + /// + /// Кортеж. + public static Tuple ReadDecimalTuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadDecimal(string.Format(prompt, 0)), + BaseU.ReadDecimal(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа Decimal. + /// + /// Кортеж. + public static Tuple ReadDecimalTuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadDecimal(string.Format(prompt, 0)), + BaseU.ReadDecimal(string.Format(prompt, 1)), + BaseU.ReadDecimal(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа Decimal. + /// + /// Кортеж. + public static Tuple ReadDecimalTuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadDecimal(string.Format(prompt, 0)), + BaseU.ReadDecimal(string.Format(prompt, 1)), + BaseU.ReadDecimal(string.Format(prompt, 2)), + BaseU.ReadDecimal(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа Decimal. + /// + /// Кортеж. + public static Tuple ReadDecimalTuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadDecimal(string.Format(prompt, 0)), + BaseU.ReadDecimal(string.Format(prompt, 1)), + BaseU.ReadDecimal(string.Format(prompt, 2)), + BaseU.ReadDecimal(string.Format(prompt, 3)), + BaseU.ReadDecimal(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа Decimal. + /// + /// Кортеж. + public static Tuple ReadDecimalTuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadDecimal(string.Format(prompt, 0)), + BaseU.ReadDecimal(string.Format(prompt, 1)), + BaseU.ReadDecimal(string.Format(prompt, 2)), + BaseU.ReadDecimal(string.Format(prompt, 3)), + BaseU.ReadDecimal(string.Format(prompt, 4)), + BaseU.ReadDecimal(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа Decimal. + /// + /// Кортеж. + public static Tuple ReadDecimalTuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadDecimal(string.Format(prompt, 0)), + BaseU.ReadDecimal(string.Format(prompt, 1)), + BaseU.ReadDecimal(string.Format(prompt, 2)), + BaseU.ReadDecimal(string.Format(prompt, 3)), + BaseU.ReadDecimal(string.Format(prompt, 4)), + BaseU.ReadDecimal(string.Format(prompt, 5)), + BaseU.ReadDecimal(string.Format(prompt, 6))); + } + + /// + /// Читает кортеж из двух значений типа Double. + /// + /// Кортеж. + public static Tuple ReadDoubleTuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadDouble(string.Format(prompt, 0)), + BaseU.ReadDouble(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа Double. + /// + /// Кортеж. + public static Tuple ReadDoubleTuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadDouble(string.Format(prompt, 0)), + BaseU.ReadDouble(string.Format(prompt, 1)), + BaseU.ReadDouble(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа Double. + /// + /// Кортеж. + public static Tuple ReadDoubleTuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadDouble(string.Format(prompt, 0)), + BaseU.ReadDouble(string.Format(prompt, 1)), + BaseU.ReadDouble(string.Format(prompt, 2)), + BaseU.ReadDouble(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа Double. + /// + /// Кортеж. + public static Tuple ReadDoubleTuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadDouble(string.Format(prompt, 0)), + BaseU.ReadDouble(string.Format(prompt, 1)), + BaseU.ReadDouble(string.Format(prompt, 2)), + BaseU.ReadDouble(string.Format(prompt, 3)), + BaseU.ReadDouble(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа Double. + /// + /// Кортеж. + public static Tuple ReadDoubleTuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadDouble(string.Format(prompt, 0)), + BaseU.ReadDouble(string.Format(prompt, 1)), + BaseU.ReadDouble(string.Format(prompt, 2)), + BaseU.ReadDouble(string.Format(prompt, 3)), + BaseU.ReadDouble(string.Format(prompt, 4)), + BaseU.ReadDouble(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа Double. + /// + /// Кортеж. + public static Tuple ReadDoubleTuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadDouble(string.Format(prompt, 0)), + BaseU.ReadDouble(string.Format(prompt, 1)), + BaseU.ReadDouble(string.Format(prompt, 2)), + BaseU.ReadDouble(string.Format(prompt, 3)), + BaseU.ReadDouble(string.Format(prompt, 4)), + BaseU.ReadDouble(string.Format(prompt, 5)), + BaseU.ReadDouble(string.Format(prompt, 6))); + } + + /// + /// Читает кортеж из двух значений типа Int16. + /// + /// Кортеж. + public static Tuple ReadInt16Tuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadInt16(string.Format(prompt, 0)), + BaseU.ReadInt16(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа Int16. + /// + /// Кортеж. + public static Tuple ReadInt16Tuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadInt16(string.Format(prompt, 0)), + BaseU.ReadInt16(string.Format(prompt, 1)), + BaseU.ReadInt16(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа Int16. + /// + /// Кортеж. + public static Tuple ReadInt16Tuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadInt16(string.Format(prompt, 0)), + BaseU.ReadInt16(string.Format(prompt, 1)), + BaseU.ReadInt16(string.Format(prompt, 2)), + BaseU.ReadInt16(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа Int16. + /// + /// Кортеж. + public static Tuple ReadInt16Tuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadInt16(string.Format(prompt, 0)), + BaseU.ReadInt16(string.Format(prompt, 1)), + BaseU.ReadInt16(string.Format(prompt, 2)), + BaseU.ReadInt16(string.Format(prompt, 3)), + BaseU.ReadInt16(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа Int16. + /// + /// Кортеж. + public static Tuple ReadInt16Tuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadInt16(string.Format(prompt, 0)), + BaseU.ReadInt16(string.Format(prompt, 1)), + BaseU.ReadInt16(string.Format(prompt, 2)), + BaseU.ReadInt16(string.Format(prompt, 3)), + BaseU.ReadInt16(string.Format(prompt, 4)), + BaseU.ReadInt16(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа Int16. + /// + /// Кортеж. + public static Tuple ReadInt16Tuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadInt16(string.Format(prompt, 0)), + BaseU.ReadInt16(string.Format(prompt, 1)), + BaseU.ReadInt16(string.Format(prompt, 2)), + BaseU.ReadInt16(string.Format(prompt, 3)), + BaseU.ReadInt16(string.Format(prompt, 4)), + BaseU.ReadInt16(string.Format(prompt, 5)), + BaseU.ReadInt16(string.Format(prompt, 6))); + } + + /// + /// Читает кортеж из двух значений типа Int32. + /// + /// Кортеж. + public static Tuple ReadInt32Tuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadInt32(string.Format(prompt, 0)), + BaseU.ReadInt32(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа Int32. + /// + /// Кортеж. + public static Tuple ReadInt32Tuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadInt32(string.Format(prompt, 0)), + BaseU.ReadInt32(string.Format(prompt, 1)), + BaseU.ReadInt32(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа Int32. + /// + /// Кортеж. + public static Tuple ReadInt32Tuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadInt32(string.Format(prompt, 0)), + BaseU.ReadInt32(string.Format(prompt, 1)), + BaseU.ReadInt32(string.Format(prompt, 2)), + BaseU.ReadInt32(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа Int32. + /// + /// Кортеж. + public static Tuple ReadInt32Tuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadInt32(string.Format(prompt, 0)), + BaseU.ReadInt32(string.Format(prompt, 1)), + BaseU.ReadInt32(string.Format(prompt, 2)), + BaseU.ReadInt32(string.Format(prompt, 3)), + BaseU.ReadInt32(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа Int32. + /// + /// Кортеж. + public static Tuple ReadInt32Tuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadInt32(string.Format(prompt, 0)), + BaseU.ReadInt32(string.Format(prompt, 1)), + BaseU.ReadInt32(string.Format(prompt, 2)), + BaseU.ReadInt32(string.Format(prompt, 3)), + BaseU.ReadInt32(string.Format(prompt, 4)), + BaseU.ReadInt32(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа Int32. + /// + /// Кортеж. + public static Tuple ReadInt32Tuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadInt32(string.Format(prompt, 0)), + BaseU.ReadInt32(string.Format(prompt, 1)), + BaseU.ReadInt32(string.Format(prompt, 2)), + BaseU.ReadInt32(string.Format(prompt, 3)), + BaseU.ReadInt32(string.Format(prompt, 4)), + BaseU.ReadInt32(string.Format(prompt, 5)), + BaseU.ReadInt32(string.Format(prompt, 6))); + } + + /// + /// Читает кортеж из двух значений типа Int64. + /// + /// Кортеж. + public static Tuple ReadInt64Tuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadInt64(string.Format(prompt, 0)), + BaseU.ReadInt64(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа Int64. + /// + /// Кортеж. + public static Tuple ReadInt64Tuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadInt64(string.Format(prompt, 0)), + BaseU.ReadInt64(string.Format(prompt, 1)), + BaseU.ReadInt64(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа Int64. + /// + /// Кортеж. + public static Tuple ReadInt64Tuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadInt64(string.Format(prompt, 0)), + BaseU.ReadInt64(string.Format(prompt, 1)), + BaseU.ReadInt64(string.Format(prompt, 2)), + BaseU.ReadInt64(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа Int64. + /// + /// Кортеж. + public static Tuple ReadInt64Tuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadInt64(string.Format(prompt, 0)), + BaseU.ReadInt64(string.Format(prompt, 1)), + BaseU.ReadInt64(string.Format(prompt, 2)), + BaseU.ReadInt64(string.Format(prompt, 3)), + BaseU.ReadInt64(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа Int64. + /// + /// Кортеж. + public static Tuple ReadInt64Tuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadInt64(string.Format(prompt, 0)), + BaseU.ReadInt64(string.Format(prompt, 1)), + BaseU.ReadInt64(string.Format(prompt, 2)), + BaseU.ReadInt64(string.Format(prompt, 3)), + BaseU.ReadInt64(string.Format(prompt, 4)), + BaseU.ReadInt64(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа Int64. + /// + /// Кортеж. + public static Tuple ReadInt64Tuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadInt64(string.Format(prompt, 0)), + BaseU.ReadInt64(string.Format(prompt, 1)), + BaseU.ReadInt64(string.Format(prompt, 2)), + BaseU.ReadInt64(string.Format(prompt, 3)), + BaseU.ReadInt64(string.Format(prompt, 4)), + BaseU.ReadInt64(string.Format(prompt, 5)), + BaseU.ReadInt64(string.Format(prompt, 6))); + } + + /// + /// Читает кортеж из двух значений типа SByte. + /// + /// Кортеж. + public static Tuple ReadSByteTuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadSByte(string.Format(prompt, 0)), + BaseU.ReadSByte(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа SByte. + /// + /// Кортеж. + public static Tuple ReadSByteTuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadSByte(string.Format(prompt, 0)), + BaseU.ReadSByte(string.Format(prompt, 1)), + BaseU.ReadSByte(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа SByte. + /// + /// Кортеж. + public static Tuple ReadSByteTuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadSByte(string.Format(prompt, 0)), + BaseU.ReadSByte(string.Format(prompt, 1)), + BaseU.ReadSByte(string.Format(prompt, 2)), + BaseU.ReadSByte(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа SByte. + /// + /// Кортеж. + public static Tuple ReadSByteTuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadSByte(string.Format(prompt, 0)), + BaseU.ReadSByte(string.Format(prompt, 1)), + BaseU.ReadSByte(string.Format(prompt, 2)), + BaseU.ReadSByte(string.Format(prompt, 3)), + BaseU.ReadSByte(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа SByte. + /// + /// Кортеж. + public static Tuple ReadSByteTuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadSByte(string.Format(prompt, 0)), + BaseU.ReadSByte(string.Format(prompt, 1)), + BaseU.ReadSByte(string.Format(prompt, 2)), + BaseU.ReadSByte(string.Format(prompt, 3)), + BaseU.ReadSByte(string.Format(prompt, 4)), + BaseU.ReadSByte(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа SByte. + /// + /// Кортеж. + public static Tuple ReadSByteTuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadSByte(string.Format(prompt, 0)), + BaseU.ReadSByte(string.Format(prompt, 1)), + BaseU.ReadSByte(string.Format(prompt, 2)), + BaseU.ReadSByte(string.Format(prompt, 3)), + BaseU.ReadSByte(string.Format(prompt, 4)), + BaseU.ReadSByte(string.Format(prompt, 5)), + BaseU.ReadSByte(string.Format(prompt, 6))); + } + + /// + /// Читает кортеж из двух значений типа Single. + /// + /// Кортеж. + public static Tuple ReadSingleTuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadSingle(string.Format(prompt, 0)), + BaseU.ReadSingle(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа Single. + /// + /// Кортеж. + public static Tuple ReadSingleTuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadSingle(string.Format(prompt, 0)), + BaseU.ReadSingle(string.Format(prompt, 1)), + BaseU.ReadSingle(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа Single. + /// + /// Кортеж. + public static Tuple ReadSingleTuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadSingle(string.Format(prompt, 0)), + BaseU.ReadSingle(string.Format(prompt, 1)), + BaseU.ReadSingle(string.Format(prompt, 2)), + BaseU.ReadSingle(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа Single. + /// + /// Кортеж. + public static Tuple ReadSingleTuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadSingle(string.Format(prompt, 0)), + BaseU.ReadSingle(string.Format(prompt, 1)), + BaseU.ReadSingle(string.Format(prompt, 2)), + BaseU.ReadSingle(string.Format(prompt, 3)), + BaseU.ReadSingle(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа Single. + /// + /// Кортеж. + public static Tuple ReadSingleTuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadSingle(string.Format(prompt, 0)), + BaseU.ReadSingle(string.Format(prompt, 1)), + BaseU.ReadSingle(string.Format(prompt, 2)), + BaseU.ReadSingle(string.Format(prompt, 3)), + BaseU.ReadSingle(string.Format(prompt, 4)), + BaseU.ReadSingle(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа Single. + /// + /// Кортеж. + public static Tuple ReadSingleTuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadSingle(string.Format(prompt, 0)), + BaseU.ReadSingle(string.Format(prompt, 1)), + BaseU.ReadSingle(string.Format(prompt, 2)), + BaseU.ReadSingle(string.Format(prompt, 3)), + BaseU.ReadSingle(string.Format(prompt, 4)), + BaseU.ReadSingle(string.Format(prompt, 5)), + BaseU.ReadSingle(string.Format(prompt, 6))); + } + + /// + /// Читает кортеж из двух значений типа String. + /// + /// Кортеж. + public static Tuple ReadStringTuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadString(string.Format(prompt, 0)), + BaseU.ReadString(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа String. + /// + /// Кортеж. + public static Tuple ReadStringTuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadString(string.Format(prompt, 0)), + BaseU.ReadString(string.Format(prompt, 1)), + BaseU.ReadString(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа String. + /// + /// Кортеж. + public static Tuple ReadStringTuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadString(string.Format(prompt, 0)), + BaseU.ReadString(string.Format(prompt, 1)), + BaseU.ReadString(string.Format(prompt, 2)), + BaseU.ReadString(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа String. + /// + /// Кортеж. + public static Tuple ReadStringTuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadString(string.Format(prompt, 0)), + BaseU.ReadString(string.Format(prompt, 1)), + BaseU.ReadString(string.Format(prompt, 2)), + BaseU.ReadString(string.Format(prompt, 3)), + BaseU.ReadString(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа String. + /// + /// Кортеж. + public static Tuple ReadStringTuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadString(string.Format(prompt, 0)), + BaseU.ReadString(string.Format(prompt, 1)), + BaseU.ReadString(string.Format(prompt, 2)), + BaseU.ReadString(string.Format(prompt, 3)), + BaseU.ReadString(string.Format(prompt, 4)), + BaseU.ReadString(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа String. + /// + /// Кортеж. + public static Tuple ReadStringTuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadString(string.Format(prompt, 0)), + BaseU.ReadString(string.Format(prompt, 1)), + BaseU.ReadString(string.Format(prompt, 2)), + BaseU.ReadString(string.Format(prompt, 3)), + BaseU.ReadString(string.Format(prompt, 4)), + BaseU.ReadString(string.Format(prompt, 5)), + BaseU.ReadString(string.Format(prompt, 6))); + } + + /// + /// Читает кортеж из двух значений типа UInt16. + /// + /// Кортеж. + public static Tuple ReadUInt16Tuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadUInt16(string.Format(prompt, 0)), + BaseU.ReadUInt16(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа UInt16. + /// + /// Кортеж. + public static Tuple ReadUInt16Tuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadUInt16(string.Format(prompt, 0)), + BaseU.ReadUInt16(string.Format(prompt, 1)), + BaseU.ReadUInt16(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа UInt16. + /// + /// Кортеж. + public static Tuple ReadUInt16Tuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadUInt16(string.Format(prompt, 0)), + BaseU.ReadUInt16(string.Format(prompt, 1)), + BaseU.ReadUInt16(string.Format(prompt, 2)), + BaseU.ReadUInt16(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа UInt16. + /// + /// Кортеж. + public static Tuple ReadUInt16Tuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadUInt16(string.Format(prompt, 0)), + BaseU.ReadUInt16(string.Format(prompt, 1)), + BaseU.ReadUInt16(string.Format(prompt, 2)), + BaseU.ReadUInt16(string.Format(prompt, 3)), + BaseU.ReadUInt16(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа UInt16. + /// + /// Кортеж. + public static Tuple ReadUInt16Tuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadUInt16(string.Format(prompt, 0)), + BaseU.ReadUInt16(string.Format(prompt, 1)), + BaseU.ReadUInt16(string.Format(prompt, 2)), + BaseU.ReadUInt16(string.Format(prompt, 3)), + BaseU.ReadUInt16(string.Format(prompt, 4)), + BaseU.ReadUInt16(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа UInt16. + /// + /// Кортеж. + public static Tuple ReadUInt16Tuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadUInt16(string.Format(prompt, 0)), + BaseU.ReadUInt16(string.Format(prompt, 1)), + BaseU.ReadUInt16(string.Format(prompt, 2)), + BaseU.ReadUInt16(string.Format(prompt, 3)), + BaseU.ReadUInt16(string.Format(prompt, 4)), + BaseU.ReadUInt16(string.Format(prompt, 5)), + BaseU.ReadUInt16(string.Format(prompt, 6))); + } + + /// + /// Читает кортеж из двух значений типа UInt32. + /// + /// Кортеж. + public static Tuple ReadUInt32Tuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadUInt32(string.Format(prompt, 0)), + BaseU.ReadUInt32(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа UInt32. + /// + /// Кортеж. + public static Tuple ReadUInt32Tuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadUInt32(string.Format(prompt, 0)), + BaseU.ReadUInt32(string.Format(prompt, 1)), + BaseU.ReadUInt32(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа UInt32. + /// + /// Кортеж. + public static Tuple ReadUInt32Tuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadUInt32(string.Format(prompt, 0)), + BaseU.ReadUInt32(string.Format(prompt, 1)), + BaseU.ReadUInt32(string.Format(prompt, 2)), + BaseU.ReadUInt32(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа UInt32. + /// + /// Кортеж. + public static Tuple ReadUInt32Tuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadUInt32(string.Format(prompt, 0)), + BaseU.ReadUInt32(string.Format(prompt, 1)), + BaseU.ReadUInt32(string.Format(prompt, 2)), + BaseU.ReadUInt32(string.Format(prompt, 3)), + BaseU.ReadUInt32(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа UInt32. + /// + /// Кортеж. + public static Tuple ReadUInt32Tuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadUInt32(string.Format(prompt, 0)), + BaseU.ReadUInt32(string.Format(prompt, 1)), + BaseU.ReadUInt32(string.Format(prompt, 2)), + BaseU.ReadUInt32(string.Format(prompt, 3)), + BaseU.ReadUInt32(string.Format(prompt, 4)), + BaseU.ReadUInt32(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа UInt32. + /// + /// Кортеж. + public static Tuple ReadUInt32Tuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadUInt32(string.Format(prompt, 0)), + BaseU.ReadUInt32(string.Format(prompt, 1)), + BaseU.ReadUInt32(string.Format(prompt, 2)), + BaseU.ReadUInt32(string.Format(prompt, 3)), + BaseU.ReadUInt32(string.Format(prompt, 4)), + BaseU.ReadUInt32(string.Format(prompt, 5)), + BaseU.ReadUInt32(string.Format(prompt, 6))); + } + + /// + /// Читает кортеж из двух значений типа UInt64. + /// + /// Кортеж. + public static Tuple ReadUInt64Tuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadUInt64(string.Format(prompt, 0)), + BaseU.ReadUInt64(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа UInt64. + /// + /// Кортеж. + public static Tuple ReadUInt64Tuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadUInt64(string.Format(prompt, 0)), + BaseU.ReadUInt64(string.Format(prompt, 1)), + BaseU.ReadUInt64(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа UInt64. + /// + /// Кортеж. + public static Tuple ReadUInt64Tuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadUInt64(string.Format(prompt, 0)), + BaseU.ReadUInt64(string.Format(prompt, 1)), + BaseU.ReadUInt64(string.Format(prompt, 2)), + BaseU.ReadUInt64(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа UInt64. + /// + /// Кортеж. + public static Tuple ReadUInt64Tuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadUInt64(string.Format(prompt, 0)), + BaseU.ReadUInt64(string.Format(prompt, 1)), + BaseU.ReadUInt64(string.Format(prompt, 2)), + BaseU.ReadUInt64(string.Format(prompt, 3)), + BaseU.ReadUInt64(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа UInt64. + /// + /// Кортеж. + public static Tuple ReadUInt64Tuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadUInt64(string.Format(prompt, 0)), + BaseU.ReadUInt64(string.Format(prompt, 1)), + BaseU.ReadUInt64(string.Format(prompt, 2)), + BaseU.ReadUInt64(string.Format(prompt, 3)), + BaseU.ReadUInt64(string.Format(prompt, 4)), + BaseU.ReadUInt64(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа UInt64. + /// + /// Кортеж. + public static Tuple ReadUInt64Tuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return Of(BaseU.ReadUInt64(string.Format(prompt, 0)), + BaseU.ReadUInt64(string.Format(prompt, 1)), + BaseU.ReadUInt64(string.Format(prompt, 2)), + BaseU.ReadUInt64(string.Format(prompt, 3)), + BaseU.ReadUInt64(string.Format(prompt, 4)), + BaseU.ReadUInt64(string.Format(prompt, 5)), + BaseU.ReadUInt64(string.Format(prompt, 6))); + } + + #endregion public + + } +} \ No newline at end of file diff --git a/NETMouse - .NET release/Utils/TupleU.Nullable.Input.cs b/NETMouse - .NET release/Utils/TupleU.Nullable.Input.cs new file mode 100644 index 0000000..cb4e887 --- /dev/null +++ b/NETMouse - .NET release/Utils/TupleU.Nullable.Input.cs @@ -0,0 +1,1297 @@ +using System; +using System.Numerics; + +namespace ABCNET.Utils +{ + /// + /// Предоставляет функционал для работы с ссылочными кортежами. + /// + public static partial class Tuple + { + /// + /// Предоставляет функционал для работы с Nullable типами. + /// + public static partial class Nullable + { + + #region public + + #region ReadBigInteger? + + /// + /// Читает кортеж из двух значений типа BigInteger?. + /// + /// Кортеж. + public static Tuple ReadBigIntegerTuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadBigInteger(string.Format(prompt, 0)), + BaseU.Nullable.ReadBigInteger(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа BigInteger?. + /// + /// Кортеж. + public static Tuple ReadBigIntegerTuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadBigInteger(string.Format(prompt, 0)), + BaseU.Nullable.ReadBigInteger(string.Format(prompt, 1)), + BaseU.Nullable.ReadBigInteger(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа BigInteger?. + /// + /// Кортеж. + public static Tuple ReadBigIntegerTuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadBigInteger(string.Format(prompt, 0)), + BaseU.Nullable.ReadBigInteger(string.Format(prompt, 1)), + BaseU.Nullable.ReadBigInteger(string.Format(prompt, 2)), + BaseU.Nullable.ReadBigInteger(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа BigInteger?. + /// + /// Кортеж. + public static Tuple ReadBigIntegerTuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadBigInteger(string.Format(prompt, 0)), + BaseU.Nullable.ReadBigInteger(string.Format(prompt, 1)), + BaseU.Nullable.ReadBigInteger(string.Format(prompt, 2)), + BaseU.Nullable.ReadBigInteger(string.Format(prompt, 3)), + BaseU.Nullable.ReadBigInteger(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа BigInteger?. + /// + /// Кортеж. + public static Tuple ReadBigIntegerTuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadBigInteger(string.Format(prompt, 0)), + BaseU.Nullable.ReadBigInteger(string.Format(prompt, 1)), + BaseU.Nullable.ReadBigInteger(string.Format(prompt, 2)), + BaseU.Nullable.ReadBigInteger(string.Format(prompt, 3)), + BaseU.Nullable.ReadBigInteger(string.Format(prompt, 4)), + BaseU.Nullable.ReadBigInteger(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа BigInteger?. + /// + /// Кортеж. + public static Tuple ReadBigIntegerTuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadBigInteger(string.Format(prompt, 0)), + BaseU.Nullable.ReadBigInteger(string.Format(prompt, 1)), + BaseU.Nullable.ReadBigInteger(string.Format(prompt, 2)), + BaseU.Nullable.ReadBigInteger(string.Format(prompt, 3)), + BaseU.Nullable.ReadBigInteger(string.Format(prompt, 4)), + BaseU.Nullable.ReadBigInteger(string.Format(prompt, 5)), + BaseU.Nullable.ReadBigInteger(string.Format(prompt, 6))); + } + + #endregion + + #region ReadBoolean? + + /// + /// Читает кортеж из двух значений типа Boolean?. + /// + /// Кортеж. + public static Tuple ReadBooleanTuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadBoolean(string.Format(prompt, 0)), + BaseU.Nullable.ReadBoolean(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа Boolean?. + /// + /// Кортеж. + public static Tuple ReadBooleanTuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadBoolean(string.Format(prompt, 0)), + BaseU.Nullable.ReadBoolean(string.Format(prompt, 1)), + BaseU.Nullable.ReadBoolean(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа Boolean?. + /// + /// Кортеж. + public static Tuple ReadBooleanTuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadBoolean(string.Format(prompt, 0)), + BaseU.Nullable.ReadBoolean(string.Format(prompt, 1)), + BaseU.Nullable.ReadBoolean(string.Format(prompt, 2)), + BaseU.Nullable.ReadBoolean(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа Boolean?. + /// + /// Кортеж. + public static Tuple ReadBooleanTuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadBoolean(string.Format(prompt, 0)), + BaseU.Nullable.ReadBoolean(string.Format(prompt, 1)), + BaseU.Nullable.ReadBoolean(string.Format(prompt, 2)), + BaseU.Nullable.ReadBoolean(string.Format(prompt, 3)), + BaseU.Nullable.ReadBoolean(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа Boolean?. + /// + /// Кортеж. + public static Tuple ReadBooleanTuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadBoolean(string.Format(prompt, 0)), + BaseU.Nullable.ReadBoolean(string.Format(prompt, 1)), + BaseU.Nullable.ReadBoolean(string.Format(prompt, 2)), + BaseU.Nullable.ReadBoolean(string.Format(prompt, 3)), + BaseU.Nullable.ReadBoolean(string.Format(prompt, 4)), + BaseU.Nullable.ReadBoolean(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа Boolean?. + /// + /// Кортеж. + public static Tuple ReadBooleanTuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadBoolean(string.Format(prompt, 0)), + BaseU.Nullable.ReadBoolean(string.Format(prompt, 1)), + BaseU.Nullable.ReadBoolean(string.Format(prompt, 2)), + BaseU.Nullable.ReadBoolean(string.Format(prompt, 3)), + BaseU.Nullable.ReadBoolean(string.Format(prompt, 4)), + BaseU.Nullable.ReadBoolean(string.Format(prompt, 5)), + BaseU.Nullable.ReadBoolean(string.Format(prompt, 6))); + } + + #endregion + + #region ReadByte? + + /// + /// Читает кортеж из двух значений типа Byte?. + /// + /// Кортеж. + public static Tuple ReadByteTuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadByte(string.Format(prompt, 0)), + BaseU.Nullable.ReadByte(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа Byte?. + /// + /// Кортеж. + public static Tuple ReadByteTuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadByte(string.Format(prompt, 0)), + BaseU.Nullable.ReadByte(string.Format(prompt, 1)), + BaseU.Nullable.ReadByte(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа Byte?. + /// + /// Кортеж. + public static Tuple ReadByteTuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadByte(string.Format(prompt, 0)), + BaseU.Nullable.ReadByte(string.Format(prompt, 1)), + BaseU.Nullable.ReadByte(string.Format(prompt, 2)), + BaseU.Nullable.ReadByte(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа Byte?. + /// + /// Кортеж. + public static Tuple ReadByteTuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadByte(string.Format(prompt, 0)), + BaseU.Nullable.ReadByte(string.Format(prompt, 1)), + BaseU.Nullable.ReadByte(string.Format(prompt, 2)), + BaseU.Nullable.ReadByte(string.Format(prompt, 3)), + BaseU.Nullable.ReadByte(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа Byte?. + /// + /// Кортеж. + public static Tuple ReadByteTuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadByte(string.Format(prompt, 0)), + BaseU.Nullable.ReadByte(string.Format(prompt, 1)), + BaseU.Nullable.ReadByte(string.Format(prompt, 2)), + BaseU.Nullable.ReadByte(string.Format(prompt, 3)), + BaseU.Nullable.ReadByte(string.Format(prompt, 4)), + BaseU.Nullable.ReadByte(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа Byte?. + /// + /// Кортеж. + public static Tuple ReadByteTuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadByte(string.Format(prompt, 0)), + BaseU.Nullable.ReadByte(string.Format(prompt, 1)), + BaseU.Nullable.ReadByte(string.Format(prompt, 2)), + BaseU.Nullable.ReadByte(string.Format(prompt, 3)), + BaseU.Nullable.ReadByte(string.Format(prompt, 4)), + BaseU.Nullable.ReadByte(string.Format(prompt, 5)), + BaseU.Nullable.ReadByte(string.Format(prompt, 6))); + } + + #endregion + + #region ReadChar? + + /// + /// Читает кортеж из двух значений типа Char?. + /// + /// Кортеж. + public static Tuple ReadCharTuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadChar(string.Format(prompt, 0)), + BaseU.Nullable.ReadChar(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа Char?. + /// + /// Кортеж. + public static Tuple ReadCharTuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadChar(string.Format(prompt, 0)), + BaseU.Nullable.ReadChar(string.Format(prompt, 1)), + BaseU.Nullable.ReadChar(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа Char?. + /// + /// Кортеж. + public static Tuple ReadCharTuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadChar(string.Format(prompt, 0)), + BaseU.Nullable.ReadChar(string.Format(prompt, 1)), + BaseU.Nullable.ReadChar(string.Format(prompt, 2)), + BaseU.Nullable.ReadChar(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа Char?. + /// + /// Кортеж. + public static Tuple ReadCharTuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadChar(string.Format(prompt, 0)), + BaseU.Nullable.ReadChar(string.Format(prompt, 1)), + BaseU.Nullable.ReadChar(string.Format(prompt, 2)), + BaseU.Nullable.ReadChar(string.Format(prompt, 3)), + BaseU.Nullable.ReadChar(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа Char?. + /// + /// Кортеж. + public static Tuple ReadCharTuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadChar(string.Format(prompt, 0)), + BaseU.Nullable.ReadChar(string.Format(prompt, 1)), + BaseU.Nullable.ReadChar(string.Format(prompt, 2)), + BaseU.Nullable.ReadChar(string.Format(prompt, 3)), + BaseU.Nullable.ReadChar(string.Format(prompt, 4)), + BaseU.Nullable.ReadChar(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа Char?. + /// + /// Кортеж. + public static Tuple ReadCharTuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadChar(string.Format(prompt, 0)), + BaseU.Nullable.ReadChar(string.Format(prompt, 1)), + BaseU.Nullable.ReadChar(string.Format(prompt, 2)), + BaseU.Nullable.ReadChar(string.Format(prompt, 3)), + BaseU.Nullable.ReadChar(string.Format(prompt, 4)), + BaseU.Nullable.ReadChar(string.Format(prompt, 5)), + BaseU.Nullable.ReadChar(string.Format(prompt, 6))); + } + + #endregion + + #region ReadDecimal? + + /// + /// Читает кортеж из двух значений типа Decimal?. + /// + /// Кортеж. + public static Tuple ReadDecimalTuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadDecimal(string.Format(prompt, 0)), + BaseU.Nullable.ReadDecimal(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа Decimal?. + /// + /// Кортеж. + public static Tuple ReadDecimalTuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadDecimal(string.Format(prompt, 0)), + BaseU.Nullable.ReadDecimal(string.Format(prompt, 1)), + BaseU.Nullable.ReadDecimal(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа Decimal?. + /// + /// Кортеж. + public static Tuple ReadDecimalTuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadDecimal(string.Format(prompt, 0)), + BaseU.Nullable.ReadDecimal(string.Format(prompt, 1)), + BaseU.Nullable.ReadDecimal(string.Format(prompt, 2)), + BaseU.Nullable.ReadDecimal(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа Decimal?. + /// + /// Кортеж. + public static Tuple ReadDecimalTuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadDecimal(string.Format(prompt, 0)), + BaseU.Nullable.ReadDecimal(string.Format(prompt, 1)), + BaseU.Nullable.ReadDecimal(string.Format(prompt, 2)), + BaseU.Nullable.ReadDecimal(string.Format(prompt, 3)), + BaseU.Nullable.ReadDecimal(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа Decimal?. + /// + /// Кортеж. + public static Tuple ReadDecimalTuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadDecimal(string.Format(prompt, 0)), + BaseU.Nullable.ReadDecimal(string.Format(prompt, 1)), + BaseU.Nullable.ReadDecimal(string.Format(prompt, 2)), + BaseU.Nullable.ReadDecimal(string.Format(prompt, 3)), + BaseU.Nullable.ReadDecimal(string.Format(prompt, 4)), + BaseU.Nullable.ReadDecimal(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа Decimal?. + /// + /// Кортеж. + public static Tuple ReadDecimalTuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadDecimal(string.Format(prompt, 0)), + BaseU.Nullable.ReadDecimal(string.Format(prompt, 1)), + BaseU.Nullable.ReadDecimal(string.Format(prompt, 2)), + BaseU.Nullable.ReadDecimal(string.Format(prompt, 3)), + BaseU.Nullable.ReadDecimal(string.Format(prompt, 4)), + BaseU.Nullable.ReadDecimal(string.Format(prompt, 5)), + BaseU.Nullable.ReadDecimal(string.Format(prompt, 6))); + } + + #endregion + + #region ReadDouble? + + /// + /// Читает кортеж из двух значений типа Double?. + /// + /// Кортеж. + public static Tuple ReadDoubleTuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadDouble(string.Format(prompt, 0)), + BaseU.Nullable.ReadDouble(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа Double?. + /// + /// Кортеж. + public static Tuple ReadDoubleTuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadDouble(string.Format(prompt, 0)), + BaseU.Nullable.ReadDouble(string.Format(prompt, 1)), + BaseU.Nullable.ReadDouble(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа Double?. + /// + /// Кортеж. + public static Tuple ReadDoubleTuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadDouble(string.Format(prompt, 0)), + BaseU.Nullable.ReadDouble(string.Format(prompt, 1)), + BaseU.Nullable.ReadDouble(string.Format(prompt, 2)), + BaseU.Nullable.ReadDouble(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа Double?. + /// + /// Кортеж. + public static Tuple ReadDoubleTuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadDouble(string.Format(prompt, 0)), + BaseU.Nullable.ReadDouble(string.Format(prompt, 1)), + BaseU.Nullable.ReadDouble(string.Format(prompt, 2)), + BaseU.Nullable.ReadDouble(string.Format(prompt, 3)), + BaseU.Nullable.ReadDouble(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа Double?. + /// + /// Кортеж. + public static Tuple ReadDoubleTuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadDouble(string.Format(prompt, 0)), + BaseU.Nullable.ReadDouble(string.Format(prompt, 1)), + BaseU.Nullable.ReadDouble(string.Format(prompt, 2)), + BaseU.Nullable.ReadDouble(string.Format(prompt, 3)), + BaseU.Nullable.ReadDouble(string.Format(prompt, 4)), + BaseU.Nullable.ReadDouble(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа Double?. + /// + /// Кортеж. + public static Tuple ReadDoubleTuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadDouble(string.Format(prompt, 0)), + BaseU.Nullable.ReadDouble(string.Format(prompt, 1)), + BaseU.Nullable.ReadDouble(string.Format(prompt, 2)), + BaseU.Nullable.ReadDouble(string.Format(prompt, 3)), + BaseU.Nullable.ReadDouble(string.Format(prompt, 4)), + BaseU.Nullable.ReadDouble(string.Format(prompt, 5)), + BaseU.Nullable.ReadDouble(string.Format(prompt, 6))); + } + + #endregion + + #region ReadInt16? + + /// + /// Читает кортеж из двух значений типа Int16?. + /// + /// Кортеж. + public static Tuple ReadInt16Tuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadInt16(string.Format(prompt, 0)), + BaseU.Nullable.ReadInt16(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа Int16?. + /// + /// Кортеж. + public static Tuple ReadInt16Tuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadInt16(string.Format(prompt, 0)), + BaseU.Nullable.ReadInt16(string.Format(prompt, 1)), + BaseU.Nullable.ReadInt16(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа Int16?. + /// + /// Кортеж. + public static Tuple ReadInt16Tuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadInt16(string.Format(prompt, 0)), + BaseU.Nullable.ReadInt16(string.Format(prompt, 1)), + BaseU.Nullable.ReadInt16(string.Format(prompt, 2)), + BaseU.Nullable.ReadInt16(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа Int16?. + /// + /// Кортеж. + public static Tuple ReadInt16Tuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadInt16(string.Format(prompt, 0)), + BaseU.Nullable.ReadInt16(string.Format(prompt, 1)), + BaseU.Nullable.ReadInt16(string.Format(prompt, 2)), + BaseU.Nullable.ReadInt16(string.Format(prompt, 3)), + BaseU.Nullable.ReadInt16(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа Int16?. + /// + /// Кортеж. + public static Tuple ReadInt16Tuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadInt16(string.Format(prompt, 0)), + BaseU.Nullable.ReadInt16(string.Format(prompt, 1)), + BaseU.Nullable.ReadInt16(string.Format(prompt, 2)), + BaseU.Nullable.ReadInt16(string.Format(prompt, 3)), + BaseU.Nullable.ReadInt16(string.Format(prompt, 4)), + BaseU.Nullable.ReadInt16(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа Int16?. + /// + /// Кортеж. + public static Tuple ReadInt16Tuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadInt16(string.Format(prompt, 0)), + BaseU.Nullable.ReadInt16(string.Format(prompt, 1)), + BaseU.Nullable.ReadInt16(string.Format(prompt, 2)), + BaseU.Nullable.ReadInt16(string.Format(prompt, 3)), + BaseU.Nullable.ReadInt16(string.Format(prompt, 4)), + BaseU.Nullable.ReadInt16(string.Format(prompt, 5)), + BaseU.Nullable.ReadInt16(string.Format(prompt, 6))); + } + + #endregion + + #region ReadInt32? + + /// + /// Читает кортеж из двух значений типа Int32?. + /// + /// Кортеж. + public static Tuple ReadInt32Tuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadInt32(string.Format(prompt, 0)), + BaseU.Nullable.ReadInt32(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа Int32?. + /// + /// Кортеж. + public static Tuple ReadInt32Tuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadInt32(string.Format(prompt, 0)), + BaseU.Nullable.ReadInt32(string.Format(prompt, 1)), + BaseU.Nullable.ReadInt32(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа Int32?. + /// + /// Кортеж. + public static Tuple ReadInt32Tuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadInt32(string.Format(prompt, 0)), + BaseU.Nullable.ReadInt32(string.Format(prompt, 1)), + BaseU.Nullable.ReadInt32(string.Format(prompt, 2)), + BaseU.Nullable.ReadInt32(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа Int32?. + /// + /// Кортеж. + public static Tuple ReadInt32Tuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadInt32(string.Format(prompt, 0)), + BaseU.Nullable.ReadInt32(string.Format(prompt, 1)), + BaseU.Nullable.ReadInt32(string.Format(prompt, 2)), + BaseU.Nullable.ReadInt32(string.Format(prompt, 3)), + BaseU.Nullable.ReadInt32(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа Int32?. + /// + /// Кортеж. + public static Tuple ReadInt32Tuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadInt32(string.Format(prompt, 0)), + BaseU.Nullable.ReadInt32(string.Format(prompt, 1)), + BaseU.Nullable.ReadInt32(string.Format(prompt, 2)), + BaseU.Nullable.ReadInt32(string.Format(prompt, 3)), + BaseU.Nullable.ReadInt32(string.Format(prompt, 4)), + BaseU.Nullable.ReadInt32(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа Int32?. + /// + /// Кортеж. + public static Tuple ReadInt32Tuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadInt32(string.Format(prompt, 0)), + BaseU.Nullable.ReadInt32(string.Format(prompt, 1)), + BaseU.Nullable.ReadInt32(string.Format(prompt, 2)), + BaseU.Nullable.ReadInt32(string.Format(prompt, 3)), + BaseU.Nullable.ReadInt32(string.Format(prompt, 4)), + BaseU.Nullable.ReadInt32(string.Format(prompt, 5)), + BaseU.Nullable.ReadInt32(string.Format(prompt, 6))); + } + + #endregion + + #region ReadInt64? + + /// + /// Читает кортеж из двух значений типа Int64?. + /// + /// Кортеж. + public static Tuple ReadInt64Tuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadInt64(string.Format(prompt, 0)), + BaseU.Nullable.ReadInt64(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа Int64?. + /// + /// Кортеж. + public static Tuple ReadInt64Tuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadInt64(string.Format(prompt, 0)), + BaseU.Nullable.ReadInt64(string.Format(prompt, 1)), + BaseU.Nullable.ReadInt64(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа Int64?. + /// + /// Кортеж. + public static Tuple ReadInt64Tuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadInt64(string.Format(prompt, 0)), + BaseU.Nullable.ReadInt64(string.Format(prompt, 1)), + BaseU.Nullable.ReadInt64(string.Format(prompt, 2)), + BaseU.Nullable.ReadInt64(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа Int64?. + /// + /// Кортеж. + public static Tuple ReadInt64Tuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadInt64(string.Format(prompt, 0)), + BaseU.Nullable.ReadInt64(string.Format(prompt, 1)), + BaseU.Nullable.ReadInt64(string.Format(prompt, 2)), + BaseU.Nullable.ReadInt64(string.Format(prompt, 3)), + BaseU.Nullable.ReadInt64(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа Int64?. + /// + /// Кортеж. + public static Tuple ReadInt64Tuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadInt64(string.Format(prompt, 0)), + BaseU.Nullable.ReadInt64(string.Format(prompt, 1)), + BaseU.Nullable.ReadInt64(string.Format(prompt, 2)), + BaseU.Nullable.ReadInt64(string.Format(prompt, 3)), + BaseU.Nullable.ReadInt64(string.Format(prompt, 4)), + BaseU.Nullable.ReadInt64(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа Int64?. + /// + /// Кортеж. + public static Tuple ReadInt64Tuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadInt64(string.Format(prompt, 0)), + BaseU.Nullable.ReadInt64(string.Format(prompt, 1)), + BaseU.Nullable.ReadInt64(string.Format(prompt, 2)), + BaseU.Nullable.ReadInt64(string.Format(prompt, 3)), + BaseU.Nullable.ReadInt64(string.Format(prompt, 4)), + BaseU.Nullable.ReadInt64(string.Format(prompt, 5)), + BaseU.Nullable.ReadInt64(string.Format(prompt, 6))); + } + + #endregion + + #region ReadSByte? + + /// + /// Читает кортеж из двух значений типа SByte?. + /// + /// Кортеж. + public static Tuple ReadSByteTuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadSByte(string.Format(prompt, 0)), + BaseU.Nullable.ReadSByte(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа SByte?. + /// + /// Кортеж. + public static Tuple ReadSByteTuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadSByte(string.Format(prompt, 0)), + BaseU.Nullable.ReadSByte(string.Format(prompt, 1)), + BaseU.Nullable.ReadSByte(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа SByte?. + /// + /// Кортеж. + public static Tuple ReadSByteTuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadSByte(string.Format(prompt, 0)), + BaseU.Nullable.ReadSByte(string.Format(prompt, 1)), + BaseU.Nullable.ReadSByte(string.Format(prompt, 2)), + BaseU.Nullable.ReadSByte(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа SByte?. + /// + /// Кортеж. + public static Tuple ReadSByteTuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadSByte(string.Format(prompt, 0)), + BaseU.Nullable.ReadSByte(string.Format(prompt, 1)), + BaseU.Nullable.ReadSByte(string.Format(prompt, 2)), + BaseU.Nullable.ReadSByte(string.Format(prompt, 3)), + BaseU.Nullable.ReadSByte(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа SByte?. + /// + /// Кортеж. + public static Tuple ReadSByteTuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadSByte(string.Format(prompt, 0)), + BaseU.Nullable.ReadSByte(string.Format(prompt, 1)), + BaseU.Nullable.ReadSByte(string.Format(prompt, 2)), + BaseU.Nullable.ReadSByte(string.Format(prompt, 3)), + BaseU.Nullable.ReadSByte(string.Format(prompt, 4)), + BaseU.Nullable.ReadSByte(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа SByte?. + /// + /// Кортеж. + public static Tuple ReadSByteTuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadSByte(string.Format(prompt, 0)), + BaseU.Nullable.ReadSByte(string.Format(prompt, 1)), + BaseU.Nullable.ReadSByte(string.Format(prompt, 2)), + BaseU.Nullable.ReadSByte(string.Format(prompt, 3)), + BaseU.Nullable.ReadSByte(string.Format(prompt, 4)), + BaseU.Nullable.ReadSByte(string.Format(prompt, 5)), + BaseU.Nullable.ReadSByte(string.Format(prompt, 6))); + } + + #endregion + + #region ReadSingle? + + /// + /// Читает кортеж из двух значений типа Single?. + /// + /// Кортеж. + public static Tuple ReadSingleTuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadSingle(string.Format(prompt, 0)), + BaseU.Nullable.ReadSingle(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа Single?. + /// + /// Кортеж. + public static Tuple ReadSingleTuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadSingle(string.Format(prompt, 0)), + BaseU.Nullable.ReadSingle(string.Format(prompt, 1)), + BaseU.Nullable.ReadSingle(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа Single?. + /// + /// Кортеж. + public static Tuple ReadSingleTuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadSingle(string.Format(prompt, 0)), + BaseU.Nullable.ReadSingle(string.Format(prompt, 1)), + BaseU.Nullable.ReadSingle(string.Format(prompt, 2)), + BaseU.Nullable.ReadSingle(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа Single?. + /// + /// Кортеж. + public static Tuple ReadSingleTuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadSingle(string.Format(prompt, 0)), + BaseU.Nullable.ReadSingle(string.Format(prompt, 1)), + BaseU.Nullable.ReadSingle(string.Format(prompt, 2)), + BaseU.Nullable.ReadSingle(string.Format(prompt, 3)), + BaseU.Nullable.ReadSingle(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа Single?. + /// + /// Кортеж. + public static Tuple ReadSingleTuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadSingle(string.Format(prompt, 0)), + BaseU.Nullable.ReadSingle(string.Format(prompt, 1)), + BaseU.Nullable.ReadSingle(string.Format(prompt, 2)), + BaseU.Nullable.ReadSingle(string.Format(prompt, 3)), + BaseU.Nullable.ReadSingle(string.Format(prompt, 4)), + BaseU.Nullable.ReadSingle(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа Single?. + /// + /// Кортеж. + public static Tuple ReadSingleTuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadSingle(string.Format(prompt, 0)), + BaseU.Nullable.ReadSingle(string.Format(prompt, 1)), + BaseU.Nullable.ReadSingle(string.Format(prompt, 2)), + BaseU.Nullable.ReadSingle(string.Format(prompt, 3)), + BaseU.Nullable.ReadSingle(string.Format(prompt, 4)), + BaseU.Nullable.ReadSingle(string.Format(prompt, 5)), + BaseU.Nullable.ReadSingle(string.Format(prompt, 6))); + } + + #region + + #endregion ReadUInt16? + + /// + /// Читает кортеж из двух значений типа UInt16?. + /// + /// Кортеж. + public static Tuple ReadUInt16Tuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadUInt16(string.Format(prompt, 0)), + BaseU.Nullable.ReadUInt16(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа UInt16?. + /// + /// Кортеж. + public static Tuple ReadUInt16Tuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadUInt16(string.Format(prompt, 0)), + BaseU.Nullable.ReadUInt16(string.Format(prompt, 1)), + BaseU.Nullable.ReadUInt16(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа UInt16?. + /// + /// Кортеж. + public static Tuple ReadUInt16Tuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadUInt16(string.Format(prompt, 0)), + BaseU.Nullable.ReadUInt16(string.Format(prompt, 1)), + BaseU.Nullable.ReadUInt16(string.Format(prompt, 2)), + BaseU.Nullable.ReadUInt16(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа UInt16?. + /// + /// Кортеж. + public static Tuple ReadUInt16Tuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadUInt16(string.Format(prompt, 0)), + BaseU.Nullable.ReadUInt16(string.Format(prompt, 1)), + BaseU.Nullable.ReadUInt16(string.Format(prompt, 2)), + BaseU.Nullable.ReadUInt16(string.Format(prompt, 3)), + BaseU.Nullable.ReadUInt16(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа UInt16?. + /// + /// Кортеж. + public static Tuple ReadUInt16Tuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadUInt16(string.Format(prompt, 0)), + BaseU.Nullable.ReadUInt16(string.Format(prompt, 1)), + BaseU.Nullable.ReadUInt16(string.Format(prompt, 2)), + BaseU.Nullable.ReadUInt16(string.Format(prompt, 3)), + BaseU.Nullable.ReadUInt16(string.Format(prompt, 4)), + BaseU.Nullable.ReadUInt16(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа UInt16?. + /// + /// Кортеж. + public static Tuple ReadUInt16Tuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadUInt16(string.Format(prompt, 0)), + BaseU.Nullable.ReadUInt16(string.Format(prompt, 1)), + BaseU.Nullable.ReadUInt16(string.Format(prompt, 2)), + BaseU.Nullable.ReadUInt16(string.Format(prompt, 3)), + BaseU.Nullable.ReadUInt16(string.Format(prompt, 4)), + BaseU.Nullable.ReadUInt16(string.Format(prompt, 5)), + BaseU.Nullable.ReadUInt16(string.Format(prompt, 6))); + } + + #endregion + + #region ReadUInt32? + + /// + /// Читает кортеж из двух значений типа UInt32?. + /// + /// Кортеж. + public static Tuple ReadUInt32Tuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadUInt32(string.Format(prompt, 0)), + BaseU.Nullable.ReadUInt32(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа UInt32?. + /// + /// Кортеж. + public static Tuple ReadUInt32Tuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadUInt32(string.Format(prompt, 0)), + BaseU.Nullable.ReadUInt32(string.Format(prompt, 1)), + BaseU.Nullable.ReadUInt32(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа UInt32?. + /// + /// Кортеж. + public static Tuple ReadUInt32Tuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadUInt32(string.Format(prompt, 0)), + BaseU.Nullable.ReadUInt32(string.Format(prompt, 1)), + BaseU.Nullable.ReadUInt32(string.Format(prompt, 2)), + BaseU.Nullable.ReadUInt32(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа UInt32?. + /// + /// Кортеж. + public static Tuple ReadUInt32Tuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadUInt32(string.Format(prompt, 0)), + BaseU.Nullable.ReadUInt32(string.Format(prompt, 1)), + BaseU.Nullable.ReadUInt32(string.Format(prompt, 2)), + BaseU.Nullable.ReadUInt32(string.Format(prompt, 3)), + BaseU.Nullable.ReadUInt32(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа UInt32?. + /// + /// Кортеж. + public static Tuple ReadUInt32Tuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadUInt32(string.Format(prompt, 0)), + BaseU.Nullable.ReadUInt32(string.Format(prompt, 1)), + BaseU.Nullable.ReadUInt32(string.Format(prompt, 2)), + BaseU.Nullable.ReadUInt32(string.Format(prompt, 3)), + BaseU.Nullable.ReadUInt32(string.Format(prompt, 4)), + BaseU.Nullable.ReadUInt32(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа UInt32?. + /// + /// Кортеж. + public static Tuple ReadUInt32Tuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadUInt32(string.Format(prompt, 0)), + BaseU.Nullable.ReadUInt32(string.Format(prompt, 1)), + BaseU.Nullable.ReadUInt32(string.Format(prompt, 2)), + BaseU.Nullable.ReadUInt32(string.Format(prompt, 3)), + BaseU.Nullable.ReadUInt32(string.Format(prompt, 4)), + BaseU.Nullable.ReadUInt32(string.Format(prompt, 5)), + BaseU.Nullable.ReadUInt32(string.Format(prompt, 6))); + } + + #endregion + + #region ReadUInt64? + + /// + /// Читает кортеж из двух значений типа UInt64?. + /// + /// Кортеж. + public static Tuple ReadUInt64Tuple2(string prompt = null) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadUInt64(string.Format(prompt, 0)), + BaseU.Nullable.ReadUInt64(string.Format(prompt, 1))); + } + + /// + /// Читает кортеж из трёх значений типа UInt64?. + /// + /// Кортеж. + public static Tuple ReadUInt64Tuple3(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadUInt64(string.Format(prompt, 0)), + BaseU.Nullable.ReadUInt64(string.Format(prompt, 1)), + BaseU.Nullable.ReadUInt64(string.Format(prompt, 2))); + } + + /// + /// Читает кортеж из четырёх значений типа UInt64?. + /// + /// Кортеж. + public static Tuple ReadUInt64Tuple4(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadUInt64(string.Format(prompt, 0)), + BaseU.Nullable.ReadUInt64(string.Format(prompt, 1)), + BaseU.Nullable.ReadUInt64(string.Format(prompt, 2)), + BaseU.Nullable.ReadUInt64(string.Format(prompt, 3))); + } + + /// + /// Читает кортеж из пяти значений типа UInt64?. + /// + /// Кортеж. + public static Tuple ReadUInt64Tuple5(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadUInt64(string.Format(prompt, 0)), + BaseU.Nullable.ReadUInt64(string.Format(prompt, 1)), + BaseU.Nullable.ReadUInt64(string.Format(prompt, 2)), + BaseU.Nullable.ReadUInt64(string.Format(prompt, 3)), + BaseU.Nullable.ReadUInt64(string.Format(prompt, 4))); + } + + /// + /// Читает кортеж из шести значений типа UInt64?. + /// + /// Кортеж. + public static Tuple ReadUInt64Tuple6(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadUInt64(string.Format(prompt, 0)), + BaseU.Nullable.ReadUInt64(string.Format(prompt, 1)), + BaseU.Nullable.ReadUInt64(string.Format(prompt, 2)), + BaseU.Nullable.ReadUInt64(string.Format(prompt, 3)), + BaseU.Nullable.ReadUInt64(string.Format(prompt, 4)), + BaseU.Nullable.ReadUInt64(string.Format(prompt, 5))); + } + + /// + /// Читает кортеж из семи значений типа UInt64?. + /// + /// Кортеж. + public static Tuple ReadUInt64Tuple7(string prompt = EmptyStringHelper.Empty) + { + prompt = prompt ?? EmptyStringHelper.Empty; + + return TupleU.Of(BaseU.Nullable.ReadUInt64(string.Format(prompt, 0)), + BaseU.Nullable.ReadUInt64(string.Format(prompt, 1)), + BaseU.Nullable.ReadUInt64(string.Format(prompt, 2)), + BaseU.Nullable.ReadUInt64(string.Format(prompt, 3)), + BaseU.Nullable.ReadUInt64(string.Format(prompt, 4)), + BaseU.Nullable.ReadUInt64(string.Format(prompt, 5)), + BaseU.Nullable.ReadUInt64(string.Format(prompt, 6))); + } + + #endregion + + #endregion + + } + } +} \ No newline at end of file diff --git a/NETMouse - .NET release/Utils/Tuple.cs b/NETMouse - .NET release/Utils/TupleU.cs similarity index 100% rename from NETMouse - .NET release/Utils/Tuple.cs rename to NETMouse - .NET release/Utils/TupleU.cs diff --git a/TestProgram/Program.cs b/TestProgram/Program.cs index 67677d7..8546b35 100644 --- a/TestProgram/Program.cs +++ b/TestProgram/Program.cs @@ -1,5 +1,6 @@ using ABCNET.Extensions; using ABCNET.Utils; +using System; namespace TestProgram { @@ -7,11 +8,13 @@ internal static class Program { private static void Main(string[] args) { - var t = Tuple.By7(1, x => x * 2); + /*var t = TupleU.By7(1, x => x * 2); t.PrintLine(); - Array.Of(1, 2); + ArrayU.Of(1, 2); "Hell".PrintLine(); - //Matr.ReadInt32(Base.ReadInt32("N:"), Base.ReadInt32("M:"), "Элемент ({0}, {1})-ый:").Count().Numerate().MaxBy(x => x.Item).Index.Println(); + //Matr.ReadInt32(BaseU.ReadInt32("N:"), BaseU.ReadInt32("M:"), "Элемент ({0}, {1})-ый:").Count().Numerate().MaxBy(x => x.Item).Index.Println();*/ + Console.WriteLine(string.Format("kjlsgri", "jg")); + Console.ReadLine(); } } } \ No newline at end of file