Exemplo n.º 1
0
    //[EnvironmentPermissionAttribute(SecurityAction.LinkDemand, Unrestricted = true)]
    public bool Connect(String engineName)
    {
      if (serviceGraphic.PortInfoRequested != null) // An engine is already connected.
        return false;

      try
      {
        serviceGraphic = Activator.GetObject(typeof(BaseProtocol), url.ToString()) as EngineServiceProtocol;

        Name = serviceGraphic.Name; // Force a test of the connection.

        serviceGraphicPortInfoRequestedHandler = new EngineServiceProtocol.PortInfoRequestedHandler(ServiceGraphicPortInfoRequested);

        serviceGraphic.PortInfoRequested = serviceGraphicPortInfoRequestedHandler;

        Syncxxx();

        this.engineName = Announce(engineName);

        connectionError = "";
        return true;
      }

      catch (System.Runtime.Remoting.RemotingException remotingException)
      {
        connectionError = remotingException.Message;
        return false;
      }
    }
Exemplo n.º 2
0
        //[EnvironmentPermissionAttribute(SecurityAction.LinkDemand, Unrestricted = true)]
        public bool Connect(String engineName)
        {
            if (serviceGraphic.PortInfoRequested != null) // An engine is already connected.
            {
                return(false);
            }

            try
            {
                serviceGraphic = Activator.GetObject(typeof(BaseProtocol), url.ToString()) as EngineServiceProtocol;

                Name = serviceGraphic.Name; // Force a test of the connection.

                serviceGraphicPortInfoRequestedHandler = new EngineServiceProtocol.PortInfoRequestedHandler(ServiceGraphicPortInfoRequested);

                serviceGraphic.PortInfoRequested = serviceGraphicPortInfoRequestedHandler;

                Syncxxx();

                this.engineName = Announce(engineName);

                connectionError = "";
                return(true);
            }

            catch (System.Runtime.Remoting.RemotingException remotingException)
            {
                connectionError = remotingException.Message;
                return(false);
            }
        }