using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using log4net.Appender;
using System.IO;
using log4net.Layout;
using System.Diagnostics;
[assembly: AssemblyVersion("1.0.2000.0")]
namespace T {
public class B
{
public bool Test(string str)
{
if (str != null)
{
Console.WriteLine("Hello");
return true;
}
return false;
}
public B()
{
}
}
class Program
{
public static bool Test(string str)
{
if (str != null)
{
Console.WriteLine("Hello");
return true;
}
return false;
}
public static bool TestDele<B>(Func<B, bool> func)
{
// TResult t=default(TResult);
//string t = default(string);
//t =Convert.ToString("hello")
B b = default(B);
b = (B)GetBtype();
func.Invoke(b);
// bool b=func.Invoke()
if (func != null)
{
return true;
}
return false;
}
private static object GetBtype()
{
B b = new B();
return b;
}
static void Main(string[] args)
{
bool bb = TestDele<B>(item => item.Test("hello"));
Console.Write(bb.ToString());
}
}
}