当前位置: 首页 > news >正文

信誉好的东莞网站设计河间市网站建设

信誉好的东莞网站设计,河间市网站建设,湖北建设厅行政服务中心网站,企业为什么选择上市组件描述 该组件为Windows Phone 7 本身C#框架扩展了一系列方法#xff0c;可以使你在编写代码的时候减少重复复制#xff0c;并且增加了许多通用功能#xff0c;使你的编写代码的时候可以更加流畅和得以应手。 扩展类别 该组件是将我们日常常用到的数据类型或者集合等操作再…   组件描述     该组件为Windows Phone 7 本身C#框架扩展了一系列方法可以使你在编写代码的时候减少重复复制并且增加了许多通用功能使你的编写代码的时候可以更加流畅和得以应手。   扩展类别 该组件是将我们日常常用到的数据类型或者集合等操作再一次封装成易于使用的静态方法分类为如下几大类 String 字符串扩展DateTime 日期扩展Guid 全局唯一标识符扩展IEnumerable 集合扩展Object 对象扩展Stream 流扩展Uri  统一资源标识符扩展Bool  真假“是否”扩展Int  整型扩展 扩展方法体 以下为每个静态类的扩展方法列表 StringExtensions 静态方法成员截图 Format 代码   public static string Format(this string self, params object[] args){    if (self  null)    {        throw new ArgumentNullException(format);    }    return string.Format(self, args);}     HasValue 代码   public static bool HasValue(this string self){    return !string.IsNullOrEmpty(self);}     IsNullOrEmpty代码 public static bool IsNullOrEmpty(this string self){    return string.IsNullOrEmpty(self);}   IsValidEmailAddress代码 public static bool IsValidEmailAddress(this string self){    Regex regex  new Regex(^[\w-\.]([\w-]\.)[\w-]{2,4}$);    return regex.IsMatch(self);}   Split 代码   public static IEnumerablestring Split(this string self, char separator){    return self.Split(new char[] { separator });  }       public static IEnumerablestring Split(this string self, string separator){    return self.Split(new string[] { separator }, StringSplitOptions.None);}     ToInt 代码   public static int ToInt(this string self){    int num;    if (!int.TryParse(self, out num))    {        throw new InvalidOperationException(Value is not valid.);    }    return num;}      Trim 代码 public static string Trim(this string self, char character){    return self.Trim(new char[] { character });}     DateTimeExtensions 静态方法成员截图 AddWeek 代码 public static DateTime AddWeek(this DateTime dateTime){    return dateTime.AddDays(7.0);}   ToUnixTimestamp代码 public static long ToUnixTimestamp(this DateTime date){    DateTime time  new DateTime(0x7b2, 1, 1, 0, 0, 0);    TimeSpan span  (TimeSpan) (date - time);    return (long) span.TotalSeconds;}   Tip上面的time 是1/1/1970 12:00:00 AM GuidExtensions 静态方法成员截图 IsGuidEmpty 代码 public static bool IsGuidEmpty(this Guid self){    return (self  Guid.Empty);}   RemoveHyphen 代码   public static string RemoveHyphen(this Guid self){    return self.ToString().Replace(-, );}     IEnumerableExtensions 静态方法成员截图 ExistsInT 代码 public static bool ExistsInT(this T obj, IEnumerableT collection){    return Enumerable.ContainsT(collection, obj);}     ForEachT 代码 public static void ForEachT(this IEnumerableT sequence, ActionT action){    if (sequence  null)    {        throw new ArgumentNullException(The secuence is null!);    }    if (action  null)    {        throw new ArgumentNullException(The action is null!);    }    foreach (T local in sequence)    {        action(local);    }}     IsNullOrEmpty 代码 public static bool IsNullOrEmptyT(this IEnumerableT obj){    if (!obj.IsNull())    {        return (Enumerable.CountT(obj)  0);    }    return true;} ToObservableCollectionT 代码 public static ObservableCollectionT ToObservableCollectionT(this IEnumerableT source){    ObservableCollectionT observables  new ObservableCollectionT();    source.ForEachT(new ActionT(observables.Add));    return observables;}   ObjectExtensions 静态方法成员截图 In 代码   public static bool In(this object self, IEnumerable enumerable){    return (enumerable.IsNotNull()  Enumerable.Containsobject(Enumerable.Castobject(enumerable), self));}     IsNotNull 代码   public static bool IsNotNull(this object self){    return (self ! null);}     IsNull 代码   public static bool IsNull(this object self){    return (self  null);}   NullTolerantEquals 代码   public static bool NullTolerantEquals(this object self, object obj){    if (self.IsNull()  obj.IsNotNull())    {        return false;    }    if (self.IsNotNull()  obj.IsNull())    {        return false;    }    return ((self.IsNull()  obj.IsNull()) || self.Equals(obj));}     StreamExtensions 静态方法成员列表截图 EqualsStream 代码   public static bool EqualsStream(this Stream originalStream, Stream streamToCompareWith){    return originalStream.EqualsStream(streamToCompareWith, Math.Max(originalStream.Length, streamToCompareWith.Length));}      public static bool EqualsStream(this Stream originalStream, Stream streamToCompareWith, long readLength){    originalStream.Position  0L;    streamToCompareWith.Position  0L;    for (int i  0; i  readLength; i)    {        if (originalStream.ReadByte() ! streamToCompareWith.ReadByte())        {            return false;        }    }    return true;}     ReadAllText 代码   public static string ReadAllText(this Stream stream){    using (StreamReader reader  new StreamReader(stream))    {        return reader.ReadToEnd();    }}     ToByteArray 代码   public static byte[] ToByteArray(this Stream stream){    MemoryStream writeStream  new MemoryStream();    StreamHelper.CopyStream(stream, writeStream, true);    return writeStream.ToArray();}     UriExtensions 静态方法成员列表截图 Parameters 代码   public static Dictionarystring, string Parameters(this Uri self){    if (self.IsNull())    {        throw new ArgumentException(Uri cant be null.);    }    if (string.IsNullOrEmpty(self.Query))    {        return new Dictionarystring, string();    }    if (CS$9__CachedAnonymousMethodDelegate2  null)    {        CS$9__CachedAnonymousMethodDelegate2  new Funcstring, string(null, (IntPtr) Parametersb__0);    }    if (CS$9__CachedAnonymousMethodDelegate3  null)    {        CS$9__CachedAnonymousMethodDelegate3  new Funcstring, string(null, (IntPtr) Parametersb__1);    }    return Enumerable.ToDictionarystring, string, string(self.Query.Substring(1).Split(new char[] {  }), CS$9__CachedAnonymousMethodDelegate2, CS$9__CachedAnonymousMethodDelegate3);}     BoolExtensions 静态方法成员列表截图 IsFalse 代码   public static bool IsFalse(this bool self){    return !self;}     IsTrue 代码   public static bool IsTrue(this bool self){    return self;}    IntExtensions 静态方法成员列表截图     IsWithin 代码   public static bool IsWithin(this int self, int minimum, int maximum){    if (minimum  maximum)    {        throw new ArgumentException(minimum must be of less value than maximum.);    }    return ((self  minimum)  (self  maximum));}       组件下载Extension转载于:https://www.cnblogs.com/TerryBlog/archive/2011/02/27/1966479.html
http://www.pierceye.com/news/192545/

