Asp.net源码专业站
预留广告位
首页->影音娱乐->MoonlightPiano月光钢琴源码>>AphroditePiano/Controls/Indication.xaml.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:MoonlightPiano月光钢琴源码
当前文件:文件类型 MoonlightPiano/AphroditePiano/Controls/Indication.xaml.cs[4K,2009-6-12 11:47:38]打开代码结构图
普通视图
		            
1using System; 2using System.Windows; 3using System.Windows.Controls; 4using System.Windows.Documents; 5using System.Windows.Ink; 6using System.Windows.Input; 7using System.Windows.Media; 8using System.Windows.Media.Animation; 9using System.Windows.Shapes; 10using AphroditePiano.VO; 11using System.Windows.Threading; 12using AphroditePiano.Controls; 13 14namespace AphroditePiano 15{ 16 public partial class Indication : UserControl 17 { 18 private MusicVO music; 19 20 musicVO (DependencyProperty) 50 51 public Indication() 52 { 53 // Required to initialize variables 54 InitializeComponent(); 55 BtnStart.Click += new RoutedEventHandler(BtnStart_Click); 56 gapTimer.Tick += new EventHandler(gapTimer_Tick); 57 paragraphTimer.Tick += new EventHandler(paragraphTimer_Tick); 58 } 59 60 PlaySpeed (DependencyProperty) 89 90 public TimeSpan gapTimeSpan = TimeSpan.FromSeconds(.4); 91 public TimeSpan paragraphTimeSpan = TimeSpan.FromSeconds(.8); 92 public DispatcherTimer gapTimer = new DispatcherTimer(); 93 public DispatcherTimer paragraphTimer = new DispatcherTimer(); 94 95 public string[] keys; 96 97 public int keyIndex = 0; 98 99 void paragraphTimer_Tick(object sender, EventArgs e) 100 { 101 paragraphTimer.Stop(); 102 gapTimer.Start(); 103 } 104 105 void gapTimer_Tick(object sender, EventArgs e) 106 { 107 //UpAllKeys(); 108 if (keyIndex < keys.Length - 1) 109 { 110 if (keys[keyIndex] != "|") 111 { 112 string ks = keys[keyIndex].Replace("&", string.Empty); 113 IndicationKey ikey = new IndicationKey(); 114 ikey.setTxt(ks); 115 ikey.HorizontalAlignment = HorizontalAlignment.Right; 116 ikey.VerticalAlignment = VerticalAlignment.Center; 117 xGrid.Children.Add(ikey); 118 ikey.run(); 119 } 120 else 121 { 122 gapTimer.Stop(); 123 paragraphTimer.Start(); 124 } 125 keyIndex++; 126 } 127 else 128 { 129 gapTimer.Stop(); 130 paragraphTimer.Stop(); 131 keyIndex = 0; 132 } 133 } 134 135 136 void BtnStart_Click(object sender, RoutedEventArgs e) 137 { 138 if (this.music != null) 139 { 140 VisualStateManager.GoToState(this, "Start", true); 141 142 keyIndex = 0; 143 gapTimer.Interval = gapTimeSpan; 144 paragraphTimer.Interval = paragraphTimeSpan; 145 146 keys = music.PassKey.Split(','); 147 148 gapTimer.Start(); 149 } 150 } 151 } 152}
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:MoonlightPiano月光钢琴源码
51Aspx.com 版权所有 CopyRight © 2006-2010. 京ICP备06046876号 本站法律顾问:ITlaw-庄毅雄律师
返回顶部
客户服务:点击这里进行客户咨询 业务合作:点击这里洽谈业务合作 合作热线:010-68880146