Пример #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);
        }