2014年3月23日
摘要:
Using .NET 4's Lazy typeExplanation of the following code:If you're using .NET 4 (or higher) then you can use the System.Lazy type to make the laziness really simple.All you need to do is pass a delegate to the constructor that calls the Singleton constructor, which is done most easily with
阅读全文
posted @ 2014-03-23 08:44
武胜-阿伟
阅读(313)
推荐(0)
2014年3月21日
摘要:
using System;using System.Collections.Concurrent;using System.Threading;using System.Threading.Tasks;using System.Threading.Tasks.Dataflow;namespace TDFDemo{class Program{static void Main(string[] args){new Program().Run();}private async void Run(){var bus = new Bus();// Inline handlervar s1 = bus.S
阅读全文
posted @ 2014-03-21 09:15
武胜-阿伟
阅读(362)
推荐(0)
2014年3月20日
摘要:
SQLiteConnection sqConnection = dataProvider.GetDbConnection(); sqConnection.Open(); SQLiteCommand sqCommand = new SQLiteCommand(); SQLiteTransaction myTrans; // Start a local transaction myTrans = sqConnection.BeginTransaction(System.Data.IsolationLevel.Serializab...
阅读全文
posted @ 2014-03-20 20:46
武胜-阿伟
阅读(2958)
推荐(0)
摘要:
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace xSoft.Utility.UI{ public class ExportUtility { public static void ExportGridToFile(DevExpress.XtraGrid.Views.Base.BaseView gridView, string reportName, string fullFileName = null) { ...
阅读全文
posted @ 2014-03-20 20:15
武胜-阿伟
阅读(765)
推荐(1)
2014年3月19日
摘要:
http://www.codeproject.com/Articles/746191/SQLite-Helper-CsharpIntroductionI have written a small class, SQLiteHelper which aims to simplify the usage of SQLite in C#.PrerequisiteThis small class is built on top of System.Data.SQLite.DLL. A reference of this DLL must be added into your projects.Down
阅读全文
posted @ 2014-03-19 20:04
武胜-阿伟
阅读(3814)
推荐(0)
摘要:
Using the CodeAdd a textbox named 'txtWords' to a form.Add a button named 'btnSpeak' to a form.Add a reference to System.Speech.In the form's code-behind, add: Collapse | Copy Codeusing System.Windows.Forms;using System.Speech.Synthesis;namespace Sample{ public partial Class Form
阅读全文
posted @ 2014-03-19 11:35
武胜-阿伟
阅读(378)
推荐(1)
2014年3月17日
摘要:
关键代码请参考http://www.devexpress.com/Support/Center/p/K18333.aspx最新DEMO 下载The current GridLookUpEdit's implementation doesn't provide interfaces to force the described feature to work automatically. However, in this article, we'll try to create a GridLookUpEdit's descendant and introduce
阅读全文
posted @ 2014-03-17 22:10
武胜-阿伟
阅读(10051)
推荐(0)
摘要:
1.struct是值类型,class是对象类型2.struct不能被继承,class可以被继承3.struct默认的访问权限是public,而class默认的访问权限是private.4..struct的new和class的new是不同的。struct的new就是执行一下构造函数创建一个新实例再对所 有的字段进行Copy。而class则是在堆上分配一块内存然后再执行构造函数,struct的内存并不是在new的时候分配的,而是在定义的时候分配, 换句话话说struct是在线程栈中创建,其定义时就已经被初始化,而class必须用new在托管堆中开辟空间。因此struct与class在作为 参数传值
阅读全文
posted @ 2014-03-17 22:07
武胜-阿伟
阅读(393)
推荐(0)
摘要:
1、Navigation&Layout1.1BarManager如果想在窗体或用户控件(usercontrol)上添加工具条(bars)或弹出菜单(popupmenus),我们 需要把一个不可见的控件(component)BarManager(Navigation&Layout)拖放到这个窗体或用户控件上。这个控 件维护工具条在窗体上的布局,处理用户的行为(processesanend-user'sactions),提供一些定制功能等等。这个控件维护 工具条、工具条项、工具条项目录这三者的集合 (Itmaintainsthecollectionsofbars,barit
阅读全文
posted @ 2014-03-17 22:06
武胜-阿伟
阅读(32194)
推荐(2)
摘要:
一:Clone返回新的 DataTableClone返回新的 DataTable,与当前的 DataTable 具有相同的架构;Copy:返回新的 DataTable,它具有与该 DataTable 相同的结构(表架构和约束)和数据DataRow[] _dr = DT.Select("CLSSBH='"+ Filter_Str +"'"); DataTable dt = DT.Clone() ; DataRow dr ; for( int j = 0 ;j = 0) { DataRow row = gridView1.GetDataRow
阅读全文
posted @ 2014-03-17 22:03
武胜-阿伟
阅读(8637)
推荐(1)