Example #1
0
 public Host(FormMain mainForm)
 {
     _app      = new App();
     _core     = new Core(mainForm);
     _ui       = new Ui(mainForm);
     _database = new Db();
 }
Example #2
0
        public MyControl()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
            {
                return;
            }

            try
            {
                HostApp = Factory.Create <IHostApp>();

                InitializeComponent();

                RecentFilesHelper.Instance.ExecuteInGUIThread = this.ExecuteInGUIThread;
                this.Model.ExecuteInGUIThread = this.ExecuteInGUIThread;

                this.Model.FetchRecentFiles();
            }
            catch (CSScriptViewModel.CSSNotFoundException)
            {
                //the control already has the status label properly set
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message, "CS-Script Tools");
            }
        }
Example #3
0
		public Host(FormMain mainForm)
        {
            _app = new App();
            _core = new Core(mainForm);
            _ui = new Ui(mainForm);
            _database = new Db();
        }
Example #4
0
        public static void Init(IHostApp app)
        {
            if (hostApp != null)
            {
                hostApp.Log(LogType.WRN, "ZoomMeetingBotSDK.Sound: Already Initialized");
                return;
            }

            hostApp = app;

            cfg = DeserializeJson <SoundConfigurationSettings>(hostApp.GetSettingsAsJSON());

            hostApp.Log(LogType.DBG, "Initializing TTS");
            tts = new SpeechSynthesizer();
            var voice = cfg.TTSVoice;

            if ((voice != null) && (voice.Length > 0))
            {
                try
                {
                    tts.SelectVoice(voice);
                }
                catch (Exception e)
                {
                    hostApp.Log(LogType.ERR, "TTS failed to load voice {0}; Falling back on default; Err={1}", voice, repr(e));
                }
            }
            hostApp.Log(LogType.INF, "TTS Loaded voice {0}", repr(tts.Voice.Name));
            tts.SetOutputToDefaultAudioDevice();
            timer = new System.Threading.Timer(TimerHandler, null, 0, 250);
        }
Example #5
0
        public void Init(ChatBotInitParam param)
        {
            if (hostApp != null)
            {
                hostApp.Log(LogType.WRN, "chatBot already initialized");
            }

            hostApp = param.hostApp;
        }
Example #6
0
        public void Init(ChatBotInitParam param)
        {
            if (hostApp != null)
            {
                hostApp.Log(LogType.WRN, $"SimpleBot.Start(): Already initialized");
                return;
            }

            hostApp = param.hostApp;
            hostApp.SettingsChanged += new EventHandler(SettingsChanged);

            LoadSettings();
        }
Example #7
0
        public static void SetCallback(IHostApp cb)
        {
            Callback = cb;

            try
            {
                if (!Directory.Exists(DataPath))
                {
                    Directory.CreateDirectory(DataPath);
                }
            }
            catch { }
        }
Example #8
0
 public static void SetCallback(IHostApp cb)
 {
     Callback = cb;
 }
Example #9
0
 public ServerEvents(IHostApp cb)
 {
     Server.SetCallback(cb);
 }
 public void Run(IHostApp app)
 {
     app.ShowMessage($"Hello from {Assembly.GetExecutingAssembly().GetName().FullName}");
 }