System.Collections.Generic.List.Add(queuemsg)

Here are the examples of the csharp api System.Collections.Generic.List.Add(queuemsg) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

19 View Source File : NamedPipeClient.cs
License : Mozilla Public License 2.0
Project Creator : open-rpa

public T Message(T message, TimeSpan timeout)
        {
            T result = default(T);
            if (pipe == null || !pipe.isConnected) return result;

            var queue = new queuemsg<T>(message);
            lock (lockobj) replyqueue.Add(queue);
            // Log.Information("Send and queue message " + message.messageid);
            using (queue.autoReset = new AutoResetEvent(false))
            {
                pipe.PushMessage(message);
                queue.autoReset.WaitOne(timeout);
                queue.sw.Stop();
            }
            // Log.Debug("received reply for " + message.messageid + " " + string.Format("Time elapsed: {0:mm\\:ss\\.fff}", queue.sw.Elapsed));
            lock (lockobj) replyqueue.Remove(queue);
            result = queue.result;
            if (result != null && result.error != null)
            {
                string s = result.error.ToString().Trim();
                if (!string.IsNullOrEmpty(s) && s != "{}")
                {
                    Log.Error(result.error.ToString());
                    throw new NamedPipeException(result.error.ToString());
                }
            }
            return result;
        }