12 2013 档案

摘要:根据这几幅应该不再为wcf中的配置发愁了。 阅读全文
posted @ 2013-12-29 21:58 haiziguo 阅读(332) 评论(0) 推荐(0)
摘要:wcf中的契约通信默认是请求恢复的方式,当客户端发出请求后,一直到服务端回复时,才可以继续执行下面的代码。除了使用请求应答方式的通信外,还可以使用全双工。下面给出例子:1.添加一个wcf类库2.在服务契约添加如下一个片段[ServiceContract(Namespace = "http://Microsoft.ServiceModel.Samples", SessionMode = SessionMode.Required, CallbackContract = typeof(ICalculatorDuplexCallback))] public interface IC 阅读全文
posted @ 2013-12-29 21:53 haiziguo 阅读(9226) 评论(3) 推荐(1)
摘要:delegate是一个像class的关键字,delegate void Click_HandleEvent(object sender,string args)和class Person一样。都是定义一个类型。当使用Click_HandleEvent handle是引用了一个类型的变量。当Person p也是引用了一个变量。使用Fun和Action的好处是不用定义Delegate void Click_HandleEvent定义一个类型了。因为Fun和Action充当了声明一个事件。委托作为参数的好处是,让具体的委托延迟到了调用的地方。GetConsumeHistoryList(Action 阅读全文
posted @ 2013-12-29 14:10 haiziguo 阅读(238) 评论(0) 推荐(0)
摘要:列表页面:xaml:Gridview中的数据源是实体的集合:所以每次点击每个项时,其事件参数为实体,可以通过实体来得到主键。列表页面的vm:GridViewItemClick_Command = new RelayCommand(callback => { ExCommandParameter para = callback as ExCommandParameter; if (null != para) { SFModelBase item = (para.EventArgs as ItemClickEventArgs).ClickedItem as SFModelBase; Navi 阅读全文
posted @ 2013-12-12 19:59 haiziguo 阅读(314) 评论(0) 推荐(0)
摘要:public static readonly DependencyProperty IsUpdateUIProperty = DependencyProperty.Register( "IsUpdateUI", typeof(bool), typeof(LoginStackPanel), new PropertyMetadata(false, (a, b) => { LoginStackPanel lsp ... 阅读全文
posted @ 2013-12-04 11:00 haiziguo 阅读(426) 评论(0) 推荐(0)
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Drawing;using System.Linq;using System.Windows.Forms;using System.Threading;namespace doWorker{ public partial class Form1 : Form { delegate void MyDelegate(int value); Thread t;//new一个新线程,以便用来... 阅读全文
posted @ 2013-12-03 10:59 haiziguo 阅读(1737) 评论(0) 推荐(0)