Esempio n. 1
0
        private async void label_MouseDown(object sender, MouseButtonEventArgs e)
        {
            JObject obj = JObject.Parse(await Uuuhh.GetWebAsync("http://www.tuling123.com/openapi/api?key=0651b32a3a6c8f54c7869b9e62872796&info=" + Uri.EscapeUriString(textBox1.Text) + "&userid=" + Uri.EscapeUriString(Settings.Default.LemonAreeunIts)));
            User    U   = new User(textBox1.Text)
            {
                Width = Robot.ActualWidth
            };
            Robot Rb = new Robot((string)obj["text"])
            {
                Width = Robot.ActualWidth
            };

            Robot.Children.Add(U);
            Robot.Children.Add(Rb);
            if ((string)obj["code"] == "200000")
            {
                string i  = (string)obj["text"];
                User   Uu = new User(textBox1.Text);
                U.Width = Robot.ActualWidth;
                Lemon_App.Robot Rbu = new Lemon_App.Robot((string)obj["url"] + i);
                Rb.Width = Robot.ActualWidth;
                Robot.Children.Add(Uu);
                Robot.Children.Add(Rbu);
            }
        }
Esempio n. 2
0
 private async void label_MouseDown(object sender, MouseButtonEventArgs e)
 {
     try
     {
         JObject obj = JObject.Parse(await Uuuhh.GetWebAsync("http://www.tuling123.com/openapi/api?key=0651b32a3a6c8f54c7869b9e62872796&info=" + Uri.EscapeUriString(textBox1.Text) + "&userid=" + Uri.EscapeUriString(He.Settings.LemonAreeunIts)));
         if ((string)obj["code"] == "100000" || obj["code"].ToString() == "40002")
         {
             User U = new User(textBox1.Text)
             {
                 Width = Robot.ActualWidth, Opacity = 0
             };
             Robot Rb = new Robot((string)obj["text"])
             {
                 Width = Robot.ActualWidth, Opacity = 0
             };
             Robot.Children.Add(U);
             Robot.Children.Add(Rb);
             var b = new DoubleAnimation(1, TimeSpan.FromSeconds(0.2));
             U.BeginAnimation(OpacityProperty, b);
             Rb.BeginAnimation(OpacityProperty, b);
         }
         else if ((string)obj["code"] == "200000")
         {
             string i  = (string)obj["text"];
             User   Uu = new User(textBox1.Text)
             {
                 Opacity = 0,
                 Width   = Robot.ActualWidth
             };
             Lemon_App.Robot Rbu = new Lemon_App.Robot((string)obj["url"] + i)
             {
                 Opacity = 0,
                 Width   = Robot.ActualWidth,
                 ToolTip = (string)obj["url"].ToString()
             };
             Rbu.MouseDown += Rbu_MouseDown;
             Robot.Children.Add(Uu);
             Robot.Children.Add(Rbu);
             var b = new DoubleAnimation(1, TimeSpan.FromSeconds(0.2));
             Uu.BeginAnimation(OpacityProperty, b);
             Rbu.BeginAnimation(OpacityProperty, b);
         }
         else if ((string)obj["code"] == "308000")
         {
             User Uu = new User(textBox1.Text)
             {
                 Width   = Robot.ActualWidth,
                 Opacity = 0
             };
             Robot.Children.Add(Uu);
             int i = 0;
             var s = new List <string>();
             var f = new List <string>();
             var u = new List <string>();
             while (i != 5)
             {
                 s.Add(obj["list"][i]["name"].ToString());
                 f.Add(obj["list"][i]["info"].ToString());
                 u.Add(obj["list"][i]["detailurl"].ToString());
                 i++;
             }
             var c = new RobotHrSp(s, f, u)
             {
                 Width   = Robot.ActualWidth,
                 Opacity = 0
             };
             Robot.Children.Add(c);
             var b = new DoubleAnimation(1, TimeSpan.FromSeconds(0.2));
             Uu.BeginAnimation(OpacityProperty, b);
             c.BeginAnimation(OpacityProperty, b);
         }
     }
     catch
     {
         User U = new User(textBox1.Text)
         {
             Width     = Robot.ActualWidth
             , Opacity = 0
         };
         Robot Rb = new Robot("小萌机器人似乎遇到了些问题")
         {
             Width = Robot.ActualWidth, Opacity = 0
         };
         Robot.Children.Add(U);
         Robot.Children.Add(Rb);
         var b = new DoubleAnimation(1, TimeSpan.FromSeconds(0.2));
         U.BeginAnimation(OpacityProperty, b);
         Rb.BeginAnimation(OpacityProperty, b);
     }
     textBox1.Text = "";
 }