Example #1
0
        public static ImagemapArea ToImagemapArea(this IImagemapArea self)
        {
            if (self.Width == 0)
            {
                throw new InvalidOperationException("The width should be at least 1.");
            }

            if (self.Height == 0)
            {
                throw new InvalidOperationException("The height should be at least 1.");
            }

            if (self is ImagemapArea imagemapArea)
            {
                return(imagemapArea);
            }

            return(new ImagemapArea()
            {
                X = self.X,
                Y = self.Y,
                Width = self.Width,
                Height = self.Height
            });
        }
Example #2
0
 internal static ImagemapArea Convert(IImagemapArea area)
 {
     return(new ImagemapArea()
     {
         X = area.X,
         Y = area.Y,
         Width = area.Width,
         Height = area.Height
     });
 }