コード例 #1
0
ファイル: Operator.cs プロジェクト: wangscript007/Net7NTCIP
 /// <summary>
 /// Evaluates unary negation (-) for the given type; this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static T Negate <T>(T value)
 {
     return(Operator <T> .Negate(value));
 }
コード例 #2
0
ファイル: Operator.cs プロジェクト: wangscript007/Net7NTCIP
 /// <summary>
 /// Evaluates bitwise not (~) for the given type; this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static T Not <T>(T value)
 {
     return(Operator <T> .Not(value));
 }
コード例 #3
0
ファイル: Operator.cs プロジェクト: wangscript007/Net7NTCIP
 /// <summary>
 /// Evaluates binary less-than-or-equal (&lt;=) for the given type; this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static bool LessThanOrEqual <T>(T value1, T value2)
 {
     return(Operator <T> .LessThanOrEqual(value1, value2));
 }
コード例 #4
0
ファイル: Operator.cs プロジェクト: wangscript007/Net7NTCIP
 /// <summary>
 /// Evaluates integer division (/) for the given type; this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary><remarks>
 /// This operation is particularly useful for computing averages and
 /// similar aggregates.
 /// </remarks>
 public static T DivideInt32 <T>(T value, int divisor)
 {
     return(Operator <int, T> .Divide(value, divisor));
 }
コード例 #5
0
ファイル: Operator.cs プロジェクト: wangscript007/Net7NTCIP
 /// <summary>
 /// Evaluates binary inequality (!=) for the given type; this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static bool NotEqual <T>(T value1, T value2)
 {
     return(Operator <T> .NotEqual(value1, value2));
 }
コード例 #6
0
ファイル: Operator.cs プロジェクト: wangscript007/Net7NTCIP
 /// <summary>
 /// Evaluates binary greater-than-on-eqauls (&gt;=) for the given type; this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static bool GreaterThanOrEqual <T>(T value1, T value2)
 {
     return(Operator <T> .GreaterThanOrEqual(value1, value2));
 }
コード例 #7
0
ファイル: Operator.cs プロジェクト: wangscript007/Net7NTCIP
 /// <summary>
 /// Evaluates binary division (/) for the given type; this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static T Divide <T>(T value1, T value2)
 {
     return(Operator <T> .Divide(value1, value2));
 }
コード例 #8
0
ファイル: Operator.cs プロジェクト: wangscript007/Net7NTCIP
 /// <summary>
 /// Evaluates binary addition (+) for the given type(s); this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static TArg1 AddAlternative <TArg1, TArg2>(TArg1 value1, TArg2 value2)
 {
     return(Operator <TArg2, TArg1> .Add(value1, value2));
 }
コード例 #9
0
ファイル: Operator.cs プロジェクト: wangscript007/Net7NTCIP
 /// <summary>
 /// Evaluates integer multiplication (*) for the given type; this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static T MultiplyInt32 <T>(T value, int value2)
 {
     return(Operator <int, T> .Multiply(value, value2));
 }
コード例 #10
0
ファイル: Operator.cs プロジェクト: wangscript007/Net7NTCIP
 /// <summary>
 /// Evaluates binary multiplication (*) for the given type(s); this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static TArg1 MultiplyAlternative <TArg1, TArg2>(TArg1 value1, TArg2 value2)
 {
     return(Operator <TArg2, TArg1> .Multiply(value1, value2));
 }
コード例 #11
0
ファイル: Operator.cs プロジェクト: wangscript007/Net7NTCIP
 /// <summary>
 /// Evaluates binary multiplication (*) for the given type; this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static T Multiply <T>(T value1, T value2)
 {
     return(Operator <T> .Multiply(value1, value2));
 }
コード例 #12
0
ファイル: Operator.cs プロジェクト: wangscript007/Net7NTCIP
 /// <summary>
 /// Evaluates binary subtraction(-) for the given type(s); this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static TArg1 SubtractAlternative <TArg1, TArg2>(TArg1 value1, TArg2 value2)
 {
     return(Operator <TArg2, TArg1> .Subtract(value1, value2));
 }
コード例 #13
0
ファイル: Operator.cs プロジェクト: wangscript007/Net7NTCIP
 /// <summary>
 /// Evaluates binary subtraction (-) for the given type; this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static T Subtract <T>(T value1, T value2)
 {
     return(Operator <T> .Subtract(value1, value2));
 }
コード例 #14
0
ファイル: Operator.cs プロジェクト: wangscript007/Net7NTCIP
 /// <summary>
 /// Evaluates bitwise and (&amp;) for the given type; this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static T And <T>(T value1, T value2)
 {
     return(Operator <T> .And(value1, value2));
 }
コード例 #15
0
ファイル: Operator.cs プロジェクト: wangscript007/Net7NTCIP
 /// <summary>
 /// Evaluates binary division (/) for the given type(s); this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static TArg1 DivideAlternative <TArg1, TArg2>(TArg1 value1, TArg2 value2)
 {
     return(Operator <TArg2, TArg1> .Divide(value1, value2));
 }
コード例 #16
0
ファイル: Operator.cs プロジェクト: wangscript007/Net7NTCIP
 /// <summary>
 /// Evaluates bitwise xor (^) for the given type; this will throw
 /// an InvalidOperationException if the type T does not provide this operator, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this operator.
 /// </summary>
 public static T Xor <T>(T value1, T value2)
 {
     return(Operator <T> .Xor(value1, value2));
 }
コード例 #17
0
ファイル: Operator.cs プロジェクト: wangscript007/Net7NTCIP
 /// <summary>
 /// Performs a conversion between the given types; this will throw
 /// an InvalidOperationException if the type T does not provide a suitable cast, or for
 /// Nullable&lt;TInner&gt; if TInner does not provide this cast.
 /// </summary>
 public static TTo Convert <TFrom, TTo>(TFrom value)
 {
     return(Operator <TFrom, TTo> .Convert(value));
 }