internal static class GHFLBMConvertFunctions { private static delegate Boolean dlAdjust(String dlbm);以上代码出来的提示是:The modifier 'static' is not valid for this item 事件是支持的,不支持委托。
事件可以为static,委托不能为static 在静态类中,可以使用事件的 public delegate void ServerDone(DataTable dt,string state); public static event ServerDone OnServerDoneHandler;
以下是我自己以前项目的部分代码
public static class DataCoreEvent
{
//触发数据库或者文件数据库事件
#region fire Log Event
public static event DataCoreLogDelegate DataCoreLogEvent;
public static void FireLog(string classname, string methodname, string des)
{
if (DataCoreLogEvent != null)
DataCoreLogEvent(classname, methodname, des);
}
{
private static delegate Boolean dlAdjust(String dlbm);以上代码出来的提示是:The modifier 'static' is not valid for this item
事件是支持的,不支持委托。
在静态类中,可以使用事件的
public delegate void ServerDone(DataTable dt,string state);
public static event ServerDone OnServerDoneHandler;