本文整理匯總了C#中System.TestClass.MyFunc方法的典型用法代碼示例。如果您正苦於以下問題:C# TestClass.MyFunc方法的具體用法?C# TestClass.MyFunc怎麽用?C# TestClass.MyFunc使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.TestClass
的用法示例。
在下文中一共展示了TestClass.MyFunc方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Main
public static int Main(string[] args)
{
DateTime dt = DateTime.Now;
MyDelegateType del = new MyDelegateType(MyMath.AttachToDelegate);
//multi-cast delegate, attaching multiple methods
del += new MyDelegateType(MyMath.GetMonth);
//delegates and anonymous methods, use the delegate keyword
del += delegate
{
Console.WriteLine("anonymous method called");
};
del.Invoke(dt);
Console.WriteLine("hello world!");
var result = from i in args
select i;
foreach (var item in result)
Console.WriteLine(item);
double x = 10, y = 20, temp;
Console.WriteLine("x: {0}, y:{1}", x, y);
temp = y;
y = x;
x = temp;
Console.WriteLine("x: {0}, y:{1}", x, y);
Display<double>.DisplayStrings(x, y);
Console.WriteLine("Sum: {0:C}", MyMath.Add(10.345, 344.67, 89, 234.900, -20));
try
{
throw new MyCustomExceptionHandlingMechanism();
}
catch (MyCustomExceptionHandlingMechanism e)
{
e.ShowExceptionDetails();
}
DevelopmentEnvironment devEnv = new DevelopmentEnvironment();
devEnv.ShowMyEnvironment();
TestClass crossLanguage = new TestClass();
crossLanguage.MyFunc();
MyMath myObj = new MyMath();
myObj.InternalInstanceMethod();
Console.WriteLine("name {0}, value {1}", ColorCoding.blue.GetType().Name, Convert.ToInt32(System.Enum.Parse(ColorCoding.blue.GetType(),"red")));
Console.ReadLine();
return System.Environment.ExitCode = 0;
}