示例#1
0
        protected override void OnStop()
        {
            base.OnStop();

            Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);

            WNOSController.Stop();
        }
示例#2
0
        protected override void OnStart(string[] args)
        {
            base.OnStart(args);

            if (string.IsNullOrEmpty(this.ServiceName))
            {
                throw new NullReferenceException("this.ServiceName");
            }

            Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);

            WNOSController.Start(this.ServiceName);
        }
示例#3
0
        public static void Main(string[] args)
        {
            try
            {
                //var exception =
                //     AFXQuerySolicitProcessor.GenerateSubmissionFile("server= SQL2008;User ID=AFX_NODE_FLOW;Password=M3morial!;database = NWIFC_ADULT_FISH",
                //                                                     "System.Data.SqlClient", null, true, "NWIFC_AFX", false, (string message) =>
                //                                                     {
                //                                                         Console.WriteLine(message);
                //                                                     },
                //                                                     out string outSubmissionFilePath, out string outValidationErrorsFilePath);
                //var exception =
                //    AFXSubmissionProcessor.ImportFile("server= SQL2008;User ID=AFX_NODE_FLOW;Password=M3morial!;database = NWIFC_ADULT_FISH",
                //                                      "System.Data.SqlClient", null, @"D:\PROJECTS\OpenNode2-git\prod-opennode2-net\private\AFX_10\AFX.xml", true, (string message) =>
                //                                      {
                //                                          Console.WriteLine(message);
                //                                      },
                //                                      out string[] importedPrimaryKeys, out string outValidationErrorsFilePath);
                Console.WriteLine("Starting server...");
                WNOSController.Start("WNOS");
                Console.WriteLine("Server started");
                Console.WriteLine();

                Console.WriteLine("Press <return> to stop server...");
                Console.ReadKey();

                Console.WriteLine();
                Console.WriteLine("Stopping server...");
                WNOSController.Stop();
                Console.WriteLine("Server stopped");
                Console.WriteLine();
            }
            catch (Exception ex)
            {
                DebugUtils.CheckDebuggerBreak();
                Console.WriteLine("\n\n\n***************************\n\n"
                                  + ex.Message
                                  + "\n\n***************************\n\n\n", ex);

                Console.WriteLine("\n\n\nERROR *********************\n\n");
            }
            finally
            {
                Console.WriteLine("Press any key to exit...");
                Console.ReadKey();
            }
        }