Beispiel #1
0
        //FIXME: this shouldn't be part of the core API
        //that also applies to much of the other object mapping code
        //it should cache proxies and objects, really

        //inspired by System.Activator
        public object GetObject(Type type, string bus_name, ObjectPath path)
        {
            BusObject busObject = new BusObject(this, bus_name, path);
            DProxy    prox      = new DProxy(busObject, type);

            object obj = prox.GetTransparentProxy();

            return(obj);
        }
Beispiel #2
0
        //FIXME: this shouldn't be part of the core API
        //that also applies to much of the other object mapping code

        public object GetObject(Type type, string bus_name, ObjectPath path)
        {
            //if (type == null)
            //	return GetObject (bus_name, path);

            //if the requested type is an interface, we can implement it efficiently
            //otherwise we fall back to using a transparent proxy
            if (type.IsInterface || type.IsAbstract)
            {
                return(BusObject.GetObject(this, bus_name, path, type));
            }
            else
            {
                if (Protocol.Verbose)
                {
                    Console.Error.WriteLine("Warning: Note that MarshalByRefObject use is not recommended; for best performance, define interfaces");
                }

                BusObject busObject = new BusObject(this, bus_name, path);
                DProxy    prox      = new DProxy(busObject, type);
                return(prox.GetTransparentProxy());
            }
        }