Beispiel #1
0
 /// <summary>
 /// Returns the instance of TelegramBotController
 /// </summary>
 /// <param name="mainWindow">MainWindow needed to call methods defined in it.</param>
 /// <param name="botId">Bot ID needed to start bot</param>
 /// <param name="username">Username needed to start bot</param>
 /// <returns></returns>
 public static TelegramBotController GetInstance(MainWindow mainWindow, string botId, string username)
 {
     if (Controller == null)
     {
         Controller = new TelegramBotController(mainWindow, botId, username);
     }
     return(Controller);
 }
Beispiel #2
0
 /// <summary>
 /// Resets the Controller
 /// </summary>
 public static void ResetController()
 {
     Controller = null;
 }
Beispiel #3
0
 /// <summary>
 /// Easy way to get telegram bot controller cnstance
 /// </summary>
 /// <returns></returns>
 private TelegramBotController GetTelegramBotControllerInstance()
 {
     return(TelegramBotController.GetInstance(MainWindow, BotId, Username));
 }
Beispiel #4
0
 /// <summary>
 /// Resets all controller to get a clean restart
 /// </summary>
 public static void ResetController()
 {
     CmdController.ResetController();
     TelegramBotController.ResetController();
     Controller = null;
 }