資源簡介
C#插件框架源代碼,學習架構的好代碼C#插件框架源代碼,學習架構的好代碼

代碼片段和文件信息
/**********************************************************
?●項目:Chsoft.framework.Core
?●公司:北京超鴻電腦軟件開發中心
?●作者:曹艷白
?●郵箱:smartkernel@126.com
?●創建:2008-08-10
**********************************************************/
using?System;
using?System.Diagnostics;
namespace?Chsoft.framework.Core
{
????///?
????///?智能行為操作類,封裝對委托,函數調用等相關的功能
????///?
????public?static?class?SmartAction
????{
????????///?
????????///?判斷委托調用是不是會引發異常
????????///?
????????///?需要調用的無參函數
????????///?調用的結果,true代表引發了異常,false則相反
????????public?static?bool?IsInvokeFail(Action?action)
????????{
????????????bool?isInvokeFail?=?false;
????????????try
????????????{
????????????????action.Invoke();
????????????}
????????????catch
????????????{
????????????????isInvokeFail?=?true;
????????????}
????????????return?isInvokeFail;
????????}
????????///?
????????///?運行時間長度測試
????????///?
????????///?等待被測試的函數
????????///?執行的次數
????????///?運行的總時間
????????public?static?TimeSpan?ExecuteTime(Action?action?int?times)
????????{
????????????Stopwatch?stopwatch?=?new?Stopwatch();
????????????stopwatch.Start();
????????????for?(int?i?=?0;?i?????????????{
????????????????action.Invoke();
????????????}
????????????stopwatch.Stop();
????????????return?TimeSpan.FromMilliseconds(stopwatch.ElapsedMilliseconds);
????????}
????????///?
????????///?For循環器
????????///?
????????///?要循環的動作
????????///?循環的次數
????????public?static?void?ForCirculator(Action?action?int?times)
????????{
????????????for?(int?i?=?0;?i?????????????{
????????????????action.Invoke();
????????????}
????????}
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????4019??2008-09-09?09:08??Chsoft.fr
?????文件???????3981??2008-09-09?09:08??Chsoft.fr
????..A.SH.???????175??2008-09-09?09:08??Chsoft.fr
?????文件?????142848??2008-10-13?13:35??Chsoft.fr
?????文件?????380416??2008-10-13?13:35??Chsoft.fr
?????文件?????224148??2008-10-13?13:35??Chsoft.fr
?????文件?????102400??2008-09-19?17:25??Chsoft.fr
?????文件??????61440??2008-09-19?17:25??Chsoft.fr
?????文件??????32768??2008-09-19?17:25??Chsoft.fr
?????文件???????9119??2008-09-09?09:08??Chsoft.fr
?????文件???????3566??2008-09-09?09:08??Chsoft.fr
?????文件???????5269??2008-09-09?09:08??Chsoft.fr
?????文件??????11171??2008-09-09?09:08??Chsoft.fr
????..A.SH.???????225??2008-09-09?09:08??Chsoft.fr
?????文件???????9819??2008-10-09?19:10??Chsoft.fr
?????文件????????287??2008-09-09?09:08??Chsoft.fr
?????文件???????3041??2008-09-09?09:08??Chsoft.fr
????..A.SH.???????120??2008-09-09?09:08??Chsoft.fr
?????文件??????54968??2008-09-09?09:08??Chsoft.fr
?????文件????????760??2008-09-09?09:08??Chsoft.fr
?????文件????????932??2008-09-09?09:08??Chsoft.fr
?????文件???????1865??2008-09-09?09:08??Chsoft.fr
?????文件????????998??2008-09-09?09:08??Chsoft.fr
?????文件???????3789??2008-09-09?09:08??Chsoft.fr
?????文件???????1247??2008-09-09?09:08??Chsoft.fr
????..A.SH.???????352??2008-09-09?09:08??Chsoft.fr
?????文件???????1645??2008-09-09?09:08??Chsoft.fr
?????文件???????1625??2008-09-09?09:08??Chsoft.fr
?????文件???????1598??2008-09-09?09:08??Chsoft.fr
????..A.SH.???????205??2008-09-09?09:08??Chsoft.fr
............此處省略126個文件信息
評論
共有 條評論