程序与程序之间共享对象:MarshalByRefObject

源自于:http://stackoverflow.com/questions/439173/message-pumps-and-appdomains/442316

 

程序与程序之间共享对象:

MarshalByRefObject


示范代码:
public class Container<T> : MarshalByRefObject
{
    private T _value;
    public T Value { get { return _value; } set { _value = value; } }

    public Container() { }
    public Container(T value) { Value = value; }

    public static implicit operator T(Container<T> container)
    {
        return container.Value;
    }
}
 
posted @ 2015-04-09 14:39  三台  阅读(243)  评论(0编辑  收藏  举报