txt2bib/Records.cs

29 lines
997 B
C#

using System;
namespace Txt2Bib.Records
{
public interface IBib { }
public record class ArticleBib : IBib
{
public string Type { get; init; } = "article";
public string[] Author { get; init; } = { "" };
public string Title { get; init; } = "";
public string Journal { get; init; } = "";
public ushort Year { get; init; } = 1950;
public ushort Volume { get; init; } = 1;
public byte Issue { get; init; } = 1;
public ushort FirstPage { get; init; } = 1;
public ushort LastPage { get; init; } = 1;
public override string ToString()
{
return $"@{Type}\\{{{Author[0][..5]}_{Year}," +
$"\ttitle = \"{Title}\"," +
$"\tjournal = \"{Journal}\"," +
$"\tyear = \"{Year}\"," +
$"\tvolume = \"{Volume}\"," +
$"\tnumber = \"{Issue}\"," +
$"\tpages = \"{FirstPage}--{LastPage}\",";
}
}
}