本文整理汇总了C#中Manager.Start方法的典型用法代码示例。如果您正苦于以下问题:C# Manager.Start方法的具体用法?C# Manager.Start怎么用?C# Manager.Start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Manager
的用法示例。
在下文中一共展示了Manager.Start方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
示例2: 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);
}
示例3: BeforeTestRun
public static void BeforeTestRun()
{
MyManager = new Manager(false);
MyManager.Settings.ExecutionDelay = 0;
MyManager.Settings.Web.RecycleBrowser = true;
MyManager.Start();
}
示例4: 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();
}
示例5: Setup
public Manager Setup(String _homePage)
{
// Initialize the settings
Settings mySettings = new Settings();
// Set the default browser + Silverlight
mySettings.Web.DefaultBrowser = BrowserType.InternetExplorer;
mySettings.Web.EnableSilverlight = true;
mySettings.ExecutionDelay = 0;
mySettings.AnnotateExecution = false;
// Create the manager object
Manager myManager = new Manager(mySettings);
// Start the manager
myManager.Start();
// Launch a new browser instance. [This will launch an IE instance given the setting above]
myManager.LaunchNewBrowser();
// Navigate to a certain web page
myManager.ActiveBrowser.NavigateTo(_homePage);
return myManager;
}
示例6: InitizeBrowser
private void InitizeBrowser()
{
Settings mySettings = new Settings();
mySettings.DisableDialogMonitoring = true;
mySettings.Web.DefaultBrowser = BrowserType.InternetExplorer;
mySettings.Web.KillBrowserProcessOnClose = true;
var manager = new Manager(mySettings);
manager.Start();
Manager.Current.LaunchNewBrowser();
}
示例7: OneTimeSetUp
public void OneTimeSetUp()
{
Logging.LogFactory.ForceConsoleMode = true;
DataManager.DataInMemory = true;
// start nugetory server
Manager = new Manager();
Manager.Start();
}
示例8: Main
static void Main(string[] args)
{
Console.WriteLine("Please enter the target folder (will be deleted if already exists)");
var targetFolder = Console.ReadLine();
var manager = new Manager(targetFolder);
manager.Message += new MessageEventHandler(manager_Message);
manager.Start();
Console.WriteLine("Done. Press any key to exit.");
Console.ReadKey(true);
Console.Clear();
Console.Write("Unloading...");
}
示例9: InitializeBrowser
private void InitializeBrowser()
{
if (Manager.Current == null)
{
Settings mySettings = new Settings();
mySettings.Web.KillBrowserProcessOnClose = true;
mySettings.DisableDialogMonitoring = true;
mySettings.UnexpectedDialogAction = UnexpectedDialogAction.HandleAndContinue;
mySettings.Web.ExecutingBrowsers.Add(BrowserExecutionType.InternetExplorer);
mySettings.Web.Browser = BrowserExecutionType.InternetExplorer;
mySettings.Web.DefaultBrowser = BrowserType.InternetExplorer;
var manager = new Manager(mySettings);
manager.Start();
}
Manager.Current.LaunchNewBrowser();
}
示例10: OpenInternalNetworkConnections
public void OpenInternalNetworkConnections()
{
//HELPER VARIABLES
bool success = false;
while (success == false)
{
try
{
//START LISTENING TO NETWORK
networkManger2 = new Manager<InternalClient>(_host_2, _port_2);
networkManger2.Start();
success = true;
Console.WriteLine("Accpeting map connections from: {0}", _port_2);
}
catch (SocketException e)
{
if (e.ErrorCode == 10049)
{
Trace.TraceError("The ip adress {0}:{1} is not an local ip adress", _host_1, _port_1);
Console.WriteLine("The ip adress {0}:{1} is not an local ip adress", _host_1, _port_1);
Thread.Sleep(60000);
}
else if (e.ErrorCode == 10048)
{
Trace.TraceError("The port number is already in use: {0}:{1}", _host_1, _port_1);
Console.WriteLine("The port number is already in use: {0}:{1}", _host_1, _port_1);
Thread.Sleep(60000);
}
else
{
throw;
}
}
catch (FormatException)
{
Trace.TraceError("The ip adress {0}:{1} is invalid formatted", _host_1, _port_1);
Console.WriteLine("The ip adress {0}:{1} is invalid formatted", _host_1, _port_1);
Thread.Sleep(60000);
}
catch (Exception e)
{
Console.WriteLine(e);
Trace.TraceError(e.Message);
Thread.Sleep(60000);
}
}
}
示例11: 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;
}
示例12: BaseWebAiiAutomater
public BaseWebAiiAutomater(WebconfigsConfig config)
: base(config)
{
if (_manager != null)
{
foreach (var broswer in _manager.Browsers)
{
broswer.Close();
}
return;
}
var settings = new Settings(BrowserType.InternetExplorer, @"c:\log\") { ClientReadyTimeout = 60 * 1000 };
_manager = new Manager(settings);
_manager.Start();
}
示例13: InitializeBrowser
private void InitializeBrowser()
{
if (Manager.Current == null)
{
var mySettings = new Settings
{
Web = { KillBrowserProcessOnClose = true },
DisableDialogMonitoring = true,
UnexpectedDialogAction = UnexpectedDialogAction.HandleAndContinue
};
mySettings.Web.ExecutingBrowsers.Add(BrowserExecutionType.InternetExplorer);
mySettings.Web.Browser = BrowserExecutionType.InternetExplorer;
mySettings.Web.DefaultBrowser = BrowserType.InternetExplorer;
mySettings.ElementWaitTimeout = 10000;
var manager = new Manager(mySettings);
manager.Start();
}
Manager.Current.LaunchNewBrowser();
Manager.Current.ActiveBrowser.Window.Maximize();
Manager.Current.Settings.Web.RecycleBrowser = true;
}
示例14: InitializeBrowser
private void InitializeBrowser()
{
Settings mySettings = new Settings
{
Web =
{
////DefaultBrowser = BrowserType.Chrome,
DefaultBrowser = BrowserType.InternetExplorer,
////DefaultBrowser = BrowserType.FireFox,
RecycleBrowser = true,
},
AnnotateExecution = true,
CreateLogFile = true,
ExecutionDelay = 100
};
Manager manager = new Manager(mySettings);
manager.Start();
Manager.Current.LaunchNewBrowser();
Manager.Current.ActiveBrowser.Window.Maximize();
////manager.DialogMonitor.AddDialog(new ConfirmDialog(Manager.Current.ActiveBrowser, DialogButton.OK));
////manager.DialogMonitor.Start();
Manager.Current.ActiveBrowser.ClearCache(BrowserCacheType.Cookies);
}
示例15: OpenPublicNetworkConnections
public void OpenPublicNetworkConnections()
{
//HELPER VARIABLES
bool success = false;
while (success == false)
{
try
{
//START LISTENING TO NETWORK
networkManger = new Manager<LogonClient>(_host_1, _port_1);
networkManger.Start();
success = true;
Console.WriteLine("Accpeting gateway connections from: {0}", _port_1);
}
catch (SocketException e)
{
if (e.ErrorCode == 10049)
{
WriteWarning("The ip adress {0}:{1} is not an local ip adress", _host_1, _port_1);
Console.WriteLine("The ip adress {0}:{1} is not an local ip adress", _host_1, _port_1);
Thread.Sleep(60000);
}
else if (e.ErrorCode == 10048)
{
WriteWarning("The port number is already in use: {0}:{1}", _host_1, _port_1);
Console.WriteLine("The port number is already in use: {0}:{1}", _host_1, _port_1);
Thread.Sleep(60000);
}
else
{
Console.WriteLine(e);
WriteWarning("NetworkManager", e.Message);
Thread.Sleep(60000);
}
}
catch (FormatException)
{
WriteWarning("NetworkManager", "The ip adress {0}:{1} is invalid formatted", _host_1, _port_1);
Console.WriteLine("The ip adress {0}:{1} is invalid formatted", _host_1, _port_1);
Thread.Sleep(60000);
}
catch (Exception e)
{
Console.WriteLine(e);
WriteError("NetworkManager", e.Message);
Thread.Sleep(60000);
}
}
}