private DRBRaw(byte[] bytes) { BinaryReaderEx br = new BinaryReaderEx(false, bytes); br.AssertASCII("DRB\0"); br.AssertInt32(0); br.AssertInt32(0); br.AssertInt32(0); str = new STR(br); texi = new TEXI(br); shpr = new Section(br, "SHPR"); ctpr = new Section(br, "CTPR"); anip = new Section(br, "ANIP"); intp = new Section(br, "INTP"); scdp = new Section(br, "SCDP"); shap = new SHAP(br); ctrl = new Section(br, "CTRL"); anik = new Section(br, "ANIK"); anio = new Section(br, "ANIO"); anim = new Section(br, "ANIM"); scdk = new Section(br, "SCDK"); scdo = new Section(br, "SCDO"); scdl = new Section(br, "SCDL"); Dictionary <int, DLGOEntry> dlgoEntries = readDLGO(br, str); dlg = new DLG(br, str, dlgoEntries); br.AssertASCII("END\0"); br.AssertInt32(0); br.AssertInt32(0); br.AssertInt32(0); }
static void Main(string[] args) { DLG d = new DLG(m_1); d("abc"); d = new DLG(m_2); d("def"); Console.ReadLine(); }
private event DLG eventModel; // 事件在方法外部定义 在方法内部执行 public ActionResult Index() { // 类内部定义的委托 DLG dLG = SayHello; dLG += SayGoodBye; dLG("哈尼"); // 事件 eventModel += SayHello; eventModel += SayGoodBye; eventModel("大胖小子"); // 类外部定义的委托 DLGOut dLGOut = SayHello; dLGOut += SayGoodBye; dLGOut("小伙子"); // 匿名委托 最常用的匿名委托是lambda表达式 DLG dLGnm = delegate(string name) { SayHello("没有委托名" + name); }; dLGnm += (string name) => { SayHello("去掉委托关键字" + name); }; dLGnm += name => SayHello("去掉参数类型和括号" + name); dLGnm("匿名委托"); BDLGClass bDLGClass = new BDLGClass(); bDLGClass.BMain(); return(View()); }