/// <summary>
        /// Triggers  special UI to select a date (day/month/year)
        /// </summary>
        public void selectDate(string options)
        {
            try {

                try
                {

                    string value = WPCordovaClassLib.Cordova.JSON.JsonHelper.Deserialize<string[]>(options)[0];
                    dateTimePickerOptions = new DateTimePickerOptions();
                    if(!String.IsNullOrEmpty(value)) {
                        dateTimePickerOptions.Value = FromUnixTime(long.Parse(value));
                    }

                    //this.dateTimePickerOptions = String.IsNullOrEmpty(options["value"]) ? new DateTimePickerOptions() :
                    //    WPCordovaClassLib.Cordova.JSON.JsonHelper.Deserialize<DateTimePickerOptions>(options);

                }
                catch (Exception ex)
                {
                    this.DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION, ex.Message));
                    return;
                }

                this.dateTimePickerTask = new DateTimePickerTask();
                dateTimePickerTask.Value = dateTimePickerOptions.Value;

                dateTimePickerTask.Completed += this.dateTimePickerTask_Completed;
                dateTimePickerTask.Show(DateTimePickerTask.DateTimePickerType.Date);
            }
            catch (Exception e)
            {
                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, e.Message));
            }
        }
        /// <summary>
        /// Triggers  special UI to select a date (day/month/year)
        /// </summary>
        public void selectDate(string options)
        {
            try {
                try
                {
                    string value = WPCordovaClassLib.Cordova.JSON.JsonHelper.Deserialize <string[]>(options)[0];
                    dateTimePickerOptions = new DateTimePickerOptions();
                    if (!String.IsNullOrEmpty(value))
                    {
                        dateTimePickerOptions.Value = FromUnixTime(long.Parse(value));
                    }

                    //this.dateTimePickerOptions = String.IsNullOrEmpty(options["value"]) ? new DateTimePickerOptions() :
                    //    WPCordovaClassLib.Cordova.JSON.JsonHelper.Deserialize<DateTimePickerOptions>(options);
                }
                catch (Exception ex)
                {
                    this.DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION, ex.Message));
                    return;
                }

                this.dateTimePickerTask  = new DateTimePickerTask();
                dateTimePickerTask.Value = dateTimePickerOptions.Value;

                dateTimePickerTask.Completed += this.dateTimePickerTask_Completed;
                dateTimePickerTask.Show(DateTimePickerTask.DateTimePickerType.Date);
            }
            catch (Exception e)
            {
                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, e.Message));
            }
        }
        public void selectDate(string options)
        {
            try 
            {
                if (!GetDefaults(options)) return;

                _dateTimePickerTask = new DateTimePickerTask { Value = _dateTimePickerOptions.Value };

                _dateTimePickerTask.Completed += dateTimePickerTask_Completed;
                _dateTimePickerTask.Show(DateTimePickerTask.DateTimePickerType.Date);
            }
            catch (Exception e)
            {
                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, e.Message));
            }
        }
Esempio n. 4
0
        public void selectDate(string options)
        {
            try
            {
                if (!GetDefaults(options))
                {
                    return;
                }

                _dateTimePickerTask = new DateTimePickerTask {
                    Value = _dateTimePickerOptions.Value
                };

                _dateTimePickerTask.Completed += dateTimePickerTask_Completed;
                _dateTimePickerTask.Show(DateTimePickerTask.DateTimePickerType.Date);
            }
            catch (Exception e)
            {
                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, e.Message));
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Triggers  special UI to select a date (day/month/year)
        /// </summary>
        public void selectDate(string options)
        {
            try {
                try
                {
                    var args = JSON.JsonHelper.Deserialize <string[]>(options);
                    _callbackId = args[args.Length - 1];
                    if (ResultHandlers.ContainsKey(CurrentCommandCallbackId))
                    {
                        mySavedHandler = ResultHandlers[CurrentCommandCallbackId];
                    }
                    string value = WPCordovaClassLib.Cordova.JSON.JsonHelper.Deserialize <string[]>(options)[0];
                    dateTimePickerOptions = new DateTimePickerOptions();
                    if (!String.IsNullOrEmpty(value))
                    {
                        dateTimePickerOptions.Value = FromUnixTime(long.Parse(value));
                    }

                    //this.dateTimePickerOptions = String.IsNullOrEmpty(options["value"]) ? new DateTimePickerOptions() :
                    //    WPCordovaClassLib.Cordova.JSON.JsonHelper.Deserialize<DateTimePickerOptions>(options);
                }
                catch (Exception ex)
                {
                    this.DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION, ex.Message));
                    return;
                }

                this.dateTimePickerTask  = new DateTimePickerTask();
                dateTimePickerTask.Value = dateTimePickerOptions.Value;

                dateTimePickerTask.Completed += this.dateTimePickerTask_Completed;
                dateTimePickerTask.Show(DateTimePickerTask.DateTimePickerType.Date);
            }
            catch (Exception e)
            {
                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, e.Message));
            }
        }