public void Fix(DataTable schema) { if (_command == null || schema == null) { return; } VfpClientTracing.Tracer.TraceVerbose("{SchemaFixer...}"); var tableName = CommandTextParser.GetTableName(_command.CommandText); AddVfpType(schema, tableName); VfpClientTracing.Tracer.TraceVerbose("SchemaFixer: " + _command.CommandText); if (string.IsNullOrEmpty(tableName)) { VfpClientTracing.Tracer.TraceVerbose("{...SchemaFixer}"); return; } UpdateBaseTableName(schema, tableName); UpdatePrimaryKeyInformation(schema, tableName); FormatColumnValues(schema, new[] { SchemaTableColumn.ColumnName, SchemaTableColumn.BaseColumnName }); VfpClientTracing.Tracer.TraceVerbose("{...SchemaFixer}"); }
public override Task <bool> TryExecuteAsync(string text, IConsoleOutput output) { var parser = new CommandTextParser(); text = Preprocess(text); string name; var options = new Collection <Tuple <string, string> >(); var arguments = new Collection <string>(); if (!parser.Parse(text, out name, options, arguments)) { throw new Exception(); } foreach (var command in Commands) { if (!comparer.Equals(command.CommandName, name)) { continue; } if (ValidateCommand(command, options, arguments)) { return(command.ExecuteAsync(output, options, arguments)); } } return(Task.FromResult(false)); }
private void DetectPointCompleted(SpotInspectionResult res, object userToken) { res.Id = userToken as string; if (_sn == res.Id) { _dataAcquisition.MonitorDataReader.DetectPointCompletedEvent -= DetectPointCompleted; _dataAcquisition.SendData("SpotInspectionResult", CommandTextParser.GetJsonSerialization <SpotInspectionResult>(res)); } }
private void OnCmdInitialize() { _powerConfig.Clear(); if (MonitorAllConfig.Instance().PeripheralCfgDICDic == null) { return; } foreach (KeyValuePair <string, string> keyvalue in MonitorAllConfig.Instance().PeripheralCfgDICDic) { _powerConfig.Add(new PowerControlData() { Key = CommandTextParser.GetDeJsonSerialization <FunctionCardRoadInfo>(keyvalue.Key), Value = keyvalue.Value }); } }
private void SensorCallBack(TransferParams param, object userToken) { Action action = new Action(() => { try { ExecSensorData(CommandTextParser.GetDeJsonSerialization <PeripheralsLocateInfo>(param.Content)); } catch (Exception ex) { _fLogService.Error("ExistCatch:Auto Sensor CallBack Error:" + ex.ToString()); } finally { _autoReadEvent.Set(); } }); action.BeginInvoke(null, null); }
private void DetectPointCompleted(SpotInspectionResult res, object userToken) { res.Id = userToken as string; SendData("SpotInspectionResult", CommandTextParser.GetJsonSerialization <SpotInspectionResult>(res)); }