GetObject() 공개 정적인 메소드

public static GetObject ( DBus.Connection conn, string bus_name, ObjectPath object_path, Type declType ) : object
conn DBus.Connection
bus_name string
object_path ObjectPath
declType System.Type
리턴 object
예제 #1
0
        public object GetObject(Type type, string bus_name, ObjectPath path)
        {
            if (!CheckBusNameExists(bus_name))
            {
                return(null);
            }

            //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 (ProtocolInformation.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());
            }
        }
예제 #2
0
        public object GetObject(Type type, string bus_name, ObjectPath path)
        {
            if (!CheckBusNameExists(bus_name))
            {
                return(null);
            }

            //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
            {
                throw new ApplicationException("Warning: Note that MarshalByRefObject use is not available");
            }
        }