上一页 1 ··· 4 5 6 7 8 9 下一页
  2011年12月22日
摘要: //设置游戏多长时间刷新一次 下面是千分之一秒刷新一次this.TargetElapsedTime = System.TimeSpan.FromSeconds(1.0f/1000.0f);//让游戏不按照固定时间间隔来刷新IsFixedTimeStep = false; 阅读全文
posted @ 2011-12-22 14:06 Games 阅读(153) 评论(0) 推荐(0)
  2011年12月9日
摘要: xaml:<ScrollViewer Name="ScrollViewerName" Background="Transparent" Width="480" Height="480" VerticalScrollBarVisibility="Auto" VerticalContentAlignment="Center" HorizontalScrollBarVisibility="Auto" HorizontalAlignment="Ce 阅读全文
posted @ 2011-12-09 15:11 Games 阅读(2727) 评论(0) 推荐(0)
  2011年11月29日
摘要: 创建一个Windows phone项目 程序集名称: "WPAsseblyName" ,项目中添加"WPPage.xaml"页面创建一个类库项目 Windows Phone Class Library 程序集名称:"WPCLAsseblyName",项目中添加"WPCLPage.xaml"点击WPPage.xaml页面的Button按钮 导航到 WPCLPage.xaml页面 代码如下:NavigationService.Navigate(new Uri("/WPCLAsseblyName;compone 阅读全文
posted @ 2011-11-29 17:52 Games 阅读(261) 评论(0) 推荐(0)
  2011年11月24日
摘要: private const string FolderName = "temp1/NewFolder"; void MainPage_Loaded(object sender, RoutedEventArgs e) { using (IsolatedStorageFile file = IsolatedStorageFile.GetUserStoreForApplication()) { file.CreateDirectory(FolderName); string[] array = file.GetDirectoryNames("temp1/"); 阅读全文
posted @ 2011-11-24 17:01 Games 阅读(422) 评论(0) 推荐(0)
摘要: 一:什么是弱引用 了解弱引用之前,先了解一下什么是强引用 例如 : Object obj=new Object(); 就是一个强引用,内存分配一份空间给用以存储Object数据,这块内存有一个首地址,也就是obj所保存的数据,内存分配的空间中不仅仅保存着Object对象信息,还保存着自己(Object本身)被引用的次数。 当一个对象被强引用的形式创建的时候,本身被引用的次数已经为1. 接着Object o=obj; 这句代码执行之后,obj指向的Object的存储空间已经被引用了2次,所以Object保存的被引用数值为2. 总结:强引用最终导致的结果就是被引用的对象的被引用次数+1; ... 阅读全文
posted @ 2011-11-24 14:21 Games 阅读(8923) 评论(0) 推荐(1)
  2011年11月22日
摘要: public static string GetManifestAttribute(string elementName, string attributeName) { string ret = null; try { var settings = new XmlReaderSettings { XmlResolver = new XmlXapResolver() }; const string manifestName = "WMAppManifest.xml"; //const string appNodeName = "App"; using ( 阅读全文
posted @ 2011-11-22 17:54 Games 阅读(302) 评论(0) 推荐(0)
  2011年11月17日
摘要: 加载的本地资源有两种情况:一:加载程序集里面的资源信息 1.加载html资源 (1) StreamReader reader=Application.GetResourceStream(New Uri("path",UriKind.Relative).Stream; webBrowser.NavigateToString(reader.ReadToEnd()); (2) 引用命名空间: Microsoft.Xna.Framework; StreamReader reader = new StreamReader(TitleContainer.Open... 阅读全文
posted @ 2011-11-17 15:52 Games 阅读(8273) 评论(0) 推荐(1)
摘要: 以下两个方法分别用来完成对图片的存储以及还原显示:一:存储图片 public static string ImageSave(string ISFileName, Image SLImage) { var ISAccErr = "独立存储文件系统访问失败。"; var Rlt = ""; var WBmp = new WriteableBitmap(SLImage.Source as BitmapSource); var Buf = new byte[2 * 4 + WBmp.Pixels.Length * 4]; BitConverter.GetByt 阅读全文
posted @ 2011-11-17 10:28 Games 阅读(331) 评论(0) 推荐(0)
  2011年11月15日
摘要: 在.Net多线程编程中,AutoResetEvent和ManualResetEvent这两个类经常用到, 他们的用法很类似,但也有区别。Set方法将信号置为发送状态,Reset方法将信号置为不发送状态,WaitOne等待信号的发送。可以通过构造函数的参数值来决定其初始状态,若为true则非阻塞状态,为false为阻塞状态。如果某个线程调用WaitOne方法,则当信号处于发送状态时,该线程会得到信号, 继续向下执行。其区别就在调用后,AutoResetEvent.WaitOne()每次只允许一个线程进入,当某个线程得到信号后,AutoResetEvent会自动又将信号置为不发送状态,则其他调用W 阅读全文
posted @ 2011-11-15 15:03 Games 阅读(252) 评论(0) 推荐(0)
  2011年11月14日
摘要: xaml语言:<controls:PivotItemName="SecondPivotItem"Header="Second"> <ListBox x:Name="SecondListBox" Margin="0,0,-12,0" ItemsSource="{Binding Items}"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Margin="0,0,0,17" 阅读全文
posted @ 2011-11-14 14:48 Games 阅读(653) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 下一页