Initialize() public method

public Initialize ( ) : void
return void
Ejemplo n.º 1
0
        static void Main()
        {
            ReportGenerator g = new ReportGenerator();

            g.Initialize();
            g.GenerateFluidLevelTestReport();
            g.GenerateFluidLevelTestReport();
            g.GenerateFluidLevelTestReport();

            // Initialize the user interface.
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            ApplicationInstance.MessageDlg = new ApplicationMessageDlg();
            ApplicationInstance application = new ApplicationInstance();

            application.ApplicationType   = ApplicationType.Server;
            application.ConfigSectionName = "HistoricalEventsServer";

            try
            {
                // process and command line arguments.
                if (application.ProcessCommandLine())
                {
                    return;
                }

                // check if running as a service.
                if (!Environment.UserInteractive)
                {
                    application.StartAsService(new HistoricalEventsServer());
                    return;
                }

                // load the application configuration.
                application.LoadApplicationConfiguration(false).Wait();

                // check the application certificate.
                application.CheckApplicationInstanceCertificate(false, 0).Wait();

                // start the server.
                application.Start(new HistoricalEventsServer()).Wait();

                // run the application interactively.
                Application.Run(new ServerForm(application));
            }
            catch (Exception e)
            {
                ExceptionDlg.Show(application.ApplicationName, e);
                return;
            }
        }
Ejemplo n.º 2
0
        static void Main()
        {
            ReportGenerator g = new ReportGenerator();
            g.Initialize();
            g.GenerateFluidLevelTestReport();
            g.GenerateFluidLevelTestReport();
            g.GenerateFluidLevelTestReport();

            // Initialize the user interface.
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            ApplicationInstance application = new ApplicationInstance();
            application.ApplicationType   = ApplicationType.Server;
            application.ConfigSectionName = "HistoricalEventsServer";

            try
            {
                // process and command line arguments.
                if (application.ProcessCommandLine())
                {
                    return;
                }

                // check if running as a service.
                if (!Environment.UserInteractive)
                {
                    application.StartAsService(new HistoricalEventsServer());
                    return;
                }

                // load the application configuration.
                application.LoadApplicationConfiguration(false);

                // check the application certificate.
                application.CheckApplicationInstanceCertificate(false, 0);

                // start the server.
                application.Start(new HistoricalEventsServer());

                // run the application interactively.
                Application.Run(new ServerForm(application));
            }
            catch (Exception e)
            {
                ExceptionDlg.Show(application.ApplicationName, e);
                return;
            }
        }
        /// <summary>
        /// Initializes the node manager.
        /// </summary>
        public HistoricalEventsNodeManager(IServerInternal server, ApplicationConfiguration configuration)
            :
            base(server, configuration)
        {
            SystemContext.NodeIdFactory = this;

            // set one namespace for the type model and one names for dynamically created nodes.
            string[] namespaceUrls = new string[1];
            namespaceUrls[0] = Namespaces.HistoricalEvents;
            SetNamespaces(namespaceUrls);

            // get the configuration for the node manager.
            m_configuration = configuration.ParseExtension <HistoricalEventsServerConfiguration>();

            // use suitable defaults if no configuration exists.
            if (m_configuration == null)
            {
                m_configuration = new HistoricalEventsServerConfiguration();
            }

            // initilize the report generator.
            m_generator = new ReportGenerator();
            m_generator.Initialize();
        }
        /// <summary>
        /// Initializes the node manager.
        /// </summary>
        public HistoricalEventsNodeManager(IServerInternal server, ApplicationConfiguration configuration)
        :
            base(server, configuration)
        {
            SystemContext.NodeIdFactory = this;

            // set one namespace for the type model and one names for dynamically created nodes.
            string[] namespaceUrls = new string[1];
            namespaceUrls[0] = Namespaces.HistoricalEvents;
            SetNamespaces(namespaceUrls);

            // get the configuration for the node manager.
            m_configuration = configuration.ParseExtension<HistoricalEventsServerConfiguration>();

            // use suitable defaults if no configuration exists.
            if (m_configuration == null)
            {
                m_configuration = new HistoricalEventsServerConfiguration();
            }

            // initilize the report generator.
            m_generator = new ReportGenerator();
            m_generator.Initialize();
        }