12 2008 档案
摘要:提高 LINQ to XML 中的性能的一种方法是预原子化 XName 对象。预原子化是指在通过使用 XElement 和 XAttribute 类的构造函数创建 XML 树之前,先将字符串分配给 XName 对象。然后传递初始化的 XName 对象,而不是将字符串传递给构造函数(此过程将使用从字符串到 XName 的隐式转换)。 XName Root = "Root"; XName Data =...
阅读全文
摘要:string xslMarkup = @" "; XDocument xmlTree = new XDocument( ...
阅读全文
摘要:XElement root = XElement.Load("Irregular.xml"); IEnumerable configParameters = root.Elements("Customer").Elements("Config"). Elements("ConfigParameter"); foreach (XElement cp in configParamet...
阅读全文
摘要://检索元素集合 XElement po = XElement.Load("c:/test.xml"); IEnumerable childElements = //from el in po.Descendants("Book") from el in po.Descendants("...
阅读全文
摘要:IEnumerable grandChildData = from el in StreamRootChildDoc(new StringReader(markup)) where (int)el.Attribute("Key") > 1 select (string)el.Element("Grand...
阅读全文
摘要:XDocument d = new XDocument( new XComment("This is a comment."), new XProcessingInstruction("xml-stylesheet", "href='mystyle.css' title='Compact' type='text/css'"), new...
阅读全文
摘要:XElement c = new XElement("Customers", new XElement("Customer", new XElement("Name", "John Doe"), new XElement("PhoneNumbers", new XElement("Phone", ...
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; namespace linq { class Program { static void Main(string[] args) { ...
阅读全文
摘要:public IQueryable Find(TEntity obj) where TEntity : class { //获得所有property的信息 PropertyInfo[] properties = obj.GetType().GetProperties(BindingFlags.Public | BindingFlag...
阅读全文
摘要:Imports Imports Imports Imports Module Module1 Sub Main() Dim db As New NorthwindDataContext Dim customers = From customer In db.Customers _ Order By c...
阅读全文
摘要://C#的例子 using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.U...
阅读全文
摘要:Untitled Page Pick a cateogyr: ...
阅读全文
摘要:private void BindProducts(int startRow) { NorthwindDataContext db = new NorthwindDataContext(); //var ca = from c in db.Categories // where ...
阅读全文
摘要:配置文件 代码: using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using Sy...
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; using System.Xml; namespace ConsoleApplication1 { class Program { static vo...
阅读全文
摘要:主机:using System;using System.ServiceModel;namespace InheritanceDemo{ [ServiceContract] interface ISimpleCalculator { [OperationContract] int Add(int a...
阅读全文
摘要:http://news.cnblogs.com/n/43821/
阅读全文
摘要:http://news.cnblogs.com/n/43826/
阅读全文
摘要:http://news.cnblogs.com/n/37151/
阅读全文
摘要:http://news.cnblogs.com/n/44079/
阅读全文
摘要:WCF的中的Endpoint结构,一个Endpoint就类似于xml web service中的一个asmx文件,它包括三个组成部分1)Address 2) Binding 3) Contract,此三者被称为组成Endpoint的"ABC".A解决了Endpoint在哪的问题,也就是"Where ...
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ChickenAndEgg { class Program { static void Main(string[] args) { Eg...
阅读全文
摘要:participants The classes and/or objects participating in this pattern are: Context (Account) defines the interface of interest to clients maintains an instance of a Con...
阅读全文
摘要:participants The classes and/or objects participating in this pattern are: Handler (Approver) defines an interface for handling the requests (optional) implements th...
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace Flyweight { public partial class _Default : Sys...
阅读全文
摘要:1、最酷的就是这个航班浏览器了,微软写的例子。 http://silverlight.net/samples/sl2/silverlightairlines/run/default.html 源码下载:http://silverlight.net/samples/sl2/silverlightairlines/source/Source_SilverlightAirlines_CS.zip 2、欧...
阅读全文
摘要:participants The classes and/or objects participating in this pattern are: Component (LibraryItem) defines the interface for objects that can have responsibilities added to th...
阅读全文
摘要:http://blogs.msdn.com/corrinab/archive/2008/10/01/8971166.aspx
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; us...
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace SilverlightInterview.Web { public class Note { public Note() { } public string ID...
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; namespace SilverlightInterview.Web { /// /// StockService 的摘要说明 /// [W...
阅读全文
摘要:private void GetAllValues(XElement doc) { ChartValues = new List(); ChartKeys = new List(); var myValues = from pv in doc.Descendants("value") ...
阅读全文
摘要:编写WCF服务接口 using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.ServiceModel; using System.Text; namespace SilverlightApplication11.We...
阅读全文
摘要:编写Web service using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; namespace SilverlightApplication10.Web { /// /// WebService1 的摘...
阅读全文
摘要:在向特定 URI 发送 HTTP 请求时,基于 HTTP 的服务将返回数据。 HTTP 请求可以发送至各种 URI。此类 URI 包括 http://YouURL.com/service/getUser、http://YouURL.com/service.svc/getUser 等,甚至包括静态数据,例如 http://YouURL.com/data.xml。配置 HTTP 请求通常使用表示...
阅读全文
摘要:转载自[孟子E章] http://blog.csdn.net/net_lover/archive/2008/11/26/3379002.aspx ...
阅读全文
摘要:XML操作 将 XMLWriter 内容保存至客户端 修改 page.xaml 文件 在应用程序的 page.xaml.cs源文件中,添加下面的 using 语句: sing System.Xml; using System.IO; using System.Text; using System.IO.IsolatedStorage; 全部代码: using System; ...
阅读全文
摘要:本地(客户端)数据存储 通过使用独立存储,数据将始终按用户在虚拟文件系统中隔离,虚拟文件系统可以是根目录中的一个文件,也可以是一个目录和文件树。 独立存储数据舱是一个抽象的存储位置,而不是一个具体的存储位置。它由一个或多个独立的存储文件(称为存储区)组成,这些存储文件包含存储数据的实际目录位置。任何类型的数据都可以保存到存储区中。 存储区通常驻留在客户端,但应用程序也可以使用服务器上的...
阅读全文
摘要:对象数据绑定 分三步实现: 1:在工程中创建一个类 using System; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Ink; using System.Windows.Input; usi...
阅读全文
摘要:泛型数据绑定 数组绑定 首先拖放一个ComboBox: 定义数组: int[] myIntArray = new int[5] { 1, 2, 3, 4, 5 }; Page代码绑定: QYLX.ItemsSource = myIntArray; List) 类绑定 List ListLX=n...
阅读全文
摘要:使用一个嵌套的 Canvas 创建了蓝色矩形框包围下的红色矩形效果。 Text Surrounded by a Border StackPanel垂直排列 水平排列 Grid 是 Silverlight 提供的灵活程度最高、功能最为强大的容器对象。Grid 定义一个由列和行组成的灵活的网格区域...
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows...
阅读全文
摘要:首先写一个类: public class Employee { public string FirstName { get; set; } public string LastName { get; set; } public decimal Salary { get; set; } public DateTime StartDate { get; set; } pub...
阅读全文
摘要:新建一个类:Book using System.Collections.Generic; using System.ComponentModel; namespace GlobalStyles { public class Book : INotifyPropertyChanged { private string bookTitle; priv...
阅读全文
摘要:Silverlight网站“运行后一片空白”的解决方案: 在Silverlight中需要使用xap、XAML文件类型,如果您想在IIS服务器上使用Silverlight程序,所以必须在IIS中注册xaml和xap的MIME文件类型。打开IIS->站点属性->HTTP头->MIME类型->新建: 扩展名: .xap MIME类型:xapapplication/x-silverlight ...
阅读全文
摘要:using System; using System.Web; using System.Diagnostics; namespace HDI { public class HTTPFilter : IHttpModule { System.IO.StreamWriter fileWriter; HttpApplication applicationContext; ...
阅读全文
摘要:using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts...
阅读全文