C#中的Windows运行时.pdf

C#中的Windows运行时.pdf
 

书籍描述

内容简介
《C#中的Windows运行时(英文版)》作者深入探讨了Windows运行时,你可以从中了解到设计和搭建Windows应用商店中应用的最佳方法。通过Jeff Richter这位公认的Windows和NET编程大师以及资深Windows咨询师Maarten vande Bospoort的指导,你将掌握基础概念。同时你也将获得如何进行架构、设计、优化和调试应用的实用见解和技巧。

编辑推荐
《C#中的Windows运行时(英文版)》由东南大学出版社出版。

作者简介
作者:(美国)瑞奇特(Jeffrey Richter) (美国)博斯波特(Maarten van de Bospoort)

目录
Foreword
Introduction
PART Ⅰ CORE CONCEPTS
CHAPTER 1 Windows Runtime primer
CHAPTER 2 App packaging and deployment
CHAPTER 3 Process model
PART Ⅱ CORE WINDOWS FACILITIES
CHAPTER 4 Package data and roaming
CHAPTER 5 Storage files and folders
CHAPTER 6 Stream input and output
CHAPTER 7 Networking
CHAPTER 8 Tile and toast notifications
CHAPTER 9 Background tasks
CHAPTER 10 Sharing data between apps
CHAPTER 11 Windows Store
Appendix: App containers
Index

文摘
版权页:



Imagine you're writing an app that allows the user to enter some data and then you write the data toa file.If, while saving the user's data, your app crashes or the power goes out, the file's contents areincomplete and your app might not be able to read the file back successfully.To make matters worse,what if the user was saving the new data in an existing file.Now the old data is destroyed and the new data is corrupt.
To address this problem, WinRT allows you to perform file write operations in a transacted fashion.That is, either the entire write occurs or none of it occurs.When writing data to a file, you shoulduse the technique shown in this section to guarantee the consistency of file data.The reason not touse this technique is that it temporarily requires some additional disk space and, if you are makingchanges to a large existing file, there is a performance impact.To start, you must first open a file with transacted write access by calling IStorageFile's Open- TransactedWriteAsync method.This method returns a StorageStreamTransaction object:public sealed class StorageStreamTransaction : IDisposable {
public IRandomAccessStream Stream { get; }
public IAsyncAction CommitAsync() ;
public void Dispose() ;
}
Once you have this object, all you need to do is query its Stream property, which returns an IRandomAccessStream.You get this same interface back when you call IStorageFile's OpenAsync method.With the IRandomAccessStream, you can use all the techniques already discussed in this chapter.For example, you can pass the IRandomAccessStream when constructingDataWriter and DataReader objects.

购买书籍

当当网购书 京东购书 卓越购书

PDF电子书下载地址

相关书籍

搜索更多