예제 #1
0
파일: DB.cs 프로젝트: Fedorm/core-master
        void SyncComplete(object sender, ISyncEventArgs e)
        {
            ControlsContext.Current.ActionHandlerLocker.Release();

            var common = (ICommonData)_context.ValueStack.Values["common"];

            common.SyncIsOK = e.Ok;

            DbContext.Current.Database.SyncComplete(e.Ok);

            if (_handler != null)
            {
                _context.InvokeOnMainThread(() =>
                {
                    _handler.ExecuteCallback(_scriptEngine.Visitor, _state, null);
                    _state   = null;
                    _handler = null;
                });
            }

            if (!e.Ok)
            {
                LastError = e.Exception.Message;
                _context.HandleException(e.Exception);
            }
        }
예제 #2
0
        public async void Alert(object message, IJsExecutable handler, object value, object positiveText, object negativeText,
            object neutralText)
        {
            ControlsContext.Current.ActionHandlerLocker.Acquire();
            try
            {
                string msg = ObjToString(message);

                var positiveButtonText = ObjToString(positiveText);
                var positive = new DialogButton(positiveButtonText);

                DialogButton negative = null;
                if (negativeText != null)
                    negative = new DialogButton(_context.Dal.TranslateString(negativeText.ToString()));

                DialogButton neutral = null;
                if (neutralText != null)
                    neutral = new DialogButton(_context.Dal.TranslateString(neutralText.ToString()));

                int number = await _context.DialogProvider.Alert(msg, positive, negative, neutral);
                if (handler != null)
                    handler.ExecuteCallback(_scriptEngine.Visitor, value, new Args<int>(number));
            }
            finally
            {
                ControlsContext.Current.ActionHandlerLocker.Release();
            }
        }
예제 #3
0
        public async void Alert(object message, IJsExecutable handler, object value, object positiveText, object negativeText,
                                object neutralText)
        {
            ControlsContext.Current.ActionHandlerLocker.Acquire();
            try
            {
                string msg = ObjToString(message);

                var positiveButtonText = ObjToString(positiveText);
                var positive           = new DialogButton(positiveButtonText);

                DialogButton negative = null;
                if (negativeText != null)
                {
                    negative = new DialogButton(_context.Dal.TranslateString(negativeText.ToString()));
                }

                DialogButton neutral = null;
                if (neutralText != null)
                {
                    neutral = new DialogButton(_context.Dal.TranslateString(neutralText.ToString()));
                }

                int number = await _context.DialogProvider.Alert(msg, positive, negative, neutral);

                if (handler != null)
                {
                    handler.ExecuteCallback(_scriptEngine.Visitor, value, new Args <int>(number));
                }
            }
            finally
            {
                ControlsContext.Current.ActionHandlerLocker.Release();
            }
        }
예제 #4
0
        private async void AnyDateTimeDialog(DateTimeDialog func, object caption, DateTime current
                                             , IJsExecutable positiveHandler, object positiveValue, IJsExecutable negativeHandler, object negativeValue)
        {
            ControlsContext.Current.ActionHandlerLocker.Acquire();
            try
            {
                string capt = ObjToString(caption);

                var ok     = new DialogButton(D.OK);
                var cancel = new DialogButton(D.CANCEL);

                IDialogAnswer <DateTime> answer = await func(capt, current, ok, cancel);

                IJsExecutable handler = answer.Positive ? positiveHandler : negativeHandler;
                object        value   = answer.Positive ? positiveValue : negativeValue;

                if (handler != null)
                {
                    handler.ExecuteCallback(_scriptEngine.Visitor, value, new Args <DateTime>(answer.Result));
                }
            }
            finally
            {
                ControlsContext.Current.ActionHandlerLocker.Release();
            }
        }
예제 #5
0
        public async void Ask(object message
                              , IJsExecutable positiveHandler, object positiveValue, IJsExecutable negativeHandler, object negativeValue)
        {
            ControlsContext.Current.ActionHandlerLocker.Acquire();

            try
            {
                string msg = ObjToString(message);

                var yes = new DialogButton(D.YES);
                var no  = new DialogButton(D.NO);

                bool positive = await _context.DialogProvider.Ask(msg, yes, no);

                IJsExecutable handler = positive ? positiveHandler : negativeHandler;
                object        value   = positive ? positiveValue : negativeValue;

                if (handler != null)
                {
                    handler.ExecuteCallback(_scriptEngine.Visitor, value, new Args <Result>(positive ? Result.Yes : Result.No));
                }
            }
            finally
            {
                ControlsContext.Current.ActionHandlerLocker.Release();
            }
        }
