Ejemplo n.º 1
0
 void InitPages()
 {
     VirtualAssistant.Logger.Info("Initializing pages...");
     SplashScreenHelper.SetSplashScreenStatus("Initializing pages...");
     try
     {
         navigationFrame.Pages.BeginUpdate();
         navigationFrame.Pages.Add(CreateNavigationPage(CONVERSATION_PAGE, new ConversationPanel()));
         navigationFrame.Pages.Add(CreateNavigationPage(FLAGGAME_PAGE, new FlagGamePanel()));
         // navigationFrame.Pages.Add(CreateNavigationPage(PHOTOGALLERY_PAGE, new PhotoGalleryrPanel()));
     }
     finally
     {
         navigationFrame.Pages.EndUpdate();
     }
     navigationBar.SelectedItem = navigationBar.Items[0];
 }
Ejemplo n.º 2
0
        void InitBot()
        {
            VirtualAssistant.Logger.Info("Initializing bot...");
            SplashScreenHelper.SetSplashScreenStatus("Initializing bot...");
            VirtualAssistant.Plugins.Add(new SimlPlugin(DataDirectoryHelper.GetRelativeDirectoryPath("Data\\Resources\\SimlProject")));
            VirtualAssistant.Plugins.Add(new DSearchPlugin());
            VirtualAssistant.Plugins.Add(new WordNetPlugin(DataDirectoryHelper.GetRelativeDirectoryPath("Data\\Resources\\WordNet")));
            VirtualAssistant.Plugins.Add(new WikipediaPlugin());
            VirtualAssistant.Plugins.Add(new KJBiblePlugin());
            VirtualAssistant.Speech.Synthesizers.Add(new InBuiltSpeechSynthesizer());
            VirtualAssistant.Speech.Recognizers.Add(new InBuiltSpeechRecognizer(searchControl));
            VirtualAssistant.Speech.Synthesizers.Select("InBuilt");
            VirtualAssistant.Interaction.ResponseReceived += OnResponseReceived;
            VirtualAssistant.Interaction.MessageReceived  += OnMessageReceived;

            // Update user name
            VirtualAssistant.Plugins.GetPluginByType <SimlPlugin>().Bot.MainUser.Settings["Name"].Value    = CurrentProfile.FirstName;
            VirtualAssistant.Plugins.GetPluginByType <SimlPlugin>().Bot.MainUser.Settings["Name"].Changed += (s, e) =>
            {
                CurrentProfile.FirstName = VirtualAssistant.Plugins.GetPluginByType <SimlPlugin>().Bot.MainUser.Settings["Name"].Value;
            };
        }