本文整理汇总了C#中DateTimeOffset.ToDaysAgo方法的典型用法代码示例。如果您正苦于以下问题:C# DateTimeOffset.ToDaysAgo方法的具体用法?C# DateTimeOffset.ToDaysAgo怎么用?C# DateTimeOffset.ToDaysAgo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateTimeOffset
的用法示例。
在下文中一共展示了DateTimeOffset.ToDaysAgo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NewsFeedElement
public NewsFeedElement(string imageUrl, DateTimeOffset time, IEnumerable<TextBlock> headerBlocks, IEnumerable<TextBlock> bodyBlocks, UIImage littleImage, Action tapped)
{
Uri.TryCreate(imageUrl, UriKind.Absolute, out _imageUri);
_time = time.ToDaysAgo();
_actionImage = littleImage;
_tapped = tapped;
var header = CreateAttributedStringFromBlocks(headerBlocks);
_attributedHeader = header.Item1;
_headerLinks = header.Item2;
var body = CreateAttributedStringFromBlocks(bodyBlocks);
_attributedBody = body.Item1;
_bodyLinks = body.Item2;
_bodyBlocks = bodyBlocks.Count();
}
示例2: Bind
public void Bind(string title, string status, string priority, string assigned, DateTimeOffset lastUpdated, string id, string kind)
{
Caption.Text = title;
Label1.Text = status;
Label2.Text = priority;
Label3.Text = assigned;
Label4.Text = lastUpdated.ToDaysAgo();
Number.Text = "#" + id;
IssueType.Text = kind;
/*
if (model.CommentCount > 0)
{
var ms = model.CommentCount.ToString ();
var ssize = ms.MonoStringLength(CountFont);
var boxWidth = Math.Min (22 + ssize, 18);
AddSubview(new CounterView(model.CommentCount) { Frame = new RectangleF(Bounds.Width-30-boxWidth, Bounds.Height / 2 - 8, boxWidth, 16) });
}
*/
}