Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 5354ea2

Browse files
authoredApr 11, 2019
Merge pull request #2156 from github/autocompletebox
Migrating and Updating AutoCompleteBox from *original* GitHub Desktop for Windows
2 parents 98a843b + 0b5badb commit 5354ea2

File tree

62 files changed

+5786
-120
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+5786
-120
lines changed
 
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
using System;
2+
using GitHub.Extensions;
3+
using GitHub.Helpers;
4+
5+
namespace GitHub.Models
6+
{
7+
/// <summary>
8+
/// Represents a single auto completion suggestion (mentions, emojis, issues) in a generic format that can be
9+
/// easily cached.
10+
/// </summary>
11+
public class SuggestionItem
12+
{
13+
public SuggestionItem(string name, string description)
14+
{
15+
Guard.ArgumentNotEmptyString(name, "name");
16+
Guard.ArgumentNotEmptyString(description, "description");
17+
18+
Name = name;
19+
Description = description;
20+
}
21+
22+
public SuggestionItem(string name, string description, string imageUrl)
23+
{
24+
Guard.ArgumentNotEmptyString(name, "name");
25+
26+
Name = name;
27+
Description = description;
28+
ImageUrl = imageUrl;
29+
}
30+
31+
/// <summary>
32+
/// The name to display for this entry
33+
/// </summary>
34+
public string Name { get; set; }
35+
36+
/// <summary>
37+
/// Additional details about the entry
38+
/// </summary>
39+
public string Description { get; set; }
40+
41+
/// <summary>
42+
/// An image url for this entry
43+
/// </summary>
44+
public string ImageUrl { get; set; }
45+
46+
/// <summary>
47+
/// The date this suggestion was last modified according to the API.
48+
/// </summary>
49+
public DateTimeOffset? LastModifiedDate { get; set; }
50+
}
51+
}

‎src/GitHub.App/SampleData/CommentViewModelDesigner.cs

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Reactive;
44
using System.Threading.Tasks;
55
using GitHub.Models;
6+
using GitHub.Services;
67
using GitHub.ViewModels;
78
using ReactiveUI;
89

@@ -37,6 +38,7 @@ public CommentViewModelDesigner()
3738
public ReactiveCommand<Unit, Unit> CommitEdit { get; }
3839
public ReactiveCommand<Unit, Unit> OpenOnGitHub { get; } = ReactiveCommand.Create(() => { });
3940
public ReactiveCommand<Unit, Unit> Delete { get; }
41+
public IAutoCompleteAdvisor AutoCompleteAdvisor { get; }
4042

4143
public Task InitializeAsync(ICommentThreadViewModel thread, ActorModel currentUser, CommentModel comment, CommentEditState state)
4244
{

0 commit comments

Comments
 (0)
This repository has been archived.