Ejemplo n.º 1
0
 void ListenerLeapTapScreenReady(object sender)
 {
     if (detialWindow != null || musicWindow != null)
     {
         Action action2 = null;
         if (detialWindow != null)
         {
             action2 = () => detialWindow.CloseThis();
         }
         else
         {
             action2 = () => musicWindow.CloseThis();
         }
         Dispatcher.BeginInvoke(DispatcherPriority.Send, action2).Completed += (a, b) =>
         {
             detialWindow = null;
             musicWindow  = null;
         };
     }
     else
     {
         Action action = () => OpenSubWindow();
         Dispatcher.BeginInvoke(DispatcherPriority.Send, action);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 打开图片展示或者音乐播放窗口
        /// </summary>
        private void OpenSubWindow()
        {
            string path = CheckIfMusicPath(currentIndex);

            if (path != "")
            {
                ID3Info id3Info = new ID3Info(path, true);
                id3Info.Load();
                BassEngine.Instance.OpenFile(path);
                musicWindow = new MusicWindow(images[currentIndex], id3Info);
                musicWindow.Show();
            }
            else
            {
                detialWindow = new DetialWindow(images[currentIndex]);
                detialWindow.Show();
            }
        }
Ejemplo n.º 3
0
 public static DetialWindow GetInstance(FileInfo imgSrc)
 {
     if (Instance != null)
         Instance.Close();
     Instance = new DetialWindow(imgSrc);
     return Instance;
 }
Ejemplo n.º 4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e">Gesture event arguments.</param>
        private void OnGestureRecognized(object sender, GestureEventArgs e)
        {
            switch (e.GestureName)
            {
            case "Menu":
                if (detialWindow == null && musicWindow == null)
                {
                    HighLightStickMan();
                    this.CloseThis();
                }
                break;

            case "JoinedHands":
                if (musicWindow != null && detialWindow == null)
                {
                    HighLightStickMan();
                    musicWindow.ChangeStatue();
                }
                break;

            case "ZoomIn":
                //Gesture = "Zoom In";
                if (detialWindow == null && musicWindow == null)
                {
                    HighLightStickMan();
                    this.Close();
                }
                break;

            case "ZoomOut":
                //Gesture = "Zoom Out";
                break;

            case "Pull":
            case "PullLeft":
                if (detialWindow == null && musicWindow == null)
                {
                    HighLightStickMan();
                    OpenSubWindow();
                }
                break;

            case "Push":
            case "PushLeft":
                if (detialWindow != null || musicWindow != null)
                {
                    HighLightStickMan();
                    if (detialWindow != null)
                    {
                        detialWindow.CloseThis();
                        detialWindow = null;
                    }
                    else
                    {
                        musicWindow.CloseThis();
                        musicWindow = null;
                    }
                }
                break;

            default:
                break;
            }

            //_clearTimer.Start();
        }