-
Notifications
You must be signed in to change notification settings - Fork 1
Quickstart
Daniel Gonzalez Garcia edited this page May 5, 2017
·
3 revisions
RomanNumeral is, probably, what is going to be used most of the time.
var thirty = new RomanNumeral(30);
ReadOnlyCollection<RomanFigure> xxx = thirty.Figures;
string XXX = thirty.ToString();RomanNumeral zero = RomanNumeral.Zero;RomanNumeral nineteenTwentyEight = RomanNumeral.Parse("MCMXXVIII");
bool _true = RomanNumeral.TryParse("MCMXXVIII", out nineteenTwentyEight);
ushort _1928 = nineteenTwentyEight.Value;int lessThanZero = thirty.CompareTo(nineteenTwentyEight);
_true = thirty < nineteenTwentyEight;
_true = nineteenTwentyEight >= thirty;
bool _false = nineteenTwentyEight.Equals(thirty);
_false = thirty == nineteenTwentyEight;_1928 = (ushort) nineteenTwentyEight;
XXX = (string) thirty;RomanNumeral sixty = thirty.Plus(thirty);
thirty = sixty.Minus(thirty);
sixty = thirty + thirty;
thirty = sixty - thirty;RomanFigure might not be the most used type for SharpRomans, but it is a pretty complete numeric type.
RomanFigure fromAccesor = RomanFigure.L;// parse a char
RomanFigure ten = RomanFigure.Parse('X');
bool _true = RomanFigure.TryParse('X', out ten);
// parse a string
RomanFigure five = RomanFigure.Parse("V");
_true = RomanFigure.TryParse("V", out five);
// convert a number
var one = RomanFigure.Convert(1);
RomanFigure.TryConvert(1, out one);ushort _5 = five.Value;
char V = five.Literal;
string quinque = five.Name;int lessThanZero = five.CompareTo(ten);
_true = five < ten;
_true = five >= one;
bool _false = five.Equals(ten);
_false = ten == five;_5 = (ushort) five;
V = (char) five;