예제 #6
0
        public async void Post(string query, string data, IJsExecutable callback, object state)
        {
            using (var req = CreateRequest())
            {
                try
                {
                    var content = new StringContent(data);
                    var r       = await req.PostAsync(query, content);

                    if (callback != null)
                    {
                        string result = await r.Content.ReadAsStringAsync();

                        callback.ExecuteCallback(_scriptEngine.Visitor, state, new WebRequestArgs(result));
                    }
                }
                catch (WebException e)
                {
                    HandleException(callback, state, e);
                }
                catch (TaskCanceledException e)
                {
                    HandleException(callback, state, new WebException("", WebExceptionStatus.Timeout));
                }
            }
        }
예제 #7
0
파일: Email.cs 프로젝트: Fedorm/core-master
        public async void Create(object address, string text, string subject, object attachments
                                 , IJsExecutable handler, object state)
        {
            string[] destinations = ObjectToStringArray(address);
            var      paths        = new List <string>();

            // ReSharper disable once LoopCanBeConvertedToQuery
            foreach (var item in ObjectToStringArray(attachments))
            {
                if (!string.IsNullOrWhiteSpace(item))
                {
                    try
                    {
                        paths.Add(IOContext.Current.TranslateLocalPath(item));
                    }
                    catch (NonFatalException)
                    {
                    }
                }
            }


            await _applicationContext.EmailProvider.OpenEmailManager(destinations, subject, text, paths.ToArray());

            if (handler != null)
            {
                handler.ExecuteCallback(_scriptEngine.Visitor, state, new Args <object>(null));
            }
        }
예제 #8
0
        // ReSharper disable once MemberCanBePrivate.Global
        public async void Feedback(string title, string text, IJsExecutable handler, object value)
        {
            bool result = await LogManager.Reporter.Send(title, text, ReportType.Feedback);

            if (handler != null)
            {
                _context.InvokeOnMainThread(
                    () => handler.ExecuteCallback(_scriptEngine.Visitor, value, new Args <bool>(result)));
            }
        }
예제 #9
0
        public void Scan(IJsExecutable handler, object value)
        {
            Action<object> callback = result =>
                {
                    if (handler != null)
                        // todo: change api to universal format
                        handler.ExecuteCallback(_scriptEngine.Visitor, result, value);
                };

            _context.ScanBarcode(callback);
        }
예제 #10
0
        public void Copy(string destinationPath, IJsExecutable callback, object state)
        {
            string path = IOContext.Current.TranslateLocalPath( destinationPath);

            Action<bool> handler;
            if (callback != null)
                handler = result =>
                    callback.ExecuteCallback(_scriptEngine.Visitor, state, new CallbackArgs(result));
            else
                handler = result => { };

            _context.GalleryProvider.Copy(path, Size, handler);
        }
예제 #11
0
        public void Scan(IJsExecutable handler, object value)
        {
            Action <object> callback = result =>
            {
                if (handler != null)
                {
                    // todo: change api to universal format
                    handler.ExecuteCallback(_scriptEngine.Visitor, result, value);
                }
            };

            _context.ScanBarcode(callback);
        }
예제 #12
0
        private void HandleException(IJsExecutable callback, object state, WebException e)
        {
            var error = new WebError(e);

            if (callback != null)
            {
                callback.ExecuteCallback(_scriptEngine.Visitor, state, new WebRequestArgs(error));
            }
            else
            {
                LogManager.Logger.Error(error.Message, false);
            }
        }
예제 #13
0
        public void MakeSnapshot(string path, int size, IJsExecutable callback, object state)
        {
            string p = IOContext.Current.TranslateLocalPath(path);

            Action<bool> handler;
            if (callback != null)
                handler = result =>
                    callback.ExecuteCallback(_scriptEngine.Visitor, state, new CallbackArgs(result));
            else
                handler = res => { };

            _context.CameraProvider.MakeSnapshot(p, size, handler);
        }
