Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ATMarkDTO"/> class.
 /// </summary>
 /// <param name="annotation">
 /// The picture.
 /// </param>
 public ATMarkDTO(ATAnnotation annotation) : this(annotation.Mark)
 {
     this.positionX = annotation.PositionX;
     this.positionY = annotation.PositionY;
     this.text      = annotation.Comment;
     this.width     = annotation.Width;
     this.height    = annotation.Height;
     this.style     = annotation.IconName;
     // this. = annotation.IsOpened;
     this.color       = annotation.Color;
     this.createdBy   = annotation.CreatedBy;
     this.fillOpacity = annotation.FillOpacity.Value;
 }
Esempio n. 2
0
        /// <summary>
        /// Converts <see cref="ATMarkDTO"/> to requested entity type
        /// </summary>
        /// <param name="mark">the mark</param>
        /// <param name="existing">existing item</param>
        /// <returns>corresponding entity</returns>
        public ATAnnotation ToAnnotation(ATMarkDTO mark, ATAnnotation existing)
        {
            var o = existing ?? new ATAnnotation();

            o.Mark      = this.ToMark(mark, null != existing ? existing.Mark : null);
            o.PositionX = mark.positionX;
            o.PositionY = mark.positionY;
            o.Comment   = mark.text;
            o.Width     = mark.width;
            o.Height    = mark.height;
            o.IconName  = mark.style;
            //o.IsOpened = mark.;
            o.Color       = mark.color;
            o.CreatedBy   = mark.createdBy;
            o.FillOpacity = mark.fillOpacity;
            return(o);
        }