Example #1
0
        private void ReplyAfterLaunching(Native.AppControl launchRequest, Native.AppControl replyRequest, Native.AppControlReplyResult result)
        {
            //_bindableRecord.AlarmToneType = AlarmToneTypes.RingtoneSdk;
            if (result == Native.AppControlReplyResult.Succeeded)
            {
                List <string> data = (List <string>)replyRequest.ExtraData.Get("http://tizen.org/appcontrol/data/selected");
                if (data.Count == 1)
                {
                    Debug.WriteLine("[LaunchAlarmToneAppControl] Type {0}", data[0]);
                    switch (data[0])
                    {
                    case "/opt/usr/data/settings/Ringtones/rintone_sdk.mp3":
                        _bindableRecord.AlarmToneType = AlarmToneTypes.RingtoneSdk;
                        break;

                    default:
                        break;
                    }
                }
            }
        }
Example #2
0
        /// <summary>
        /// Called when the replay is delivered
        /// </summary>
        /// <param name="launchRequest">
        /// AppControl for launch
        /// </param>
        /// <param name="replyRequest">
        /// AppControl for replay
        /// </param>
        /// <param name="result">
        /// The result of requesting an app launch
        /// </param>
        void ReplyAfterLaunching(Native.AppControl launchRequest, Native.AppControl replyRequest, Native.AppControlReplyResult result)
        {
            if (result != Native.AppControlReplyResult.Succeeded)
            {
                return;
            }

            try
            {
                if (replyRequest.ExtraData.Count() != 0)
                {
                    bool normal = false;

                    IEnumerable <string> stack1 = replyRequest.ExtraData.GetKeys();
                    foreach (var item in stack1)
                    {
                        if (item == "city_name")
                        {
                            normal = true;
                        }
                    }

                    if (!normal)
                    {
                        return;
                    }

                    string city         = replyRequest.ExtraData.Get <string>("city_name");
                    string country_name = replyRequest.ExtraData.Get <string>("country_name");
                    string timezone     = replyRequest.ExtraData.Get <string>("timezone");
                    string tzpath       = replyRequest.ExtraData.Get <string>("tzpath");

                    string[] times    = timezone.Split(':');
                    bool     positive = true;

                    for (int i = 0; i < times.Length; i++)
                    {
                        if (i == 0 && times[i][0] == '-')
                        {
                            positive = false;
                        }
                    }

                    int h = 0, m = 0;
                    h = Int32.Parse(times[0]);
                    if (times.Length > 1)
                    {
                        m = Int32.Parse(times[1]);
                    }

                    int gmt_offset = 0;
                    if (positive)
                    {
                        gmt_offset = h * 60 + m;
                    }
                    else
                    {
                        gmt_offset = h * 60 - m;
                    }

                    Location l = new Location(city, country_name, gmt_offset, 0, 0);
                    App.ClockInfo.OnItemAdded(l);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(" [ReplyAfterLaunching] Exception - " + ex.Message);
            }
        }