예제 #14
0
        public async void Question(string message, IJsExecutable handler, object value)
        {
            message = _context.Dal.TranslateString(message);

            var yes = new DialogButton(D.YES);
            var no  = new DialogButton(D.NO);

            bool positive = await _context.DialogProvider.Ask(message, yes, no);

            if (handler != null)
            {
                handler.ExecuteCallback(_scriptEngine.Visitor, positive ? Result.Yes : Result.No, value);
            }
        }
예제 #15
0
        public async void ShowTime(string caption, DateTime current, IJsExecutable handler, object value)
        {
            caption = _context.Dal.TranslateString(caption);

            var ok     = new DialogButton(D.OK);
            var cancel = new DialogButton(D.CANCEL);

            IDialogAnswer <DateTime> answer = await _context.DialogProvider.Time(caption, current, ok, cancel);

            if (handler != null)
            {
                handler.ExecuteCallback(_scriptEngine.Visitor, answer.Result, value);
            }
        }
예제 #16
0
        public async void Select(string caption, object items, IJsExecutable handler, object value)
        {
            KeyValuePair <object, string>[] rows = PrepareSelection(items);

            caption = _context.Dal.TranslateString(caption);

            var ok = new DialogButton(D.OK);

            var cancel = new DialogButton(D.CANCEL);

            IDialogAnswer <object> answer = await _context.DialogProvider.Choose(caption, rows, 0, ok, cancel);

            if (handler != null)
            {
                handler.ExecuteCallback(_scriptEngine.Visitor, answer.Result, value);
            }
        }
예제 #17
0
        public void Copy(string destinationPath, IJsExecutable callback, object state)
        {
            string path = IOContext.Current.TranslateLocalPath(destinationPath);

            Action <bool> handler;

            if (callback != null)
            {
                handler = result =>
                          callback.ExecuteCallback(_scriptEngine.Visitor, state, new CallbackArgs(result));
            }
            else
            {
                handler = result => { }
            };

            _context.GalleryProvider.Copy(path, Size, handler);
        }
예제 #18
0
        public void MakeSnapshot(string path, int size, IJsExecutable callback, object state)
        {
            string p = IOContext.Current.TranslateLocalPath(path);

            Action <bool> handler;

            if (callback != null)
            {
                handler = result =>
                          callback.ExecuteCallback(_scriptEngine.Visitor, state, new CallbackArgs(result));
            }
            else
            {
                handler = res => { }
            };

            _context.CameraProvider.MakeSnapshot(p, size, handler);
        }
예제 #19
0
        public async void Message(object message, IJsExecutable handler, object value)
        {
            ControlsContext.Current.ActionHandlerLocker.Acquire();
            try
            {
                string msg = ObjToString(message);

                var close = new DialogButton(D.CLOSE);

                await _context.DialogProvider.Message(msg, close);

                if (handler != null)
                {
                    handler.ExecuteCallback(_scriptEngine.Visitor, value, new Args <object>(null));
                }
            }
            finally
            {
                ControlsContext.Current.ActionHandlerLocker.Release();
            }
        }
예제 #20
0
파일: Email.cs 프로젝트: Fedorm/core-master
        public async void Create(object address, string text, string subject, object attachments
            , IJsExecutable handler, object state)
        {
            string[] destinations = ObjectToStringArray(address);
            var paths = new List<string>();
            // ReSharper disable once LoopCanBeConvertedToQuery
            foreach (var item in ObjectToStringArray(attachments))
                if (!string.IsNullOrWhiteSpace(item))
                    try
                    {
                        paths.Add(IOContext.Current.TranslateLocalPath(item));
                    }
                    catch (NonFatalException)
                    {
                    }


            await _applicationContext.EmailProvider.OpenEmailManager(destinations, subject, text, paths.ToArray());
            if (handler != null)
                handler.ExecuteCallback(_scriptEngine.Visitor, state, new Args<object>(null));
        }
예제 #21
0
        private async void InvokeAsync(Action callback, IJsExecutable handler, object state)
        {
            ControlsContext.Current.ActionHandlerLocker.Acquire();

            _lastException = null;

            try
            {
                await Task.Run(callback);

                SuccessSync = true;
            }
            catch (Exception e)
            {
                _lastException = e;
                SuccessSync    = false;
            }
            finally
            {
                LastSyncTime = DateTime.Now;
                WriteFsLog();

                ControlsContext.Current.ActionHandlerLocker.Release();

                if (handler != null)
                {
                    _io.InvokeOnMainThread(() =>
                    {
                        var args = new EventArgs {
                            State = state, Result = _lastException == null
                        };
                        handler.ExecuteCallback(_scriptEngine.Visitor, args, null);

                        handler = null;
                        state   = null;
                    });
                }
            }
        }
예제 #22
0
        public async void Get(string query, IJsExecutable callback, object state)
        {
            using (var req = CreateRequest())
            {
                try
                {
                    var result = await req.GetStringAsync(query);

                    if (callback != null)
                    {
                        callback.ExecuteCallback(_scriptEngine.Visitor, state, new WebRequestArgs(result));
                    }
                }
                catch (WebException e)
                {
                    HandleException(callback, state, e);
                }
                catch (TaskCanceledException e)
                {
                    HandleException(callback, state, new WebException("", WebExceptionStatus.Timeout));
                }
            }
        }
예제 #23
0
        public async void Choose(object caption, object items, object startKey
                                 , IJsExecutable positiveHandler, object positiveValue, IJsExecutable negativeHandler, object negativeValue)
        {
            ControlsContext.Current.ActionHandlerLocker.Acquire();
            try
            {
                KeyValuePair <object, string>[] rows = PrepareSelection(items);
                int index = 0;
                for (int i = 0; i < rows.Length; i++)
                {
                    if (rows[i].Key.Equals(startKey))
                    {
                        index = i;
                        break;
                    }
                }

                string capt = ObjToString(caption);

                var ok     = new DialogButton(D.OK);
                var cancel = new DialogButton(D.CANCEL);

                IDialogAnswer <object> answer = await _context.DialogProvider.Choose(capt, rows, index, ok, cancel);

                IJsExecutable handler = answer.Positive ? positiveHandler : negativeHandler;
                object        value   = answer.Positive ? positiveValue : negativeValue;

                if (handler != null)
                {
                    handler.ExecuteCallback(_scriptEngine.Visitor, value, new KeyValueArgs <object, string>(answer.Result, rows));
                }
            }
            finally
            {
                ControlsContext.Current.ActionHandlerLocker.Release();
            }
        }
예제 #24
0
 public void Select(string caption, object items, IJsExecutable handler)
 {
     Select(caption, items, handler, null);
 }
예제 #25
0
 public void ShowTime(string caption, DateTime current, IJsExecutable handler)
 {
     ShowTime(caption, current, handler, null);
 }
예제 #26
0
 public void ShowTime(string caption, IJsExecutable handler)
 {
     ShowTime(caption, System.DateTime.Now, handler, null);
 }
예제 #27
0
 public void Alert(object message, IJsExecutable handler, object value, object positiveText, object negativeText)
 {
     Alert(message, handler, value, positiveText, negativeText, null);
 }
예제 #28
0
 public void Question(string message, IJsExecutable handler)
 {
     Question(message, handler, null);
 }
예제 #29
0
 public void Choose(object caption, object items, object startKey, IJsExecutable positiveHandler, object positiveValue, IJsExecutable negativeHandler)
 {
     Choose(caption, items, startKey, positiveHandler, positiveValue, negativeHandler, null);
 }
예제 #30
0
 public void Choose(object caption, object items, object startKey, IJsExecutable positiveHandler, object positiveValue, IJsExecutable negativeHandler)
 {
     Choose(caption, items, startKey, positiveHandler, positiveValue, negativeHandler, null);
 }
예제 #31
0
 public void Time(object caption, DateTime current
     , IJsExecutable positiveHandler, object positiveValue, IJsExecutable negativeHandler, object negativeValue)
 {
     AnyDateTimeDialog(_context.DialogProvider.Time, caption, current
         , positiveHandler, positiveValue, negativeHandler, negativeValue);
 }
예제 #32
0
 public void ShowTime(string caption, IJsExecutable handler, object value)
 {
     ShowTime(caption, System.DateTime.Now, handler, value);
 }
예제 #33
0
 public void ShowTime(string caption, IJsExecutable handler)
 {
     ShowTime(caption, System.DateTime.Now, handler, null);
 }
예제 #34
0
 public void Alert(object message, IJsExecutable handler, object value, object positiveText, object negativeText)
 {
     Alert(message, handler, value, positiveText, negativeText, null);
 }
