public IList<Person> GetAuthors() { List<Person> persons = new List<Person>(2); Freud = new Person(FREUDGUID, new DateTime(1856, 10, 25), new DateTime(1939, 10, 10), new DateTime(1909, 10, 23), "Sigmund Freud"); persons.Add(Freud); Lacan = new Person(LACANGUID, new DateTime(1901, 7, 4), new DateTime(1981, 3, 15), new DateTime(1954, 10, 23), "Lacan"); persons.Add(Lacan); return persons; }
private BoxWithText DrawAuthorBox(Person person, double top, int seq) { int startYear = person.Born.Year; int endYear = person.Dead.Year; int firstEventYear = person.FirstOccurrence.Year; if (endYear < _startViewYear) return null; if (startYear > _endViewYear) return null; if (startYear < _startViewYear) startYear = _startViewYear; if (endYear > _endViewYear) endYear = _endViewYear; if (firstEventYear > _endViewYear) firstEventYear = _endViewYear; if (firstEventYear < _startViewYear) firstEventYear = _startViewYear; int totalTimespan = endYear - startYear; int activeTimespan = endYear - firstEventYear; BoxWithText bwt = new BoxWithText(); bwt.Height = boxHeight; bwt.Width = YearToPixel(totalTimespan); bwt.WidthBox1 = YearToPixel(totalTimespan - activeTimespan); bwt.WidthBox2 = YearToPixel(activeTimespan); bwt.Text = person.FullName; bwt.SetValue(Canvas.TopProperty, top); bwt.SetValue(Canvas.LeftProperty, RelativeYearToPixel(startYear)); Color color1 = Helpers.HexToColor(colors[seq*2]); Color color2 = Helpers.HexToColor(colors[(seq*2) + 1]); bwt.BackgroundBox1 = new SolidColorBrush(color1); bwt.BackgroundBox2 = new SolidColorBrush(color2); return bwt; }