public Highlightytesttesty(IPlatform plt) : base(plt) { Size = new Size(300, 300); t.styleRanges.Add(new UStyleRange(0, 5, null, null, usb1)); t.styleRanges.Add(new UStyleRange(8, 2, null, null, usb1)); AnimatedRect ar = new AnimatedRect(); ar.area = new Rectangle(0, 0, 300, 300); BeginDirty(ar); }
public Guid BeginDirty(AnimatedRect ar) { // Give 10 chances to get a unique key. Guid newKey = Guid.NewGuid(); int tries = 0; while (ars.ContainsKey(newKey)) { newKey = Guid.NewGuid(); if (tries++ > 10) { throw new ArgumentException("Could not generate another unique guid"); } } ars[newKey] = ar; return(newKey); }