开发者

multiple referencing - single instance

开发者 https://www.devze.com 2023-03-03 15:33 出处:网络
If you had several applications all open, which all referenced the same object... How is it possible for that referenced object to be a single i开发者_运维技巧nstance?

If you had several applications all open, which all referenced the same object...

How is it possible for that referenced object to be a single i开发者_运维技巧nstance?

Example:

If one application updates a property, then all the other applications see the change.


I'm not sure what you want to achieve. Applications can exchange information by WCF, or by remoting (there is of course an other ways). If you need that some application can be run at a time only single instance - you can use named Mutex.


Maybe you can move the shared instance state to the database or XML? It will be much easier to get/update it. Another option is to serrialize the object into a local file and use named mutex to access it (if all applications are local). I would also consider VikciaR's answer.

0

精彩评论

暂无评论...
验证码 换一张
取 消