-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIsbn13.cs
41 lines (37 loc) · 1.28 KB
/
Isbn13.cs
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
using System;
namespace IsbnTools
{
public class Isbn13 : Ean13
{
protected internal Isbn13(RegistrationGroup group, string publisher, string title)
: this(group, publisher, title, CalculateEan13CheckDigit("" + group + publisher + title))
{
}
protected internal Isbn13(RegistrationGroup group, string publisher, string title, int checkDigit)
: base(group + publisher + title, checkDigit)
{
Group = group;
Publisher = publisher;
Title = title;
CheckDigit = checkDigit;
}
public RegistrationGroup Group { get; protected set; }
public string Publisher { get; protected set; }
public string Title { get; protected set; }
public override string ToString(string seperator, bool forceValidCheckDigit)
{
return string.Concat(new object[]
{
Group.UccPrefix,
seperator,
Group.GroupIdentifier,
seperator,
Publisher,
seperator,
Title,
seperator,
forceValidCheckDigit ? CalculatedCheckDigit : CheckDigit
});
}
}
}