Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 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));
                }
            }
        }
Ejemplo n.º 7
0
        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));
            }
        }
Ejemplo n.º 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)));
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 20
0
        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));
        }
Ejemplo n.º 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;
                    });
                }
            }
        }
Ejemplo n.º 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));
                }
            }
        }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 24
0
 public void Select(string caption, object items, IJsExecutable handler)
 {
     Select(caption, items, handler, null);
 }
Ejemplo n.º 25
0
 public void ShowTime(string caption, DateTime current, IJsExecutable handler)
 {
     ShowTime(caption, current, handler, null);
 }
Ejemplo n.º 26
0
 public void ShowTime(string caption, IJsExecutable handler)
 {
     ShowTime(caption, System.DateTime.Now, handler, null);
 }
Ejemplo n.º 27
0
 public void Alert(object message, IJsExecutable handler, object value, object positiveText, object negativeText)
 {
     Alert(message, handler, value, positiveText, negativeText, null);
 }
Ejemplo n.º 28
0
 public void Question(string message, IJsExecutable handler)
 {
     Question(message, handler, null);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 32
0
 public void ShowTime(string caption, IJsExecutable handler, object value)
 {
     ShowTime(caption, System.DateTime.Now, handler, value);
 }
Ejemplo n.º 33
0
 public void ShowTime(string caption, IJsExecutable handler)
 {
     ShowTime(caption, System.DateTime.Now, handler, null);
 }
Ejemplo n.º 34
0
 public void Alert(object message, IJsExecutable handler, object value, object positiveText, object negativeText)
 {
     Alert(message, handler, value, positiveText, negativeText, null);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 36
0
 public void Question(string message, IJsExecutable handler)
 {
     Question(message, handler, null);
 }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 39
0
 public void Ask(object message, IJsExecutable positiveHandler, object positiveValue, IJsExecutable negativeHandler)
 {
     Ask(message, positiveHandler, positiveValue, negativeHandler, null);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 41
0
 public void Choose(object caption, object items, IJsExecutable positiveHandler, object positiveValue)
 {
     Choose(caption, items, null, positiveHandler, positiveValue, null, null);
 }
Ejemplo n.º 42
0
 public void Time(string caption, DateTime current, IJsExecutable positiveHandler, object positiveValue, IJsExecutable negativeHandler)
 {
     Time(caption, current, positiveHandler, positiveValue, negativeHandler, null);
 }
Ejemplo n.º 43
0
 public void Create(object address, string text, string subject, object attachments, IJsExecutable handler)
 {
     Create(address, text, subject, attachments, handler, null);
 }
Ejemplo n.º 44
0
 public void Time(object caption, DateTime current, IJsExecutable positiveHandler, object positiveValue)
 {
     Time(caption, current, positiveHandler, positiveValue, null, null);
 }
Ejemplo n.º 45
0
 public void Time(string caption, IJsExecutable positiveHandler, object value)
 {
     Time(caption, System.DateTime.Now, positiveHandler, value, null, null);
 }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 47
0
 public void Date(string caption, IJsExecutable positiveHandler)
 {
     Date(caption, System.DateTime.Now, positiveHandler, null, null, null);
 }
Ejemplo n.º 48
0
 public void Ask(object message, IJsExecutable positiveHandler)
 {
     Ask(message, positiveHandler, null, null, null);
 }
Ejemplo n.º 49
0
 public void ShowTime(string caption, IJsExecutable handler, object value)
 {
     ShowTime(caption, System.DateTime.Now, handler, value);
 }
Ejemplo n.º 50
0
 public void Ask(object message, IJsExecutable positiveHandler, object positiveValue, IJsExecutable negativeHandler)
 {
     Ask(message, positiveHandler, positiveValue, negativeHandler, null);
 }
Ejemplo n.º 51
0
 public void DateTime(object caption, DateTime current, IJsExecutable positiveHandler)
 {
     DateTime(caption, current, positiveHandler, null, null, null);
 }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 53
0
 public void DateTime(object caption, IJsExecutable positiveHandler, object positiveValue)
 {
     DateTime(caption, System.DateTime.Now, positiveHandler, positiveValue, null, null);
 }
Ejemplo n.º 54
0
 public void Time(string caption, DateTime current, IJsExecutable positiveHandler)
 {
     Time(caption, current, positiveHandler, null, null, null);
 }
Ejemplo n.º 55
0
 public void Ask(object message, IJsExecutable positiveHandler)
 {
     Ask(message, positiveHandler, null, null, null);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 57
0
 public void Select(string caption, object items, IJsExecutable handler)
 {
     Select(caption, items, handler, null);
 }
Ejemplo n.º 58
0
 public void Choose(object caption, object items, IJsExecutable positiveHandler, object positiveValue)
 {
     Choose(caption, items, null, positiveHandler, positiveValue, null, null);
 }
Ejemplo n.º 59
0
 public void ShowTime(string caption, DateTime current, IJsExecutable handler)
 {
     ShowTime(caption, current, handler, null);
 }
Ejemplo n.º 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);
        }