资源简介
public Turntable()
{
InitializeComponent();
int angle = 5029;
for (int i = 0; i < 16; i )
{
angle = 22;
_ListAngle.Add(angle);
}
}
/// <summary>
/// 保存八个角度
/// </summary>
List<int> _ListAngle = new List<int>();
/// <summary>
/// 产生随机数
/// </summary>
Random _Random = new Random();
int _Index = 0;
int _OldAngle = 0;
private void btnStartTurntable_Click(object sender, RoutedEventArgs e)
{
btnStartTurntable.IsEnabled = false;
_Index = _Random.Next(0, 16);
//_Index = 2;
Storyboard sb = (Storyboard)this.FindResource("zhuandong");
sb.Completed -= this.sb_Completed;
sb.Completed = new EventHandler(sb_Completed);
((SplineDoubleKeyFrame)((DoubleAnimationUsingKeyFrames)sb.Children[0]).KeyFrames[0]).Value = _OldAngle;
((SplineDoubleKeyFrame)((DoubleAnimationUsingKeyFrames)sb.Children[0]).KeyFrames[3]).Value = _ListAngle[_Index];
//((SplineDoubleKeyFrame)((DoubleAnimationUsingKeyFrames)sb.Children[0]).KeyFrames[3]).Value = 5218;
sb.Begin();
}
void sb_Completed(object sender, EventArgs e)
{
DispatcherTimer dt = new DispatcherTimer();
dt.Interval = TimeSpan.FromSeconds(0.3);
dt.Tick = delegate
{
dt.Stop();
_OldAngle = (_ListAngle[_Index] % 360);
btnStartTurntable.IsEnabled = true;
AwardProcess(GetAward(_ListAngle[_Index]));
};
dt.Start();
}
public delegate void AwardDelegate(Award award);
/// <summary>
/// 返回转到的奖项信息
/// </summary>
public event AwardDelegate AwardProcess;
private Award GetAward(int angle)
{
{
InitializeComponent();
int angle = 5029;
for (int i = 0; i < 16; i )
{
angle = 22;
_ListAngle.Add(angle);
}
}
/// <summary>
/// 保存八个角度
/// </summary>
List<int> _ListAngle = new List<int>();
/// <summary>
/// 产生随机数
/// </summary>
Random _Random = new Random();
int _Index = 0;
int _OldAngle = 0;
private void btnStartTurntable_Click(object sender, RoutedEventArgs e)
{
btnStartTurntable.IsEnabled = false;
_Index = _Random.Next(0, 16);
//_Index = 2;
Storyboard sb = (Storyboard)this.FindResource("zhuandong");
sb.Completed -= this.sb_Completed;
sb.Completed = new EventHandler(sb_Completed);
((SplineDoubleKeyFrame)((DoubleAnimationUsingKeyFrames)sb.Children[0]).KeyFrames[0]).Value = _OldAngle;
((SplineDoubleKeyFrame)((DoubleAnimationUsingKeyFrames)sb.Children[0]).KeyFrames[3]).Value = _ListAngle[_Index];
//((SplineDoubleKeyFrame)((DoubleAnimationUsingKeyFrames)sb.Children[0]).KeyFrames[3]).Value = 5218;
sb.Begin();
}
void sb_Completed(object sender, EventArgs e)
{
DispatcherTimer dt = new DispatcherTimer();
dt.Interval = TimeSpan.FromSeconds(0.3);
dt.Tick = delegate
{
dt.Stop();
_OldAngle = (_ListAngle[_Index] % 360);
btnStartTurntable.IsEnabled = true;
AwardProcess(GetAward(_ListAngle[_Index]));
};
dt.Start();
}
public delegate void AwardDelegate(Award award);
/// <summary>
/// 返回转到的奖项信息
/// </summary>
public event AwardDelegate AwardProcess;
private Award GetAward(int angle)
{
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
namespace BanditTicket
{
///
/// App.xaml 的交互逻辑
///
public partial class App : Application
{
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-01-07 14:25 BanditTicket\
目录 0 2014-01-07 14:25 BanditTicket\BanditTicket\
文件 328 2013-04-22 20:44 BanditTicket\BanditTicket\App.xaml
文件 308 2012-09-10 11:25 BanditTicket\BanditTicket\App.xaml.cs
文件 4675 2013-04-22 20:57 BanditTicket\BanditTicket\BanditTicket.csproj
文件 143 2012-09-10 11:26 BanditTicket\BanditTicket\BanditTicket.csproj.user
目录 0 2014-01-07 14:25 BanditTicket\BanditTicket\Properties\
文件 2189 2012-09-10 11:25 BanditTicket\BanditTicket\Properties\AssemblyInfo.cs
文件 2862 2012-09-11 15:07 BanditTicket\BanditTicket\Properties\Resources.Designer.cs
文件 5817 2012-09-11 15:07 BanditTicket\BanditTicket\Properties\Resources.resx
文件 1097 2012-09-10 11:25 BanditTicket\BanditTicket\Properties\Settings.Designer.cs
文件 201 2012-09-10 11:25 BanditTicket\BanditTicket\Properties\Settings.settings
文件 10293 2014-01-07 14:25 BanditTicket\BanditTicket\Turntable.xaml
文件 4938 2014-01-07 13:11 BanditTicket\BanditTicket\Turntable.xaml.cs
文件 525 2014-01-07 13:16 BanditTicket\BanditTicket\WindowTurntable.xaml
文件 883 2012-09-14 17:50 BanditTicket\BanditTicket\WindowTurntable.xaml.cs
目录 0 2014-01-07 14:25 BanditTicket\BanditTicket\bin\
目录 0 2014-01-07 14:25 BanditTicket\BanditTicket\bin\Debug\
文件 20992 2014-01-07 13:16 BanditTicket\BanditTicket\bin\Debug\BanditTicket.exe
文件 46592 2014-01-07 13:16 BanditTicket\BanditTicket\bin\Debug\BanditTicket.pdb
文件 11600 2014-06-30 09:52 BanditTicket\BanditTicket\bin\Debug\BanditTicket.vshost.exe
文件 490 2010-03-17 22:39 BanditTicket\BanditTicket\bin\Debug\BanditTicket.vshost.exe.manifest
文件 23849 2014-01-07 10:00 BanditTicket\BanditTicket\bin\Debug.zip
目录 0 2014-06-30 09:52 BanditTicket\BanditTicket\bin\Release\
目录 0 2014-01-07 14:25 BanditTicket\BanditTicket\obj\
目录 0 2014-01-07 14:25 BanditTicket\BanditTicket\obj\x86\
目录 0 2014-06-30 09:52 BanditTicket\BanditTicket\obj\x86\Debug\
文件 2226 2014-01-07 13:16 BanditTicket\BanditTicket\obj\x86\Debug\App.g.cs
文件 2226 2014-06-30 09:52 BanditTicket\BanditTicket\obj\x86\Debug\App.g.i.cs
文件 180 2014-01-07 13:16 BanditTicket\BanditTicket\obj\x86\Debug\BanditTicket.Properties.Resources.resources
文件 6702 2014-06-30 09:52 BanditTicket\BanditTicket\obj\x86\Debug\BanditTicket.csproj.FileListAbsolute.txt
............此处省略33个文件信息
- 上一篇:html5 超炫进度条(粒子效果)
- 下一篇:IC卡二次开发
相关资源
- C#百度指数抓取方法(2012年版本已失
- 二维表
- 网站地图生成器(RSS)
- WMI 入门学习
- 基础学习
- C# 深入浅出全接触 学习专用
- 赞MVVM入门(仅供学习)
- C# orm 入门级代码
-
C# 生成sitemap.xm
l文件 - Debug 非常简单的C#客户端
- printControl
- csharp
- (C#编程)渴望提升技术,寻求共同学
- Q-Learning强化学习的代码实现
- 我对C#的认识及学习心得
-
C# 读取xm
l文件内容的不同东西 - 图片上传.rarC#如何使用input[type=file]进
- WPF TreeView ListView 数据联动
- 李宏毅深度学习HW1数据集train.csv
-
C#3层架构+Winform操作xm
l文件(增删改 -
Asp.net+xm
l实现制作一个完整的新闻系 - NBA2013-2014比赛数据 csv格式 可直接用于
- kinect和WPF、C#学习例程,彩色图、深度
- 利用C#(winform)实现mongodb的增删改
-
影院售票系统 C# xm
l - C#串口通讯小程序自己学习时候做的
- C# 简易计算器源码-非常适合初学者学
-
C# xm
l文件操作增删改查代码 - boston.csv数据集
-
亲测可用,c#将xm
l导入到access数据库
评论
共有 条评论