示例#1
0
        internal static ImagemapMessageAction Convert(IImagemapMessageAction action)
        {
            if (action.Area == null)
            {
                throw new InvalidOperationException("The area cannot be null.");
            }

            if (action.Text == null)
            {
                throw new InvalidOperationException("The text cannot be null.");
            }

            if (!(action is ImagemapMessageAction imagemapMessageAction))
            {
                imagemapMessageAction = new ImagemapMessageAction()
                {
                    Text = action.Text
                };
            }

            imagemapMessageAction.Area = ImagemapArea.Convert(action.Area);

            return(imagemapMessageAction);
        }
        internal static ImagemapUriAction Convert(IImagemapUriAction action)
        {
            if (action.Area == null)
            {
                throw new InvalidOperationException("The area cannot be null.");
            }

            if (action.Url == null)
            {
                throw new InvalidOperationException("The url cannot be null.");
            }

            if (!(action is ImagemapUriAction imagemapUriAction))
            {
                imagemapUriAction = new ImagemapUriAction()
                {
                    Url = action.Url
                };
            }

            imagemapUriAction.Area = ImagemapArea.Convert(action.Area);

            return(imagemapUriAction);
        }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ImagemapMessageAction"/> class.
 /// </summary>
 /// <param name="text">
 /// The text of the message.
 /// <para>Max: 400 characters.</para>
 /// </param>
 /// <param name="area">The tappable area.</param>
 public ImagemapMessageAction(string text, ImagemapArea area)
     : this()
 {
     Text = text;
     Area = area;
 }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ImagemapUriAction"/> class.
 /// </summary>
 /// <param name="url">The webpage url.</param>
 /// <param name="x">The x position.</param>
 /// <param name="y">The y position.</param>
 /// <param name="width">The width.</param>
 /// <param name="height">The height.</param>
 public ImagemapUriAction(Uri url, int x, int y, int width, int height)
     : this(url)
 {
     Area = new ImagemapArea(x, y, width, height);
 }
示例#5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ImagemapMessageAction"/> class.
 /// </summary>
 /// <param name="text">The text of the message</param>
 /// <param name="x">The x position.</param>
 /// <param name="y">The y position.</param>
 /// <param name="width">The width.</param>
 /// <param name="height">The height.</param>
 public ImagemapMessageAction(string text, int x, int y, int width, int height)
     : this(text)
 {
     Area = new ImagemapArea(x, y, width, height);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ImagemapUriAction"/> class.
 /// </summary>
 /// <param name="url">
 /// The webpage url.
 /// <para>Max url length: 1000 characters.</para>
 /// </param>
 /// <param name="area">The tappable area.</param>
 public ImagemapUriAction(Uri url, ImagemapArea area)
     : this()
 {
     Url  = url;
     Area = area;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ImagemapUriAction"/> class.
 /// </summary>
 /// <param name="url">
 /// The webpage url.
 /// <para>Max url length: 1000 characters.</para>
 /// </param>
 /// <param name="area">The tappable area.</param>
 public ImagemapUriAction(string url, ImagemapArea area)
     : this(new Uri(url), area)
 {
 }