Refactor the TorWebClient
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Tor
|
||||
@@ -24,5 +25,34 @@ namespace Tor
|
||||
else sb.Append(String.Format(formatString.ToString(), number));
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public static String ThreadStateToString(Thread thread)
|
||||
{
|
||||
switch(thread.ThreadState)
|
||||
{
|
||||
case ThreadState.Running :
|
||||
return "Running";
|
||||
case ThreadState.StopRequested :
|
||||
return "StopRequested";
|
||||
case ThreadState.SuspendRequested :
|
||||
return "SuspendRequested";
|
||||
case ThreadState.Background :
|
||||
return "Background";
|
||||
case ThreadState.Unstarted :
|
||||
return "Unstarted";
|
||||
case ThreadState.Stopped :
|
||||
return "Stopped";
|
||||
case ThreadState.WaitSleepJoin :
|
||||
return "WaitSleepJoin";
|
||||
case ThreadState.Suspended :
|
||||
return "Suspended";
|
||||
case ThreadState.AbortRequested :
|
||||
return "AbortRequested";
|
||||
case ThreadState.Aborted :
|
||||
return "Aborted";
|
||||
default :
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user