コード例 #1
0
        internal Engine(UWPSettings settings, Debugger debugger) : base()
        {
            _settings = settings ?? throw new ArgumentNullException(nameof(settings));

            // Initialize Debugger
            try
            {
                if (debugger == null)
                {
                    debugger = new Debugger();
                }

                _debugger     = debugger;
                this.Debugger = _debugger;

                if (!_debugger.FileLogger.IsLogging)
                {
                    // Initialize Log File
                    Assembly thisAsm = typeof(Engine).GetTypeInfo().Assembly;

                    System.Threading.Tasks.Task.Run(async() =>
                    {
                        try
                        {
                            StorageFile logFile = await thisAsm.GetStorageFile(ApplicationData.Current.LocalFolder, "Galahad.log").ConfigureAwait(false);

                            _debugger.FileLogger.StartLogging(logFile.Path, System.IO.FileMode.Append);
                        }
                        catch (Exception ex)
                        {
                            System.Diagnostics.Debug.WriteLine(ex.Message);
                            throw;
                        }
                    });
                }

                debugger = null;
            }
            finally
            {
                if (debugger != null)
                {
                    debugger.Dispose();
                }
            }
        }
コード例 #2
0
        internal static async Task <IRuntimeEngine> CreateEngine(IEngineInitializer initializer)
        {
            try
            {
                _settings = await UWPSettings.Load("Properties\\GalahadConfig.json").ConfigureAwait(false);

                Galatea.Diagnostics.DebuggerLogLevelSettings.Initialize(_settings.DebuggerLogLevel, _settings.DebuggerAlertLevel);

                _debugger = new Galahad.Robotics.Debugger();
                _engine   = new Galahad.Robotics.Engine(_settings, _debugger);
            }
            catch (Exception ex)
            {
                _debugger.ThrowSystemException(ex, _current);
                throw;
            }

            // Handle Initialization Status Updates
            _engine.InitializationStatusUpdated += initializer.OnEngineInitializationStatusUpdated;
            _engine.StartupComplete             += initializer.OnEngineStartupComplete;

            // Finalize
            return(_engine);
        }
コード例 #3
0
 internal Engine(UWPSettings settings) : this(settings, null)
 {
 }
コード例 #4
0
 public ChatbotManager(IUser user, UWPSettings settings)
 {
     alice = new Gala.Dolly.Chatbots.Alice(user, settings.ChatbotName, settings.ChatbotAliceConfigFolder, settings.ChatbotResourcesFolder);
 }