//return the struct CharSetUnicodeSequential instance public static CharSetUnicodeSequential NewCharSetUnicodeSequential(string f1, char f2) { CharSetUnicodeSequential str1 = new CharSetUnicodeSequential(); str1.f1 = f1; str1.f2 = f2; return(str1); }
// Returns true if the two params have the same fields public static bool ValidateCharSetUnicodeSequential(CharSetUnicodeSequential str1, CharSetUnicodeSequential str2, string methodName) { if (str1.f1 != str2.f1 || str1.f2 != str2.f2) { Console.WriteLine("\tFAILED! " + methodName + "did not receive result as expected."); Console.WriteLine("\tThe Actual is..."); PrintCharSetUnicodeSequential(str1, str1.ToString()); Console.WriteLine("\tThe Expected is..."); PrintCharSetUnicodeSequential(str2, str2.ToString()); return(false); } else { Console.WriteLine("\tPASSED!"); return(true); } }
// Returns true if the two params have the same fields public static bool ValidateCharSetUnicodeSequential(CharSetUnicodeSequential str1, CharSetUnicodeSequential str2, string methodName) { if (str1.f1 != str2.f1 || str1.f2 != str2.f2) { Console.WriteLine("\tFAILED! " + methodName + "did not recieve result as expected."); Console.WriteLine("\tThe Actual is..."); PrintCharSetUnicodeSequential(str1, str1.ToString()); Console.WriteLine("\tThe Expected is..."); PrintCharSetUnicodeSequential(str2, str2.ToString()); return false; } else { Console.WriteLine("\tPASSED!"); return true; } }
//print the struct CharSetUnicodeSequential element public static void PrintCharSetUnicodeSequential(CharSetUnicodeSequential str1, string name) { Console.WriteLine("\t{0}.f1 = {1}", name, str1.f1); Console.WriteLine("\t{0}.f2 = {1}", name, str1.f2); }
//return the struct CharSetUnicodeSequential instance public static CharSetUnicodeSequential NewCharSetUnicodeSequential(string f1, char f2) { CharSetUnicodeSequential str1 = new CharSetUnicodeSequential(); str1.f1 = f1; str1.f2 = f2; return str1; }
static extern bool MarshalStructAsParam_AsSeqByRefOut4(out CharSetUnicodeSequential str1);
static extern bool MarshalStructAsParam_AsSeqByVal4(CharSetUnicodeSequential str1);