Exemplo n.º 1
0
        private void DoPublish()
        {
            // var set = Properties.Settings.Default;
            //using (new BrowserOptions(set.LoadImages, set.LoadExtensions))
            using (var browser = new IE())
            {
                browser.DialogWatcher.CloseUnhandledDialogs = false;
                // browser.ClearCache();
                browser.AutoClose = false;


                foreach (var login in _accounts)
                {
                    var controller = AdvControllerBase.CreateController(login);
                    if (controller == null)
                    {
                        continue;
                    }

                    using (controller)
                    {
                        controller.Browser   = browser;
                        controller.LogWriter = _logWriter;
                        controller.Phones    = _phones;

                        Publish(controller, login);
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void ProcessInController(Action <IAdvController> action = null, bool closeBrowser = true)
        {
            var login = SelectedItem;

            if (login == null)
            {
                return;
            }

            Publisher.DoAsync(delegate
            {
                var controller = AdvControllerBase.CreateController(login);
                if (controller == null)
                {
                    return;
                }

                using (var br = new IE {
                    AutoClose = closeBrowser
                })
                    using (controller)
                    {
                        controller.Browser   = br;
                        controller.LogWriter = _logWriter;
                        controller.DoLogin(login);
                        if (action != null)
                        {
                            action(controller);
                        }
                    }
            });
        }