Ejemplo n.º 1
0
 public void DeleteTask(KonsulatTask visaTask)
 {
     if (_cityTasks.ContainsKey(visaTask.CityV))
     {
         EKonsulatTab visaTab = _cityTasks[visaTask.CityV];
         visaTab.CheckOnDeleteTask(visaTask);
     }
 }
Ejemplo n.º 2
0
 void ValueVisaEvent(EKonsulatTab tab, bool add)
 {
     if (add)
     {
         _activeTabs.Add(tab);
     }
     else
     {
         _activeTabs.Remove(tab);
     }
 }
Ejemplo n.º 3
0
        void _timer_Tick(object sender, EventArgs e)
        {
            foreach (string s in _toRemove)
            {
                _cityTasks.Remove(s);
            }
            _toRemove.Clear();

            EKonsulatTab tab = GetVisaTabToStep();

            if (tab != null)
            {
                tab.DoStep();
            }
//            foreach (KeyValuePair<string, VisaTab> keyValuePair in _cityTasks)
//            {
//                keyValuePair.Value.DoStep();
//            }
        }
Ejemplo n.º 4
0
        public void RefreshViewTabs()
        {
            _timer.Stop();
//            SetProxy();
            foreach (KonsulatTask vt in _visaTasks)
            {
                if (!_cityTasks.ContainsKey(vt.CityV))
                {
                    Logger.Info("Создаю новый таб " + vt.City);
                    TabPage tabPage = new TabPage(vt.CityV);
                    tabPage.Name = vt.City;
                    WebBrowser webBrowser1 = new WebBrowser();
                    webBrowser1.Size     = new Size(837, 400);
                    webBrowser1.Dock     = DockStyle.Top;
                    webBrowser1.Location = new Point(0, 0);
                    webBrowser1.Name     = "webBrowser" + vt.City;
                    tabPage.Controls.Add(webBrowser1);

                    Button deleteTask = new Button();
                    deleteTask.Location = new System.Drawing.Point(200, 400);
                    deleteTask.Name     = "deleteTask";
                    deleteTask.Size     = new System.Drawing.Size(200, 40);
                    deleteTask.TabIndex = 4;
                    deleteTask.Text     = "Удалить задачу";
                    deleteTask.UseVisualStyleBackColor = true;
                    deleteTask.Visible = false;
                    tabPage.Controls.Add(deleteTask);

                    Button renewTask = new Button();
                    renewTask.Location = new System.Drawing.Point(650, 400);
                    renewTask.Name     = "renewTask";
                    renewTask.Size     = new System.Drawing.Size(200, 40);
                    renewTask.TabIndex = 4;
                    renewTask.Text     = "Возобновить задачу";
                    renewTask.UseVisualStyleBackColor = true;
                    renewTask.Visible = false;
                    tabPage.Controls.Add(renewTask);

                    RichTextBox richText = new RichTextBox();
                    richText.Name     = "richText";
                    richText.Font     = new Font("Arial", 10F, FontStyle.Bold, GraphicsUnit.Point, ((byte)(204)));
                    richText.Location = new Point(0, 451);
                    richText.Size     = new Size(837, 200);
                    richText.Dock     = DockStyle.Bottom;
                    tabPage.Controls.Add(richText);

                    SetTabHeader(tabPage, Color.LightGreen);
                    _tabControl.TabPages.Add(tabPage);

                    EKonsulatTab visaTab = new EKonsulatTab(vt, tabPage);
                    _cityTasks.Add(vt.CityV, visaTab);
                }
                else
                {
                    EKonsulatTab tab = _cityTasks[vt.CityV];
                    if (!tab.Tasks.Contains(vt))
                    {
                        tab.Tasks.Add(vt);
                    }
                }
            }

            foreach (KeyValuePair <string, EKonsulatTab> pair in _cityTasks)
            {
                pair.Value.TaskEvent         -= Value_TaskEvent;
                pair.Value.TaskEvent         += Value_TaskEvent;
                pair.Value.TabEvent          -= Value_TabEvent;
                pair.Value.TabEvent          += Value_TabEvent;
                pair.Value.TabEventEx        -= Value_TabEventEx;
                pair.Value.TabEventEx        += Value_TabEventEx;
                pair.Value.VisaEvent         -= ValueVisaEvent;
                pair.Value.VisaEvent         += ValueVisaEvent;
                pair.Value.GetNextProxyEvent -= Value_GetNextProxyEvent;
                pair.Value.GetNextProxyEvent += Value_GetNextProxyEvent;
            }
            _timer.Start();
        }