예제 #35
0
        public async void Question(string message, IJsExecutable handler, object value)
        {
            message = _context.Dal.TranslateString(message);

            var yes = new DialogButton(D.YES);
            var no = new DialogButton(D.NO);

            bool positive = await _context.DialogProvider.Ask(message, yes, no);

            if (handler != null)
                handler.ExecuteCallback(_scriptEngine.Visitor, positive ? Result.Yes : Result.No, value);
        }
예제 #36
0
 public void Question(string message, IJsExecutable handler)
 {
     Question(message, handler, null);
 }
예제 #37
0
        public async void Choose(object caption, object items, object startKey
            , IJsExecutable positiveHandler, object positiveValue, IJsExecutable negativeHandler, object negativeValue)
        {
            ControlsContext.Current.ActionHandlerLocker.Acquire();
            try
            {
                KeyValuePair<object, string>[] rows = PrepareSelection(items);
                int index = 0;
                for (int i = 0; i < rows.Length; i++)
                    if (rows[i].Key.Equals(startKey))
                    {
                        index = i;
                        break;
                    }

                string capt = ObjToString(caption);

                var ok = new DialogButton(D.OK);
                var cancel = new DialogButton(D.CANCEL);

                IDialogAnswer<object> answer = await _context.DialogProvider.Choose(capt, rows, index, ok, cancel);

                IJsExecutable handler = answer.Positive ? positiveHandler : negativeHandler;
                object value = answer.Positive ? positiveValue : negativeValue;

                if (handler != null)
                    handler.ExecuteCallback(_scriptEngine.Visitor, value, new KeyValueArgs<object, string>(answer.Result, rows));
            }
            finally
            {
                ControlsContext.Current.ActionHandlerLocker.Release();
            }
        }
예제 #38
0
        public async void Message(object message, IJsExecutable handler, object value)
        {
            ControlsContext.Current.ActionHandlerLocker.Acquire();
            try
            {
                string msg = ObjToString(message);

                var close = new DialogButton(D.CLOSE);

                await _context.DialogProvider.Message(msg, close);

                if (handler != null)
                    handler.ExecuteCallback(_scriptEngine.Visitor, value, new Args<object>(null));
            }
            finally
            {
                ControlsContext.Current.ActionHandlerLocker.Release();
            }
        }
예제 #39
0
 public void Ask(object message, IJsExecutable positiveHandler, object positiveValue, IJsExecutable negativeHandler)
 {
     Ask(message, positiveHandler, positiveValue, negativeHandler, null);
 }
예제 #40
0
        public async void ShowTime(string caption, DateTime current, IJsExecutable handler, object value)
        {
            caption = _context.Dal.TranslateString(caption);

            var ok = new DialogButton(D.OK);
            var cancel = new DialogButton(D.CANCEL);

            IDialogAnswer<DateTime> answer = await _context.DialogProvider.Time(caption, current, ok, cancel);

            if (handler != null)
                handler.ExecuteCallback(_scriptEngine.Visitor, answer.Result, value);
        }
예제 #41
0
 public void Choose(object caption, object items, IJsExecutable positiveHandler, object positiveValue)
 {
     Choose(caption, items, null, positiveHandler, positiveValue, null, null);
 }
예제 #42
0
 public void Time(string caption, DateTime current, IJsExecutable positiveHandler, object positiveValue, IJsExecutable negativeHandler)
 {
     Time(caption, current, positiveHandler, positiveValue, negativeHandler, null);
 }
예제 #43
0
파일: Email.cs 프로젝트: Fedorm/core-master
 public void Create(object address, string text, string subject, object attachments, IJsExecutable handler)
 {
     Create(address, text, subject, attachments, handler, null);
 }
예제 #44
0
 public void Time(object caption, DateTime current, IJsExecutable positiveHandler, object positiveValue)
 {
     Time(caption, current, positiveHandler, positiveValue, null, null);
 }
예제 #45
0
 public void Time(string caption, IJsExecutable positiveHandler, object value)
 {
     Time(caption, System.DateTime.Now, positiveHandler, value, null, null);
 }
