Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
 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;
 }