AddSpecial() public method

public AddSpecial ( Special special ) : Id
special Special
return Id
Example #1
0
 public static Id<Special> AddRectangleSpecial(EventDB eventDB, RectangleF rect, SpecialColor color, LineKind lineKind, float lineWidth, float gapSize, float dashSize, float cornerRadius)
 {
     Special special = new Special(SpecialKind.Rectangle, new PointF[] { rect.Location, new PointF(rect.Right, rect.Bottom)});
     special.color = color;
     special.lineKind = lineKind;
     special.lineWidth = lineWidth;
     special.gapSize = gapSize;
     special.dashSize = dashSize;
     special.cornerRadius = cornerRadius;
     return eventDB.AddSpecial(special);
 }
Example #2
0
        // Add a text special to the event
        public static Id<Special> AddTextSpecial(EventDB eventDB, RectangleF boundingRectangle, string text, string fontName, bool bold, bool italic, SpecialColor color)
        {
            Special special = new Special(SpecialKind.Text, new PointF[2] { new PointF(boundingRectangle.Left, boundingRectangle.Bottom), new PointF(boundingRectangle.Right, boundingRectangle.Top) });
            special.text = text;
            special.fontName = fontName;
            special.fontBold = bold;
            special.fontItalic = italic;
            special.color = color;

            return eventDB.AddSpecial(special);
        }
Example #3
0
 // Add a point special to the event. The special is visible in all courses.
 public static Id<Special> AddPointSpecial(EventDB eventDB, SpecialKind specialKind, PointF location, float orientation)
 {
     Special special = new Special(specialKind, new PointF[1] { location });
     special.orientation = orientation;
     return eventDB.AddSpecial(special);
 }
Example #4
0
 public static Id<Special> AddLineSpecial(EventDB eventDB, PointF[] locations, SpecialColor color, LineKind lineKind, float lineWidth, float gapSize, float dashSize)
 {
     Special special = new Special(SpecialKind.Line, locations);
     special.color = color;
     special.lineKind = lineKind;
     special.lineWidth = lineWidth;
     special.gapSize = gapSize;
     special.dashSize = dashSize;
     return eventDB.AddSpecial(special);
 }
Example #5
0
 // Add a line or area special to the event. The special is visible in all courses.
 public static Id<Special> AddLineAreaSpecial(EventDB eventDB, SpecialKind specialKind, PointF[] locations)
 {
     Special special = new Special(specialKind, locations);
     return eventDB.AddSpecial(special);
 }
Example #6
0
        // Add a text special to the event
        public static Id<Special> AddImageSpecial(EventDB eventDB, RectangleF boundingRectangle, Bitmap imageBitmap, string imageName)
        {
            Debug.Assert(imageBitmap != null);
            Debug.Assert(imageName != null);

            Special special = new Special(SpecialKind.Image, new PointF[2] { new PointF(boundingRectangle.Left, boundingRectangle.Bottom), new PointF(boundingRectangle.Right, boundingRectangle.Top) });
            special.text = imageName;
            special.imageBitmap = imageBitmap;

            return eventDB.AddSpecial(special);
        }
Example #7
0
        // Add a description to the event.
        public static Id<Special> AddDescription(EventDB eventDB, bool allCourses, CourseDesignator[] courses, PointF topLeft, float cellSize, int numColumns)
        {
            Special special = new Special(SpecialKind.Descriptions, new PointF[2] { topLeft, new PointF(topLeft.X + cellSize, topLeft.Y) });
            special.allCourses = allCourses;
            if (! allCourses)
                special.courses = courses;
            special.numColumns = numColumns;
            Id<Special> specialId =  eventDB.AddSpecial(special);

            // Descriptions special are unique per course -- enforce this.
            UpdateDescriptionCourses(eventDB, specialId);

            return specialId;
        }