English 中文(简体)
C# 多位代表与活动
原标题:C# multi-threaded delegate and events

我有点难以理解从这里到哪里去——我开发了一张可以访问 SQL Express 数据库的表格,并通过一个 DataSet 来操作它。我还开发了一个班级,在多轨 TCP 服务器上收听,通过专利协议从其他客户那里获取最新消息。

我需要做的是把这些更新 更新到表格中, 它有 数据集的例子要更新。

我检查了其中的一些活动, 并在这里提供了代表帮助。 http://www.akadia.com/services/dotnet_delegates_and_events.html” rel=“nofollow”> 这份指南 一开始似乎很方便, 但遇到的问题与许多这些例子一样,

哪个类是“订户 ”, 哪个类是“ 订户 ”? 我非常讨厌表格编程, 并且会做完全基于指令的编程, 但对于一群电脑文盲来说,

最佳回答

出版商是该类宣布该事件的对象。例如,一个 Datatable 发布一个 RowChanged 事件。

处理事件的对象为订阅者。例如,带有 _table 字段的类可以因此订阅行变化事件(假设有处理方法,当然有):

this._table.RowChanged += this.HandleRowChanged;

有时,某个类会订阅它自己的事件。 例如 Windows 窗体的加载事件。 它使用的管理费用超过需要, 有些框架提供虚拟方法, 允许子类在不创建事件代表的情况下扩展基类功能。 这就是为什么表S OnLoad 方法是虚拟的。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签