示例#1
0
        public OwnerWrapper(IAnkhDialogOwner owner)
        {
            if (owner == null)
            {
                throw new ArgumentNullException("owner");
            }

            _owner = owner;
        }
示例#2
0
            /// <summary>
            /// Call this to start the operation.
            /// </summary>
            /// <param name="caption">The caption to use in the progress dialog.</param>
            public void Start(string caption)
            {
                Thread           thread      = new Thread(new ParameterizedThreadStart(this.Run));
                ISvnClientPool   pool        = GetService <ISvnClientPool>();
                IAnkhDialogOwner dialogOwner = GetService <IAnkhDialogOwner>();

                using (ProgressDialog dialog = new ProgressDialog())
                    using (SvnClient client = pool.GetClient())
                        using (CreateUpdateReport ? BindOutputPane(client) : null)
                            using (dialog.Bind(client))
                            {
                                _sync          = dialog;
                                dialog.Caption = caption;
                                dialog.Context = this;
                                thread.Name    = "AnkhSVN Worker";
                                bool threadStarted = false;

                                dialog.HandleCreated += delegate
                                {
                                    if (!threadStarted)
                                    {
                                        threadStarted = true;
                                        thread.Start(client);
                                    }
                                };
                                _invoker = dialog;

                                do
                                {
                                    if (!_closed)
                                    {
                                        dialog.ShowDialog(this);
                                    }
                                    else
                                    {
                                        Application.DoEvents();
                                    }

                                    // Show the dialog again if the thread join times out
                                    // Do this to handle the acase where the service wants to
                                    // pop up a dialog before canceling.

                                    // BH: Experienced this 2008-09-29 when our repository server
                                    //     accepted http connections but didn't handle them in time
                                }while (!thread.Join(2500));
                            }
                if (_cancelled)
                {
                    // NOOP
                }
                else if (_exception != null)
                {
                    throw new ProgressRunnerException(this._exception);
                }
            }
示例#3
0
        protected override IDisposable DialogRunContext(IAnkhServiceProvider context)
        {
            IAnkhDialogOwner owner = null;

            if (context != null)
            {
                owner = context.GetService <IAnkhDialogOwner>();
            }

            if (owner != null)
            {
                return(owner.InstallFormRouting(this, EventArgs.Empty));
            }
            else
            {
                return(base.DialogRunContext(context));
            }
        }
示例#4
0
        public OwnerWrapper(IAnkhDialogOwner owner)
        {
            if (owner == null)
                throw new ArgumentNullException("owner");

            _owner = owner;
        }