Exemplo n.º 1
0
        static void Main(string[] args)
        {
            string type = Console.ReadLine();
            string line = Console.ReadLine();

            GetLine getLine = type == "int" ? new GetLine(GetInteger) :
                              type == "real" ? new GetLine(GetDouble) :
                              type == "string" ? new GetLine(GetString) : null;

            getLine(line);
        }
Exemplo n.º 2
0
        public async Task <ActionResult> DeleteLine([FromBody] GetLine code)
        {
            var delLine = await db.Line.Where(x => x.LineId == code.LineId).ToListAsync();

            if (delLine.Any())
            {
                db.Line.RemoveRange(delLine);
                await db.SaveChangesAsync();

                return(Ok());
            }
            return(BadRequest());
        }
Exemplo n.º 3
0
        public async Task <ActionResult> AddLine([FromBody] GetLine code)
        {
            var lineList = await db.Line.Where(c => c.LineId == code.LineId && c.ApplicationName == code.ApplicationName).Select(o => o.LineId).FirstOrDefaultAsync();

            if (lineList != code.LineId)
            {
                db.Line.Add(new Line {
                    LineId          = code.LineId,
                    ApplicationName = code.ApplicationName
                });
                await db.SaveChangesAsync();

                return(Ok());
            }
            else
            {
                return(BadRequest());
            }
        }
Exemplo n.º 4
0
        bool SelectDirection()
        {
            using (var cmd = new GetLine())
            {
                cmd.AcceptZeroLengthLine = false;

                if (cmd.Get(out Line line) != Result.Success)
                {
                    return(false);
                }

                if (line.Direction == Vector3d.ZAxis)
                {
                    return(false);
                }

                m_plane = new Plane(line.From, new Vector3d(line.To - line.From), Vector3d.ZAxis);

                return(true);
            }
        }
Exemplo n.º 5
0
 public static void RegisterLetterPrinter(GetLine _letter)
 {
     _GetLetter += _letter;
 }
Exemplo n.º 6
0
 public static void RegisterLinePrinter(GetLine _line)
 {
     _GetLine += _line;
 }