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); }
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()); }
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()); } }
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); } }
public static void RegisterLetterPrinter(GetLine _letter) { _GetLetter += _letter; }
public static void RegisterLinePrinter(GetLine _line) { _GetLine += _line; }