如何有选择地使用寄存器 [英] how to use register selectively

查看:77
本文介绍了如何有选择地使用寄存器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种创建虚拟注册表的方法,并强制只使用某个程序?或者创建一个虚拟的注册表,但我可以关闭(这个注册表只会在我激活时使用)?!


或者将所有查询重定向到注册表中的另一个地方

我见过类似的问题。但是没有答案如何有选择地使用寄存器!

打开任何帮助。感谢您的帮助。


问候。

I am looking for a way to create a virtual registry and force only certain programs to use this one? Or to create a virtual Registry but which i can shut down (this registry will be only used while i activate it)?!

Or redirect all querys to another place in the registry
I''ve seen similar issues. But there is no answer how to use the register selectively!
Open for any help. Appreciate your help.

Greetings.

推荐答案

您可以查看Observer设计模式。


此模式允许对象将自己注册为观察者。注册可以由中介对象管理。


然后当目标对象中发生事件时,该对象可以调用其Notify()方法,该方法将联系Mediator对象,而该对象依次将将事件信息传递给所有观察者。


这就像通知订阅部门有50个订阅者地址变更的杂志。地址维护对象检测并解决更改,并自动更新50个邮件列表。

在您的情况下,您的特定对象注册为观察者,您的控制对象可以通知调解员通过关于使用什么注册表的观察者信息。同样,您的控制对象可以通知观察者注册表不可用。
You might have a look at the Observer design pattern.

This pattern allows objects to enroll themselves as observers. The enrollment may be managed by mediator object.

Then when an event occurs in a target object, that object can call its Notify() method which wil contact the Mediator object who in turn will pass the event info to all of the observers.

It''s like notifying the subscription department that has 50 magazines of a change of address of a subscriber. The address maintenance object senses and address change and gets 50 mailing lists updated automatically.

In your case, your certain object signs up as an Observer and your control object can notify the mediator which passes the info along to the observers as to what registry to use. Similarly, your control object can notify the observers that the registry is not available.


您好,我从未遇到过这样的问题。我认为选择性地使用虚拟注册表是不可能的。
Hi, I had never met such a question. I think it''s impossible to use virtual registry selectively.


谢谢,也许还有其他想法?
Thank you, perhaps there are other ideas?


这篇关于如何有选择地使用寄存器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