Пример #1
0
        public virtual bool Send()
        {
            if (!Program2.SiteOptions.NetworkEnabled)
            {
                return(false);
            }

            progress = ProgressScreen.RegisterOperation();

            try
            {
                // If security is turned on, We need to have an Index from the server in order to proceed
                if (secure && Community.SymmetricIndex == null)
                {
                    Hello hello = new Hello(Callback_Hello, null);
                    return(hello.Send());
                }
                else
                {
                    if (ISend())
                    {
                        return(true);
                    }
                    else
                    {
                        progress.Complete();
                        return(false);
                    }
                }
            }
            catch
            {
                progress.Complete();
                return(false);
            }
        }
Пример #2
0
        private void OnComplete(object param)
        {
            progress.Complete();

            if (aborted)
            {
                return;
            }

            if (canceled)
            {
                WebRequestCompleteArg arg = new WebRequestCompleteArg();
                arg.result = WebResult.ErrCanceled;
                param      = arg;
            }
            else if (param == null)
            {
                WebRequestCompleteArg arg = new WebRequestCompleteArg();
                arg.result = WebResult.ErrConnectFailed;
                param      = arg;
            }

            EnqueueCompletion(this, param);
        }