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

Commit 2ef556b

Browse files
committed
Clean up *Designer classes
Fix warnings in LocalRepositoryModelDesigner and RemoteRepositoryModelDesigner.
1 parent 79af9ae commit 2ef556b

File tree

4 files changed

+24
-65
lines changed

4 files changed

+24
-65
lines changed
Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,16 @@
1-
using System;
2-
using System.ComponentModel;
3-
using System.Threading.Tasks;
4-
using GitHub.Models;
1+
using GitHub.Models;
52
using GitHub.Primitives;
63
using GitHub.UI;
7-
using GitHub.Exports;
84

95
namespace GitHub.App.SampleData
106
{
117
public class LocalRepositoryModelDesigner : LocalRepositoryModel
128
{
13-
public UriString CloneUrl { get; set; }
9+
public new UriString CloneUrl { get; set; }
1410
public BranchModel CurrentBranch { get; set; }
15-
public Octicon Icon { get; set; }
16-
public string LocalPath { get; set; }
17-
public string Name { get; set; }
18-
public string Owner { get; set; }
19-
20-
#pragma warning disable CS0067
21-
public event PropertyChangedEventHandler PropertyChanged;
22-
#pragma warning restore CS0067
23-
24-
public Task<UriString> GenerateUrl(LinkType linkType, string path = null, int startLine = -1, int endLine = -1)
25-
{
26-
throw new NotImplementedException();
27-
}
28-
29-
public void Refresh()
30-
{
31-
throw new NotImplementedException();
32-
}
33-
34-
public void SetIcon(bool isPrivate, bool isFork)
35-
{
36-
throw new NotImplementedException();
37-
}
11+
public new Octicon Icon { get; set; }
12+
public new string LocalPath { get; set; }
13+
public new string Name { get; set; }
14+
public new string Owner { get; set; }
3815
}
3916
}

src/GitHub.App/SampleData/RemoteRepositoryModelDesigner.cs

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,16 @@ namespace GitHub.SampleData
88
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1036:OverrideMethodsOnComparableTypes")]
99
public class RemoteRepositoryModelDesigner : RemoteRepositoryModel
1010
{
11-
public UriString CloneUrl { get; set; }
12-
public DateTimeOffset CreatedAt { get; set; }
13-
public BranchModel DefaultBranch { get; set; }
14-
public Octicon Icon { get; set; }
15-
public long Id { get; set; }
16-
public bool IsFork { get; set; }
17-
public string Name { get; set; }
18-
public string Owner { get; set; }
19-
public IAccount OwnerAccount { get; set; }
20-
public RemoteRepositoryModel Parent { get; set; }
21-
public DateTimeOffset UpdatedAt { get; set; }
22-
23-
public int CompareTo(RemoteRepositoryModel other)
24-
{
25-
return 0;
26-
}
27-
28-
public void CopyFrom(RemoteRepositoryModel other)
29-
{
30-
}
31-
32-
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations")]
33-
public bool Equals(RemoteRepositoryModel other)
34-
{
35-
return false;
36-
}
37-
38-
public void SetIcon(bool isPrivate, bool isFork)
39-
{
40-
}
11+
public new UriString CloneUrl { get; set; }
12+
public new DateTimeOffset CreatedAt { get; set; }
13+
public new BranchModel DefaultBranch { get; set; }
14+
public new Octicon Icon { get; set; }
15+
public new long Id { get; set; }
16+
public new bool IsFork { get; set; }
17+
public new string Name { get; set; }
18+
public new string Owner { get; set; }
19+
public new IAccount OwnerAccount { get; set; }
20+
public new RemoteRepositoryModel Parent { get; set; }
21+
public new DateTimeOffset UpdatedAt { get; set; }
4122
}
4223
}

src/GitHub.Exports.Reactive/Models/RemoteRepositoryModel.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ namespace GitHub.Models
1212
public class RemoteRepositoryModel : RepositoryModel, ICopyable<RemoteRepositoryModel>,
1313
IEquatable<RemoteRepositoryModel>, IComparable<RemoteRepositoryModel>
1414
{
15-
protected RemoteRepositoryModel()
16-
{
17-
// Used by designer
18-
}
19-
2015
/// <summary>
2116
/// Initializes a new instance of the <see cref="RemoteRepositoryModel"/> class.
2217
/// </summary>
@@ -43,6 +38,13 @@ public RemoteRepositoryModel(long id, string name, UriString cloneUrl, bool isPr
4338
Parent = parent;
4439
}
4540

41+
/// <summary>
42+
/// This is used by <see cref="RemoteRepositoryModelDesigner"/>.
43+
/// </summary>
44+
protected RemoteRepositoryModel()
45+
{
46+
}
47+
4648
#region Equality Things
4749
public void CopyFrom(RemoteRepositoryModel other)
4850
{

src/GitHub.Exports/Models/LocalRepositoryModel.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,5 @@ public bool Equals(LocalRepositoryModel other)
5959
CloneUrl,
6060
LocalPath,
6161
GetHashCode());
62-
6362
}
6463
}

0 commit comments

Comments
 (0)