Пример #1
0
        static void Main(string[] args)
        {
            // change from service account's dir to more logical one
            Directory.SetCurrentDirectory(System.AppDomain.CurrentDomain.BaseDirectory);

            HostFactory.Run(x =>
            {
                x.RunAsLocalSystem();

                // x.SetDescription("QuoteServer");
                // x.SetDisplayName("CTP Quote Server");
                // x.SetServiceName("CTP Server Name");

                x.Service(factory =>
                {
                    CTPQuoteServer server = new CTPQuoteServer();
                    server.Initialize();
                    return(server);
                });
            });

            //CTPDataReceiver dataReceiver = new CTPDataReceiver(new CTPAccountInfo());
            //dataReceiver.Initialize();
            //dataReceiver.Run();
        }
Пример #2
0
        // private static readonly ILog logger = LogManager.GetLogger(typeof (QuartzServerFactory));

        /// <summary>
        /// Creates a new instance of an Quartz.NET server core.
        /// </summary>
        /// <returns></returns>
        public static CTPQuoteServer CreateServer()
        {
            string typeName = typeof(CTPQuoteServer).AssemblyQualifiedName;

            Type t = Type.GetType(typeName, true);

            // logger.Debug("Creating new instance of server type '" + typeName + "'");
            CTPQuoteServer retValue = (CTPQuoteServer)Activator.CreateInstance(t);

            // logger.Debug("Instance successfully created");

            return(retValue);
        }