本文整理汇总了C#中Manager.Stop方法的典型用法代码示例。如果您正苦于以下问题:C# Manager.Stop方法的具体用法?C# Manager.Stop怎么用?C# Manager.Stop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Manager
的用法示例。
在下文中一共展示了Manager.Stop方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test
public void Test()
{
System.Threading.AutoResetEvent evt = new System.Threading.AutoResetEvent(false);
Packets.LicensePlatePacket p = null;
int count = 0;
Manager mnger = new Manager(new PacketSplitter());
var parser = new Parsers.LicensePlateParser();
parser.Handler += licensePlate =>
{
System.Diagnostics.Debug.WriteLine(licensePlate.LicensePlate.LicenseNumber);
p = licensePlate;
++count;
if (count > 1000)
{
evt.Set();
}
};
mnger.Parsers.Add(parser);
mnger.Start();
evt.WaitOne(10000);
mnger.Stop();
Assert.IsNotNull(p);
}
示例2: StartAndWait
public void StartAndWait()
{
try
{
Manager = new Manager();
StartSignalsListener();
_log.Submit(LogLevel.Info, "Starting Services");
Manager.Start();
_log.Submit(LogLevel.Info, "Services started. Waiting for stop signal");
StopResetEvent.WaitOne();
Manager.Stop();
}
catch (Exception e)
{
_log.SubmitException(e);
}
Environment.Exit(0);
}
示例3: Main
static void Main(string[] args)
{
string host = "127.0.0.1";
bool help = false;
int port = 8000;
var p = new OptionSet {
{ "h|host=", v => host = v },
{ "p|port=", v => port = int.Parse(v) },
{ "?|help", v => help = v != null },
};
p.Parse(args);
if (help)
{
p.WriteOptionDescriptions(Console.Out);
// Syntax();
return;
}
// set up manager
var mgr = new Manager(new ManagerConfig { Port = port, Hostname = host });
mgr.Start();
Console.WriteLine("Worker(s) running, hit [enter] to exit");
Console.ReadLine();
mgr.Stop();
}
示例4: showShareDialog
private static int showShareDialog(string[] args)
{
if (args.Length < 2) {
System.Console.Write ("ERROR: iFolder ID not specified\n");
return -1;
}
Manager manager = new Manager();
manager.Start();
iFolderPropertiesDialog propsDialog;
propsDialog = new iFolderPropertiesDialog (args [1], manager);
propsDialog.CurrentPage = 1;
propsDialog.Run ();
propsDialog.Hide ();
propsDialog.Destroy ();
manager.Stop();
return 0;
}