예제 #46
0
        private async void AnyDateTimeDialog(DateTimeDialog func, object caption, DateTime current
            , IJsExecutable positiveHandler, object positiveValue, IJsExecutable negativeHandler, object negativeValue)
        {
            ControlsContext.Current.ActionHandlerLocker.Acquire();
            try
            {
                string capt = ObjToString(caption);

                var ok = new DialogButton(D.OK);
                var cancel = new DialogButton(D.CANCEL);

                IDialogAnswer<DateTime> answer = await func(capt, current, ok, cancel);

                IJsExecutable handler = answer.Positive ? positiveHandler : negativeHandler;
                object value = answer.Positive ? positiveValue : negativeValue;

                if (handler != null)
                    handler.ExecuteCallback(_scriptEngine.Visitor, value, new Args<DateTime>(answer.Result));
            }
            finally
            {
                ControlsContext.Current.ActionHandlerLocker.Release();
            }
        }
예제 #47
0
 public void Date(string caption, IJsExecutable positiveHandler)
 {
     Date(caption, System.DateTime.Now, positiveHandler, null, null, null);
 }
예제 #48
0
 public void Ask(object message, IJsExecutable positiveHandler)
 {
     Ask(message, positiveHandler, null, null, null);
 }
예제 #49
0
 public void ShowTime(string caption, IJsExecutable handler, object value)
 {
     ShowTime(caption, System.DateTime.Now, handler, value);
 }
예제 #50
0
 public void Ask(object message, IJsExecutable positiveHandler, object positiveValue, IJsExecutable negativeHandler)
 {
     Ask(message, positiveHandler, positiveValue, negativeHandler, null);
 }
예제 #51
0
 public void DateTime(object caption, DateTime current, IJsExecutable positiveHandler)
 {
     DateTime(caption, current, positiveHandler, null, null, null);
 }
예제 #52
0
        public async void Ask(object message
            , IJsExecutable positiveHandler, object positiveValue, IJsExecutable negativeHandler, object negativeValue)
        {
            ControlsContext.Current.ActionHandlerLocker.Acquire();

            try
            {
                string msg = ObjToString(message);

                var yes = new DialogButton(D.YES);
                var no = new DialogButton(D.NO);

                bool positive = await _context.DialogProvider.Ask(msg, yes, no);

                IJsExecutable handler = positive ? positiveHandler : negativeHandler;
                object value = positive ? positiveValue : negativeValue;

                if (handler != null)
                    handler.ExecuteCallback(_scriptEngine.Visitor, value, new Args<Result>(positive ? Result.Yes : Result.No));
            }
            finally
            {
                ControlsContext.Current.ActionHandlerLocker.Release();
            }
        }
예제 #53
0
 public void DateTime(object caption, IJsExecutable positiveHandler, object positiveValue)
 {
     DateTime(caption, System.DateTime.Now, positiveHandler, positiveValue, null, null);
 }
예제 #54
0
 public void Time(string caption, DateTime current, IJsExecutable positiveHandler)
 {
     Time(caption, current, positiveHandler, null, null, null);
 }
예제 #55
0
 public void Ask(object message, IJsExecutable positiveHandler)
 {
     Ask(message, positiveHandler, null, null, null);
 }
예제 #56
0
 public void Time(object caption, DateTime current
                  , IJsExecutable positiveHandler, object positiveValue, IJsExecutable negativeHandler, object negativeValue)
 {
     AnyDateTimeDialog(_context.DialogProvider.Time, caption, current
                       , positiveHandler, positiveValue, negativeHandler, negativeValue);
 }
예제 #57
0
 public void Select(string caption, object items, IJsExecutable handler)
 {
     Select(caption, items, handler, null);
 }
예제 #58
0
 public void Choose(object caption, object items, IJsExecutable positiveHandler, object positiveValue)
 {
     Choose(caption, items, null, positiveHandler, positiveValue, null, null);
 }
예제 #59
0
 public void ShowTime(string caption, DateTime current, IJsExecutable handler)
 {
     ShowTime(caption, current, handler, null);
 }
예제 #60
0
        public async void Select(string caption, object items, IJsExecutable handler, object value)
        {
            KeyValuePair<object, string>[] rows = PrepareSelection(items);

            caption = _context.Dal.TranslateString(caption);

            var ok = new DialogButton(D.OK);

            var cancel = new DialogButton(D.CANCEL);

            IDialogAnswer<object> answer = await _context.DialogProvider.Choose(caption, rows, 0, ok, cancel);

            if (handler != null)
                handler.ExecuteCallback(_scriptEngine.Visitor, answer.Result, value);
        }