本文整理汇总了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;
}