本文整理汇总了C#中String.IsNullOrEmpty方法的典型用法代码示例。如果您正苦于以下问题:C# String.IsNullOrEmpty方法的具体用法?C# String.IsNullOrEmpty怎么用?C# String.IsNullOrEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类String
的用法示例。
在下文中一共展示了String.IsNullOrEmpty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PagerBuilder
public PagerBuilder(HtmlHelper htmlHelper, AjaxHelper ajaxHelper, String actionName, String controllerName, int noOfPages, int pageIndex, PagerOptions pagerOptions, String routeName, RouteValueDictionary routeValues, AjaxOptions ajaxOptions, IDictionary<String, object> htmlAttributes)
{
_msAjaxPaging = (default(AjaxHelper) != ajaxHelper);
if (actionName.IsNullOrEmpty())
{
actionName = _msAjaxPaging
? (String) ajaxHelper.ViewContext.RouteData.Values["action"]
: (String) htmlHelper.ViewContext.RouteData.Values["action"];
}
if (controllerName.IsNullOrEmpty())
{
controllerName = _msAjaxPaging
? (String) ajaxHelper.ViewContext.RouteData.Values["controller"]
: (String) htmlHelper.ViewContext.RouteData.Values["controller"];
}
if (null == pagerOptions) pagerOptions = new PagerOptions();
_htmlHelper = htmlHelper;
_ajaxHelper = ajaxHelper;
_actionName = actionName;
_controllerName = controllerName;
_NoOfPages = noOfPages;
_pageIndex = pageIndex;
_pagerOptions = pagerOptions;
_routeName = routeName;
_routeValues = routeValues;
_ajaxOptions = ajaxOptions;
_htmlAttributes = htmlAttributes;
// start page index
_startPageIndex = pageIndex - (pagerOptions.NumericPagerItemCount / 2);
if (_startPageIndex + pagerOptions.NumericPagerItemCount > _NoOfPages)
_startPageIndex = _NoOfPages + 1 - pagerOptions.NumericPagerItemCount;
if (_startPageIndex < 1) _startPageIndex = 1;
// end page index
_endPageIndex = _startPageIndex + _pagerOptions.NumericPagerItemCount - 1;
if (_endPageIndex > _NoOfPages) _endPageIndex = _NoOfPages;
}