当前位置: 首页>>代码示例>>C#>>正文


C# Article.NotNull方法代码示例

本文整理汇总了C#中Article.NotNull方法的典型用法代码示例。如果您正苦于以下问题:C# Article.NotNull方法的具体用法?C# Article.NotNull怎么用?C# Article.NotNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Article的用法示例。


在下文中一共展示了Article.NotNull方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ResponseMessageNews

        /// <summary>
        /// 初始化一个新的图文响应消息实例。
        /// </summary>
        /// <param name="articles">文章信息。</param>
        /// <exception cref="ArgumentNullException"><paramref name="articles"/> 为 null。</exception>
        /// <exception cref="ArgumentException"><paramref name="articles"/> 长度大于 <see cref="ArticleMaxCount"/> 10。</exception>
        public ResponseMessageNews(Article[] articles)
        {
            if (articles.NotNull("articles").Length > ArticleMaxCount)
                throw new ArgumentException(string.Format("文章数量不能大于 {0} 条。", ArticleMaxCount), "articles");

            Articles = articles;
        }
开发者ID:coderen,项目名称:WeiXinSDK,代码行数:13,代码来源:ResponseMessageNews.cs

示例2: CustomServiceMessageNews

        /// <summary>
        /// 初始化一个新的图文客服消息。
        /// </summary>
        /// <param name="toUserId">接收消息的用户Id。</param>
        /// <param name="articles">图文项。</param>
        public CustomServiceMessageNews(string toUserId, Article[] articles)
            : base(toUserId)
        {
            if (articles.NotNull("articles").Length > ArticleMaxCount)
                throw new ArgumentException(string.Format("文章数量不能大于 {0} 条。", ArticleMaxCount), "articles");

            Articles = articles;
        }
开发者ID:newlysoft,项目名称:WeiXinSDK-1,代码行数:13,代码来源:CustomServiceMessageService.cs


注:本文中的Article.NotNull方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。