This repository was archived by the owner on Jun 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathCommentViewModelDesigner.cs
More file actions
46 lines (42 loc) · 1.77 KB
/
CommentViewModelDesigner.cs
File metadata and controls
46 lines (42 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Diagnostics.CodeAnalysis;
using System.Reactive;
using System.Threading.Tasks;
using GitHub.Models;
using GitHub.ViewModels;
using ReactiveUI;
namespace GitHub.SampleData
{
[SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
public class CommentViewModelDesigner : ReactiveObject, ICommentViewModel
{
public CommentViewModelDesigner()
{
Author = new ActorViewModel { Login = "shana" };
}
public string Id { get; set; }
public int PullRequestId { get; set; }
public int DatabaseId { get; set; }
public string Body { get; set; }
public string ErrorMessage { get; set; }
public CommentEditState EditState { get; set; }
public bool IsReadOnly { get; set; }
public bool IsSubmitting { get; set; }
public bool CanCancel { get; } = true;
public bool CanDelete { get; } = true;
public string CommitCaption { get; set; } = "Comment";
public ICommentThreadViewModel Thread { get; }
public DateTimeOffset CreatedAt => DateTime.Now.Subtract(TimeSpan.FromDays(3));
public IActorViewModel Author { get; set; }
public Uri WebUrl { get; }
public ReactiveCommand<Unit, Unit> BeginEdit { get; }
public ReactiveCommand<Unit, Unit> CancelEdit { get; }
public ReactiveCommand<Unit, Unit> CommitEdit { get; }
public ReactiveCommand<Unit, Unit> OpenOnGitHub { get; } = ReactiveCommand.Create(() => { });
public ReactiveCommand<Unit, Unit> Delete { get; }
public Task InitializeAsync(ICommentThreadViewModel thread, ActorModel currentUser, CommentModel comment, CommentEditState state)
{
return Task.CompletedTask;
}
}
}