本文整理汇总了C#中Double.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Double.GetType方法的具体用法?C# Double.GetType怎么用?C# Double.GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Double
的用法示例。
在下文中一共展示了Double.GetType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: runTest
public bool runTest()
{
Console.Error.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver " + s_strDtTmVer);
int iCountErrors = 0;
int iCountTestcases = 0;
String strLoc = "Loc_000oo";
Type ArrType;
try {
do
{
strLoc = "Loc_01T";
iCountTestcases++;
short [] in2Arr = new Int16[10];
ArrType = in2Arr.GetType();
if(!ArrType.IsArray)
{
iCountErrors++;
Console.WriteLine( s_strTFAbbrev+ " ,Err_01T! , Array.GetType failed on single dimension array." );
}
strLoc = "Loc_02T";
iCountTestcases++;
int[] in4Arr = new Int32[0];
ArrType = in4Arr.GetType();
if(!ArrType.IsArray)
{
iCountErrors++;
Console.WriteLine( s_strTFAbbrev+ " ,Err_02T! , Array.GetType failed on 0 size single dimension array." );
}
int[][] i4Arr = new int[3][];
i4Arr[0] = new int[] {1, 2, 3};
i4Arr[1] = new int[] {1, 2, 3, 4, 5, 6};
i4Arr[2] = new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9};
strLoc = "Loc_03T";
iCountTestcases++;
ArrType = i4Arr.GetType();
if(!ArrType.IsArray)
{
iCountErrors++;
Console.WriteLine( s_strTFAbbrev+ " ,Err_03ifs! , Array.GetType failed on jagged array." );
}
strLoc = "Loc_04ifx";
iCountTestcases++;
Object [][] objArr = new Object[0][];
ArrType = objArr.GetType();
if(!ArrType.IsArray)
{
iCountErrors++;
Console.WriteLine( s_strTFAbbrev+ " ,Err_04ifs! , Array.GetType failed on 0 size jagged array." );
}
strLoc = "Loc_05ifx";
iCountTestcases++;
Double[,] doArr = new Double[99, 78];
ArrType = doArr.GetType();
if(!ArrType.IsArray)
{
iCountErrors++;
Console.WriteLine( s_strTFAbbrev+ " ,Err_05ifs! , Array.GetType failed on rectangle array." );
}
strLoc = "Loc_06ifx";
iCountTestcases++;
Hashtable[,] htArr = new Hashtable[0,0];
ArrType = htArr.GetType();
if(!ArrType.IsArray)
{
iCountErrors++;
Console.WriteLine( s_strTFAbbrev+ " ,Err_06ifs! , Array.GetType failed on 0 size rectangle array." );
}
strLoc = "Loc_07ifx";
iCountTestcases++;
string[,,,,,] strArr = new string[6,5,4,3,2,1];
ArrType = strArr.GetType();
if(!ArrType.IsArray)
{
iCountErrors++;
Console.WriteLine( s_strTFAbbrev+ " ,Err_07ifs! , Array.GetType failed on 6 dimensions rectangle array." );
}
strLoc = "Loc_08ifx";
iCountTestcases++;
ArrType = typeof(System.Array);
if(ArrType.IsArray)
{
iCountErrors++;
Console.WriteLine( s_strTFAbbrev+ " ,Err_08ifs! , typeof(System.Array).IsArray should return false." );
}
strLoc = "Loc_09ifx";
iCountTestcases++;
int [] dims = {2,3,2,1};
int [] lbould = {0,1,2,3};
Array dbArr = Array.CreateInstance(typeof(Double), dims, lbould);
ArrType = dbArr.GetType();
if(!ArrType.IsArray)
{
iCountErrors++;
Console.WriteLine( s_strTFAbbrev+ " ,Err_09ifs! , Array.GetType failed on multi_dimensions rectangle array created by Array.CreateInstance." );
}
} while (false);
} catch (Exception exc_general ) {
++iCountErrors;
Console.WriteLine(s_strTFAbbrev +" Error Err_8888yyy! strLoc=="+ strLoc +", exc_general=="+exc_general);
}
//.........这里部分代码省略.........