相关文章:

  • 网站建设 语言成都app
  • 免费建站的手机app专业做网站设计公司价格
  • 江苏宜兴做网站的电话seo基础培训
  • 企业手机端网站模板下载济南公司建站模板
  • 一般公司做网站多少钱南昌市房产网
  • 惠州网站小程序建设做公司永久免费网站什么好
  • 湖南涟钢建设有限公司网站局网站建设工作总结
  • 家乡ppt模板免费下载网站合肥百姓网网站建设
  • 免费整套ppt模板下载网站东莞建设教育网站
  • 漯河网站建设漯河ps制作个人网站首页
  • 电商网站公司软件开发和软件研发
  • 网站建设浙江公司网站开发运营新人要注意什么
  • 外贸网站模板哪里下载家里电脑可以做网站服务器吗
  • 长沙门户网站北京设计网站的公司
  • 站长统计平面设计找工作难吗
  • seo建站公司推荐电商平台活动策划方案
  • 建设淘宝客网站.lc和ev手机对比平台
  • vue 做企业网站特产网站开发背景
  • 奉新网站制作dede视频网站源码
  • 做动画网站去哪采集建设网站需要的资金清单
  • 网站后台发邮件注册公司需要什么证件和手续
  • 炫酷特效网站万网虚拟主机免费空间
  • 公司网站模板最新怀远网站建设哪家好
  • 交互式网站定义如何网上找加工订单
  • 一个域名可以做几个网站吗南城网站建设公司
  • 宝安商城网站建设flash新手入门简单动画制作
  • 设置网站建设WordPress adsen
  • 网站与微信内容建设与运维总结建筑网络图
  • 网站模板文件不存在网站建设礻金手指下拉十二
  • 东莞浩智建设网站公司做百度推广员赚钱吗