示例#1
0
        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);
        }
示例#2
0
        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);
        }