<CODE>
public static bool HasRows(this DataTable dataTable)
{
return dataTable.IsNull() ? false : (dataTable.Rows.Count > 0);
}
public static bool IsNull(this object o)
{
return (o == null);
}
To use:
If(dataTable.HasRows())
{
…
}
</CODE>
<CODE>
public static string ToTitleCase(this string inputString)
{
return Thread.CurrentThread.CurrentCulture.TextInfo.
ToTitleCase((inputString ?? string.Empty).ToLower());
}
</CODE>
<CODE>
INTERFACE
public interface IMyInterface
{
void MyMethod(string myString);
}
CLASS THAT IMPLEMENTS THE INTERFACE IMPLICITLY
public MyImplicitClass: IMyInterface
{
public void MyMethod(string myString)
{
///
}
}
CLASS THAT IMPLEMENTS THE INTERFACE EXPLICITLY
public MyExplicitClass: IMyInterface
{
void IMyInterface.MyMethod(string myString)
{
///
}
}
MyImplicitClass instance would work with either the class or the Interface:
MyImplicitClass myObject = new MyImplicitClass();
myObject.MyMethod("");
IMyInterface myObject = new MyImplicitClass();
myObject.MyMethod("");
MyExplicitClass would work only with the interface:
//The following line would not work.
MyExplicitClass myObject = new MyExplicitClass();
myObject.MyMethod("");
//This will work
IMyInterface myObject = new MyExplicitClass();
myObject.MyMethod("");
</CODE>
<CODE>
private double _total;
public double Total
{
get { return _total; }
set { _total = value; }
}
</CODE>
<CODE>
public double Total { get; set; }
</CODE>
<connectionStrings configSource="configs\ development.config" />
<CODE>
string delimitedString = "String.Split || RegEx.Split");
string[] ouputString = System.Text.RegularExpressions.Regex.Split(
delimitedString,
, System.Text.RegularExpressions.Regex.Escape("||"));
</CODE>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有