Пример #1
0
 private void AddArrow()
 {
     State          = EMainViewModel.AddingLine;
     addingLineType = ELine.Arrow;
     focusedObject  = null;
     Message        = "Select first dot.";
 }
Пример #2
0
        public void ShouldReturnDifferencePositionLine(EColumn column, ELine line, int correctDifferenceValue)
        {
            var position        = new Position(EColumn.E, ELine.Five);
            var positionCompare = new Position(column, line);

            Assert.Equal(position.DifferenceLine(positionCompare), correctDifferenceValue);
        }
Пример #3
0
        public void ShouldPositionLineNotBeEqual(EColumn column, ELine line)
        {
            var position1 = new Position(EColumn.A, ELine.One);
            var position2 = new Position(column, line);

            Assert.False(position1.EqualsLine(position2));
        }
Пример #4
0
        public void ShouldPositionColumnBeEqual(EColumn column, ELine line)
        {
            var position1 = new Position(EColumn.A, ELine.One);
            var position2 = new Position(column, line);

            Assert.True(position1.EqualsColumn(position2));
        }
Пример #5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="line"></param>
 public void SetLineToolboxSelection(ELine line)
 {
     //_drawingMode = true;
     _lineMode            = true;
     _shapeMode           = false;
     _toolboxLineValue    = line;
     Mouse.OverrideCursor = System.Windows.Input.Cursors.Arrow;
 }
Пример #6
0
 public Line(ELine type, IPoint from, IPoint to)
 {
     From        = from;
     To          = to;
     Type        = type;
     StoreFromId = from.AttachedID;
     StoreToId   = to.AttachedID;
 }
Пример #7
0
        public void ELine_TwoPointConstructor(double x1, double y1, double x2, double y2, double m, double b)
        {
            // Arrange
            double[] expected = { m, b };
            ELine    testLine = new ELine(new GPoint(x1, y1), new GPoint(x2, y2));

            // Act
            double[] actual = testLine.Equation;

            // Assert
            CollectionAssert.AreEqual(expected, actual, new DoubleComparer());
        }
Пример #8
0
        private static bool TryParseStringToELine(string value, out ELine line)
        {
            int lineChoosed;

            line = ELine.One;
            if (!int.TryParse(value, out lineChoosed))
            {
                return(false);
            }

            if (!Enum.GetValues(typeof(ELine)).Cast <ELine>().Any(x => (int)x == lineChoosed))
            {
                return(false);
            }

            line = (ELine)lineChoosed;

            return(true);
        }
Пример #9
0
        public bool FindLine(ref ELine line)
        {
            bool reSuccess = false;

            try
            {
                reSuccess = FindLine();
                line      = Base.MeasuredLine;
            }
            catch (EException exc)
            {
                StackFrame[] stackFrames = new StackTrace(true).GetFrames();
                clsLogFile.LogTryCatch(stackFrames, exc.Message, true, true);
            }
            catch (Exception ex)
            {
                StackFrame[] stackFrames = new StackTrace(true).GetFrames();
                clsLogFile.LogTryCatch(stackFrames, ex.Message, true, true);
            }
            return(reSuccess);
        }
Пример #10
0
        public bool FindLine(ref float centerX, ref float centerY, ref float angle)
        {
            bool reSuccess = false;

            try
            {
                ELine line = new ELine();
                reSuccess = FindLine(ref line);
                centerX   = line.CenterX;
                centerY   = line.CenterY;
                angle     = line.Angle;
            }
            catch (EException exc)
            {
                StackFrame[] stackFrames = new StackTrace(true).GetFrames();
                clsLogFile.LogTryCatch(stackFrames, exc.Message, true, true);
            }
            catch (Exception ex)
            {
                StackFrame[] stackFrames = new StackTrace(true).GetFrames();
                clsLogFile.LogTryCatch(stackFrames, ex.Message, true, true);
            }
            return(reSuccess);
        }
Пример #11
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="FromId"></param>
 /// <param name="ToId"></param>
 /// <param name="Type"></param>
 public UMLLine(Guid From, Guid To, ELine Type)
 {
     this.Type = Type;
     this.From = From;
     this.To   = To;
 }
Пример #12
0
 public UMLLine(Guid From, ELine Type)
 {
     this.Type = Type;
     this.From = From;
 }
Пример #13
0
 public Position(EColumn column, ELine line)
 {
     Column = column;
     Line   = line;
 }