mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 12:45:00 +00:00
style: add .editorconfig for code formatting. see issu #25
This commit is contained in:
parent
a8eeea4f78
commit
18aaa0a143
225 changed files with 7781 additions and 3911 deletions
|
@ -1,28 +1,36 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace SourceGit.Models {
|
||||
public class User {
|
||||
namespace SourceGit.Models
|
||||
{
|
||||
public class User
|
||||
{
|
||||
public static User Invalid = new User();
|
||||
public static Dictionary<string, User> Caches = new Dictionary<string, User>();
|
||||
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string Email { get; set; } = string.Empty;
|
||||
|
||||
public override bool Equals(object obj) {
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj == null || !(obj is User)) return false;
|
||||
|
||||
var other = obj as User;
|
||||
return Name == other.Name && Email == other.Email;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
|
||||
public static User FindOrAdd(string data) {
|
||||
if (Caches.ContainsKey(data)) {
|
||||
public static User FindOrAdd(string data)
|
||||
{
|
||||
if (Caches.ContainsKey(data))
|
||||
{
|
||||
return Caches[data];
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
var nameEndIdx = data.IndexOf('<', System.StringComparison.Ordinal);
|
||||
var name = nameEndIdx >= 2 ? data.Substring(0, nameEndIdx - 1) : string.Empty;
|
||||
var email = data.Substring(nameEndIdx + 1);
|
||||
|
@ -33,4 +41,4 @@ namespace SourceGit.Models {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue