Пример #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);
 }
Пример #2
0
 /// <summary>
 /// Resets the Controller
 /// </summary>
 public static void ResetController()
 {
     Controller = null;
 }
Пример #3
0
 /// <summary>
 /// Easy way to get telegram bot controller cnstance
 /// </summary>
 /// <returns></returns>
 private TelegramBotController GetTelegramBotControllerInstance()
 {
     return(TelegramBotController.GetInstance(MainWindow, BotId, Username));
 }
Пример #4
0
 /// <summary>
 /// Resets all controller to get a clean restart
 /// </summary>
 public static void ResetController()
 {
     CmdController.ResetController();
     TelegramBotController.ResetController();
     Controller = null;
 }