示例#1
0
 private void GetNewReadyBox(object sender, BoxShapeEventArgs e)
 {
     string path = System.Environment.CurrentDirectory + "/Images/BoxPreview_";
     if (e==null)
     {
         path += "empty.png";
     }
     else
     {
         path += Resources.GetStringfromBoxShape(e.box);
     }
     if (File.Exists(path))
     {
         img.Dispatcher.Invoke(
                        new Action(
                                   delegate
                                   {
                                       img.Source = new BitmapImage(new Uri(path, UriKind.Absolute));
                                   }));
     }
     else
     {
         img.Source = null;
     }
 }
示例#2
0
文件: AIFrame.cs 项目: zpw987/Teteris
        private void AIWork(object sender, BoxShapeEventArgs e)
        {
            //myAI
            myAI.NewBoxArrive(activeBox.shape, readyBox.shape);
            ope = myAI.GetOperation();

            if (ope != null)
            {
                timer1_i = 0;
                BeginInput();
            }
        }