Наследование: ICarControlsDataGenerator, IDisposable
Пример #1
0
        Program()
        {
            directInputManager = new DataGenerators.DirectInputManager();
            metrics = new Metrics();
            refreshIntervalManager = new RefreshIntervalManager();
            car = new DataGenerators.Car(directInputManager, refreshIntervalManager);

            // In order for us to see Exception instances thrown from our own (application) code
            // executing within a callback from the Diffusion SDK, we need to direct log output
            // to the Console.
            LogService.ActiveLoggerType = LoggerType.Console;
            LogService.SetThresholdForLogger(LoggerType.Console, LogSeverity.Error);

            var sessionFactory = Diffusion.Sessions
                .ConnectionTimeout(5000) // milliseconds
                .SessionErrorHandler(session_Error)
                .SessionStateChangedHandler(session_StateChanged);

            // I get SessionStateChanged event before this method returns
            string diffusionServerURL = Properties.Settings.Default.DiffusionServerURL;
            Log.Spew("Connecting to Diffusion Server at \"" + diffusionServerURL + "\"...");
            sessionFactory.Open(diffusionServerURL).Start();
        }
Пример #2
0
        Program()
        {
            directInputManager     = new DataGenerators.DirectInputManager();
            metrics                = new Metrics();
            refreshIntervalManager = new RefreshIntervalManager();
            car = new DataGenerators.Car(directInputManager, refreshIntervalManager);

            // In order for us to see Exception instances thrown from our own (application) code
            // executing within a callback from the Diffusion SDK, we need to direct log output
            // to the Console.
            LogService.ActiveLoggerType = LoggerType.Console;
            LogService.SetThresholdForLogger(LoggerType.Console, LogSeverity.Error);

            var sessionFactory = Diffusion.Sessions
                                 .ConnectionTimeout(5000) // milliseconds
                                 .SessionErrorHandler(session_Error)
                                 .SessionStateChangedHandler(session_StateChanged);

            // I get SessionStateChanged event before this method returns
            string diffusionServerURL = Properties.Settings.Default.DiffusionServerURL;

            Log.Spew("Connecting to Diffusion Server at \"" + diffusionServerURL + "\"...");
            sessionFactory.Open(diffusionServerURL).Start();
        }