Пример #1
0
        private void Execute()
        {
            try
            {
                Reset();

                _pull = new Pull(null);
                if (Pull.LibraryExists)
                {
                    SetDone("Library exists.");
                }
                else
                {
                    if (Program.Start.PullBytes != null)
                    {
                        _pull.Extract(Program.Start.PullBytes);
                        SetDone("Done.");
                    }
                    else
                    {
                        TryPull();
                    }
                }
            }
            catch (Exception ex)
            {
                _exception = ex;
                SetFailed();
            }
        }
Пример #2
0
        private void SetFailed()
        {
            if (_exception != null)
            {
                // Log.LogUse(59, _exception.Message);
            }
            else
            {
                // Log.LogUse(59);
            }

            _ctrDone.ThreadSafeInvoke(() =>
            {
                _ctrDone.Visible    = false;
                _linkFailed.Visible = true;
                _iconAjax.Visible   = false;
                Start.EnableLink(_linkNext);
                _btnPull.Text = "Pull again";
                Start.EnableButton(_btnPull);
                ToggleIconOK(false);

                if (!Pull.LibraryExists)
                {
                    _ctrErrorMessage.Visible     = true;
                    _ctrQueryTalkVersion.Visible = false;
                }
                else
                {
                    _ctrQueryTalkVersion.Text    = String.Format("QueryTalk {0}", Pull.GetClientLibVersion());
                    _ctrQueryTalkVersion.Visible = true;
                }

                _HandleNavigation();
            });
        }
Пример #3
0
        // NOT IN USE
        private void CheckVersions()
        {
            var token = new CancellationTokenSource();

            Task.Factory.StartNew(() =>
            {
                Exception exception;

                try
                {
                    var pull          = new Pull(token);
                    var serverVersion = pull.GetServerVersion(out exception);
                    if (exception == null)
                    {
                        // lib
                        if (_start.RepositoryPath != null)
                        {
                            if (Pull.GetClientLibVersion() != Common.NoFile)
                            {
                                if (serverVersion.CompareToLibVersion(Pull.GetClientLibVersion()) == 1)
                                {
                                    ShowLibraryNotification(true, String.Format("New library version {0} is available", serverVersion.LibVersion));
                                }
                            }
                        }
                    }
                }
                catch { }
            }, token.Token);
        }
Пример #4
0
        private void SetDone(string message)
        {
            // Log.LogUse(58);

            _iconOK.ThreadSafeInvoke(() =>
            {
                _ctrDone.Text    = message;
                _ctrDone.Visible = true;
                ToggleIconOK(true);
                Start.EnableLink(_linkNext);
                _linkFailed.Visible = false;
                _iconAjax.Visible   = false;
                _btnPull.Text       = "Pull again";
                Start.EnableButton(_btnPull);
                Start.EnableLink(_linkRepository);
                _ctrQueryTalkVersion.Text    = String.Format("QueryTalk {0}", Pull.GetClientLibVersion());
                _ctrQueryTalkVersion.Visible = true;

                _HandleNavigation();
            });
        }