Esempio n. 1
0
        /// <summary>
        /// Erstellt eine neue Instanz von ComponentInvokerProxy.
        /// </summary>
        /// <param name="type">Schnittstelle der entfernten Komponente</param>
        /// <param name="connection">Zyan-Verbindungsobjekt</param>
        public ComponentInvokerProxy(Type type, ZyanConnection connection) : base(type)
        {
            // Wenn kein Typ angegeben wurde ...
            if (type.Equals(null))
            {
                // Ausnahme werfen
                throw new ArgumentNullException("type");
            }

            // Wenn keine Verbindung angegeben wurde ...
            if (connection == null)
            {
                // Ausnahme werfen
                throw new ArgumentNullException("connection");
            }

            // Verbindung übernehmen
            _connection = connection;
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ZyanProxy"/> class.
        /// </summary>
        /// <param name="uniqueName">Unique component name.</param>
        /// <param name="type">Component interface type.</param>
        /// <param name="connection"><see cref="ZyanConnection"/> instance.</param>
        /// <param name="implicitTransactionTransfer">Specifies whether transactions should be passed implicitly.</param>
        /// <param name="keepSynchronizationContext">Specifies whether callbacks and event handlers should use the original synchronization context.</param>
        /// <param name="sessionID">Session ID.</param>
        /// <param name="componentHostName">Name of the remote component host.</param>
        /// <param name="autoLoginOnExpiredSession">Specifies whether Zyan should login automatically with cached credentials after the session is expired.</param>
        /// <param name="activationType">Component activation type</param>
        public ZyanProxy(string uniqueName, Type type, ZyanConnection connection, bool implicitTransactionTransfer, bool keepSynchronizationContext, Guid sessionID, string componentHostName, bool autoLoginOnExpiredSession, ActivationType activationType)
            : base(type)
        {
            if (type == null)
            {
                throw new ArgumentNullException("type");
            }

            if (connection == null)
            {
                throw new ArgumentNullException("connection");
            }

            if (string.IsNullOrEmpty(uniqueName))
            {
                _uniqueName = type.FullName;
            }
            else
            {
                _uniqueName = uniqueName;
            }

            _sessionID                   = sessionID;
            _connection                  = connection;
            _componentHostName           = componentHostName;
            _interfaceType               = type;
            _activationType              = activationType;
            _remoteDispatcher            = _connection.RemoteDispatcher;
            _implicitTransactionTransfer = implicitTransactionTransfer;
            _autoLoginOnExpiredSession   = autoLoginOnExpiredSession;
            _delegateCorrelationSet      = new List <DelegateCorrelationInfo>();

            // capture synchronization context for callback execution
            if (keepSynchronizationContext)
            {
                _synchronizationContext = SynchronizationContext.Current;
            }
        }