コード例 #1
0
ファイル: WordsWriter.cs プロジェクト: AndreyShp/StudyFun
 public PointWithSign(Point leftCorner, Point rightCorner, ISourceWithTranslation text)
 {
     LeftCorner      = leftCorner;
     RightCorner     = rightCorner;
     SourceText      = text.Source.Text;
     TranslationText = text.Translation.Text;
 }
コード例 #2
0
        private GapsTrainerItem ConvertToGapsItem(ISourceWithTranslation sourceWithTranslation)
        {
            var item = new GapsTrainerItem {
                Id          = sourceWithTranslation.Id,
                TextForUser = GetTextWithGaps(sourceWithTranslation.Source.Text),
                Original    = sourceWithTranslation.Source,
                Translation = sourceWithTranslation.Translation
            };

            return(item);
        }
コード例 #3
0
ファイル: WordsWriter.cs プロジェクト: AndreyShp/StudyFun
        public void AddRectangle(Point leftCorner, Point rightCorner, ISourceWithTranslation text)
        {
            var leftPointWithShift  = new Point(leftCorner.X + _leftX, leftCorner.Y + _leftY);
            var rightPointWithShift = new Point(rightCorner.X + _leftX, rightCorner.Y + _leftY);

            var pointWithSign = new PointWithSign(leftPointWithShift, rightPointWithShift, text);

            if (_isHorizontalLine)
            {
                AddPoint(pointWithSign, leftPointWithShift.Y, rightPointWithShift.Y, _centerY);
            }
            else
            {
                AddPoint(pointWithSign, leftPointWithShift.X, rightPointWithShift.X, _centerX);
            }
        }