public void LaunchService()
 {
     ServiceStatus = BaseServicesStatuses.ServiceLaunching;
     try
     {
         _c = new ChromeDriverResolver(_driverTasks, Proxy, settings.BaseUrl, _l);
         if (!_c.Initialize())
         {
             ServiceStatus = BaseServicesStatuses.ServiceError;
             return;
         }
         Thread.Sleep(15000);
         _c.UpdateFieldData("#username", settings.Login);
         _c.UpdateFieldData("#password", settings.Password);
         _c.ExecuteScript("document.getElementById('form1').submit()");
         Thread.Sleep(5000);
         ServiceStatus = BaseServicesStatuses.ServiceLaunched;
     }
     catch (Exception e)
     {
         ServiceStatus = BaseServicesStatuses.ServiceError;
         _l.error($"[ShareAsaleService] An exception occured, during initializing chrome driver: {e.Message} -> {e.StackTrace}");
         _c?.Dispose();
     }
 }
        private void ProcessLinks()
        {
            if (ShareLockLogic)
            {
                return;
            }
            // if (!ReferenceEquals(ServiceStatus, BaseServicesStatuses.ServiceLaunched))
            // {
            //     return;
            // }
            if (ReferenceEquals(_tasks, null) || _tasks.Count.Equals(0))
            {
                return;
            }
            if (ReferenceEquals(_tasks.Where(t => ReferenceEquals(t.GeneratedUrl, null) || t.GeneratedUrl.Equals(String.Empty)).ToList(), 0))
            {
                return;
            }
            ShareLockLogic = true;
            var tasks = _tasks.Where(t => ReferenceEquals(t.GeneratedUrl, null) || t.GeneratedUrl.Equals(String.Empty)).ToList();

            foreach (var task in tasks)
            {
                if (!ReferenceEquals(_c, null))
                {
                    _c.NavigateToPage(settings.RequestPageUrl);
                    _c.UpdateFieldData("#destinationURL", task.RequestUrl);
                    _c.ExecuteScript("document.getElementById('buildLinkFrm').children[7].children[0].click()");
                    bool solved  = false;
                    int  safe    = 10;
                    int  current = 0;
                    while (!solved && current <= safe)
                    {
                        Thread.Sleep(500);
                        var currentContext = _c.GetDataFromPage(null, "return getUrl(); function getUrl(){return document.getElementById(\"buildLinkFrm\").children[7].children[0].getAttribute(\"value\");}").Trim();
                        if (currentContext.Equals("Create Custom Link"))
                        {
                            current++;
                        }
                        else
                        {
                            break;
                        }
                    }
                    task.GeneratedUrl = _c.GetDataFromPage(null, "return getUrl(); function getUrl(){return document.getElementById(\"buildLinkFrm\").children[7].children[0].getAttribute(\"value\");}");
                    lock (locker)
                    {
                        var _selected = _tasks.FirstOrDefault(t => t.RequestUrl.Equals(task.RequestUrl));
                        if (!ReferenceEquals(_selected, null))
                        {
                            _selected.GeneratedUrl = _c.GetDataFromPage(null, "return getUrl(); function getUrl(){return document.getElementById(\"buildLinkFrm\").children[7].children[0].getAttribute(\"value\");}");
                        }
                    }
                }
            }
            ShareLockLogic = false;
            // ProcessLinks();
        }