示例#1
0
        private void b_Click(object sender, RoutedEventArgs e)
        {
            String nday   = DateTime.Now.Day.ToString();
            String nmonth = DateTime.Now.Month.ToString();

            if (nday == "1" & nmonth == "6")
            {
                if (!com.Values.ContainsKey("JR61"))
                {
                    com.Values.Add("JR61", 0);
                    this.Frame.Navigate(typeof(jieri));
                }
            }
            req();


            if (com.Values["ts1"].ToString() == "0")
            {
                try
                {
                    Tiler.ShowTile(hoto, source);
                }
                catch { }
            }
            //ShowOut();
        }
示例#2
0
        //private void qx_Click(object sender, RoutedEventArgs e)
        //{
        //    tb.Visibility = Visibility.Collapsed;
        //    tb1.Visibility = Visibility.Collapsed;
        //    qd.Visibility = Visibility.Collapsed;
        //    qx.Visibility = Visibility.Collapsed;
        //    sc.Visibility = Visibility.Visible;
        //    tj.Visibility = Visibility.Visible;
        //    tb2.Visibility = Visibility.Collapsed;
        //    tbg.Visibility = Visibility.Collapsed;
        //    show.Visibility = Visibility.Visible;

        //}
        private async void show_Click(object sender, RoutedEventArgs e)
        {
            if (cblist.Count != 1 && cblist.Count != 0)
            {
                Msg("只能选择一项  ");
            }
            else if (cblist.Count == 0)
            {
                Msg("请选择你需要发送的一言  ");
            }
            else
            {
                ApplicationDataContainer c = ApplicationData.Current.LocalSettings;
                foreach (var i in c.Values)
                {
                    if (i.Key == cblist[0].ToString())
                    {
                        try
                        {
                            a = JsonObject.Parse(i.Value as String).GetNamedString("hitokoto");
                            String source = JsonObject.Parse(i.Value as String).GetNamedString("source");
                            if (com.Values["ts5"].ToString() == "0")
                            {
                            }
                            else
                            {
                                if (source == "")
                                {
                                }
                                else
                                {
                                    a = a + "——" + source;
                                }
                            }
                            Tiler.ShowTile(a, source);
                            Msg("发送成功  ");
                            if (!com.Values.ContainsKey("jg1"))
                            {
                                await new MessageDialog("如需发送我的一言,需将[设置]里的[自动更新磁贴]以及[后台更新磁贴]关闭,因为你发送出去的一言可能会被自动或者后台更新的一言所取代").ShowAsync();
                                com.Values.Add("jg1", "0");
                            }
                        }
                        catch { }
                    }
                }
            }
        }
示例#3
0
        private void con_PointerReleased(object sender, PointerRoutedEventArgs e)
        {
            PointerPoint end    = e.GetCurrentPoint(rec);
            double       deltaY = end.Position.Y - start.Y;
            double       deltaX = end.Position.X - start.X;
            double       alpha  = Math.Atan(deltaY / deltaX) * 180 / Math.PI;

            if (end.Position.X > start.X)//为右方
            {
                //负数为上
                //正数为下
                if (alpha > 45)
                {
                    //下方
                    res = "下方";
                }
                else if (alpha < -45)
                {
                    //上方
                    res = "上方";
                }
                else
                {
                    //右方
                    res = "右方";
                }
            }
            else if (end.Position.X == start.X)
            {
                //不知道
                //如果end.Y>start.Y向下
                if (end.Position.Y > start.Y)
                {
                    res = "下方";
                }
                else
                {
                    res = "上方";
                }
            }
            else//左方
            {
                //负数为下
                //正数为上
                if (alpha > 45)
                {
                    //上方
                    res = "上方";
                }
                else if (alpha < -45)
                {
                    //下方
                    res = "下方";
                }
                else
                {
                    //右方
                    res = "左方";
                }
            }
            if (res == "上方")
            {
                //await Savepng();
            }
            else if (res == "下方")
            {
                ApplicationDataContainer c = ApplicationData.Current.LocalSettings;
                if (!c.Values.ContainsKey(date))
                {
                    c.Values.Add(date, responseText);
                }
                Msg("一言收藏成功  "); return;
            }
            else if (res == "右方")
            {
                req();
                if (com.Values["ts1"].ToString() == "0")
                {
                    try
                    {
                        Tiler.ShowTile(hoto, source);
                    }
                    catch { Msg("showtile错误"); }
                }
            }
            else if (res == "左方")
            {
                this.Frame.Navigate(typeof(MyPage));
            }
        }