Ejemplo n.º 1
0
 internal void InvalidateRuntime()
 {
     lock (ThisLock)
     {
         shared.ThrowIfImmutable();
         runtime = null;
     }
 }
Ejemplo n.º 2
0
        internal ProxyOperationRuntime(ClientOperation operation, ImmutableClientRuntime parent)
        {
            if (operation == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(operation));
            }
            if (parent == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(parent));
            }

            _parent        = parent;
            _formatter     = operation.Formatter;
            _isInitiating  = operation.IsInitiating;
            _isOneWay      = operation.IsOneWay;
            _isTerminating = operation.IsTerminating;
            _isSessionOpenNotificationEnabled = operation.IsSessionOpenNotificationEnabled;
            _name = operation.Name;
            _parameterInspectors = EmptyArray <IParameterInspector> .ToArray(operation.ParameterInspectors);

            _faultFormatter   = operation.FaultFormatter;
            _serializeRequest = operation.SerializeRequest;
            _deserializeReply = operation.DeserializeReply;
            _action           = operation.Action;
            _replyAction      = operation.ReplyAction;
            _beginMethod      = operation.BeginMethod;
            _syncMethod       = operation.SyncMethod;
            _taskMethod       = operation.TaskMethod;
            TaskTResult       = operation.TaskTResult;

            if (_beginMethod != null)
            {
                _inParams = ServiceReflector.GetInputParameters(_beginMethod, true);
                if (_syncMethod != null)
                {
                    _outParams = ServiceReflector.GetOutputParameters(_syncMethod, false);
                }
                else
                {
                    _outParams = NoParams;
                }
                _endOutParams = ServiceReflector.GetOutputParameters(operation.EndMethod, true);
                _returnParam  = operation.EndMethod.ReturnParameter;
            }
            else if (_syncMethod != null)
            {
                _inParams    = ServiceReflector.GetInputParameters(_syncMethod, false);
                _outParams   = ServiceReflector.GetOutputParameters(_syncMethod, false);
                _returnParam = _syncMethod.ReturnParameter;
            }

            if (_formatter == null && (_serializeRequest || _deserializeReply))
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR.ClientRuntimeRequiresFormatter0, _name)));
            }
        }
Ejemplo n.º 3
0
        internal ImmutableClientRuntime GetRuntime()
        {
            lock (ThisLock)
            {
                if (runtime == null)
                {
                    runtime = new ImmutableClientRuntime(this);
                }

                return(runtime);
            }
        }