| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 | using System.Threading.Tasks;using System.Linq;using System;using System.Net.Sockets;using System.Net;using Renci.SshNet.Messages;using Renci.SshNet.Common;using System.Threading;using Renci.SshNet.Messages.Transport;namespace Renci.SshNet{    /// <summary>    /// Provides functionality to connect and interact with SSH server.    /// </summary>    public partial class Session    {        partial void HandleMessageCore(Message message)        {            this.HandleMessage((dynamic)message);        }        partial void ExecuteThread(Action action)        {            Task.Factory.StartNew(action, TaskCreationOptions.LongRunning);        }        partial void InternalRegisterMessage(string messageName)        {            lock (this._messagesMetadata)            {                Parallel.ForEach(                    from m in this._messagesMetadata where m.Name == messageName select m,                    (item) => { item.Enabled = true; item.Activated = true; });            }        }        partial void InternalUnRegisterMessage(string messageName)        {            lock (this._messagesMetadata)            {                Parallel.ForEach(                    from m in this._messagesMetadata where m.Name == messageName select m,                    (item) => { item.Enabled = false; item.Activated = false; });            }        }    }}
 |