public MainForm() { CaptchaEntered = new AutoResetEvent(false); InitializeComponent(); m_presenter = new MessageSendPresenter(this); m_captchaForm = new CaptchaForm(); m_newBotWindow = new NewBotWindow(); m_addTaskWindow = new AddTaskWindow(); m_insertLinkWindow = new InsertLinkWindow(); m_newBotWindow.newBotEntered += OnNewBot; m_captchaForm.CaptchaEntered += SetCapcha; m_addTaskWindow.taskEnteredEvent += OnNewTask; m_botContainer.maxValueChangedEvent += OnMaxValueChanged; m_insertLinkWindow.linkAddedEvent += OnAddNewUsers; FillBotContainer(); }
public void AddUsersForSpam(List <string> userIds, string sent, MessageSendPresenter presenter) { SQLiteCommand cmd2 = m_connection.CreateCommand(); foreach (string id in userIds) { if (!UserExist(id)) { string sqlCommandinsertRow = "INSERT INTO spam(user_id, message_sent) " + "VALUES ('" + id + "', '" + sent + "');"; cmd2.CommandText = sqlCommandinsertRow; cmd2.ExecuteNonQuery(); presenter.NewMessage("Added " + id); } else { presenter.NewMessage("Already exist " + id); } } cmd2.Dispose(); m_maxUserIdForSpamId = int.MaxValue; }
public BotWorker(TaskData task, ref DbHadler db, string login, BotControl observer, MessageSendPresenter processObserver) { m_db = db; m_task = task; Bot = new Bot(login, ref db, processObserver); m_observer = observer; m_observer.reiterationChangedIvent += MaxChanged; }