static public SimulateVariableUnit Create(string _name, string type = "") { SimulateVariableUnit result = null; SpecialValue svalue = SpecialValueManager.ValueOfName(_name); if (svalue != null) { type = svalue.Type; } if (type.Length == 0) { result = _Create(_name); } else { result = _Create(_name, type); } if (result == null) { return(result); } if (svalue != null) { SimulateSpecialUnit ssunit = new SimulateSpecialUnit( result, svalue.CanRead, svalue.CanWrite); ssunit.Var = svalue.NickName; return(ssunit); } return(result); }
public void CreateObjectSpecialValueTest() { var expected = new SpecialValue(); var c = CsvParser <SpecialValue> .FromType(); var actual = c.CreateObject(c.CreateCsvLine(expected)); Assert.AreEqual(expected, actual); }
private SpecialValue getSpecialValue(string package) { SpecialValue val = new SpecialValue(); val.VariableName = package.Substring(this.fields[(int)DataFields.VARIABLE_NAME].Index, this.fields[(int)DataFields.VARIABLE_NAME].Size); val.Type = DataType.DataTypes.SingleOrDefault(x => x.Type == package.Substring(this.fields[(int)DataFields.TYPE].Index, this.fields[(int)DataFields.TYPE].Size).Trim()); val.Length = Convert.ToInt32(package.Substring(this.fields[(int)DataFields.LENGTH].Index, this.fields[(int)DataFields.LENGTH].Size)); val.Value = package.Substring(this.fields[(int)DataFields.VALUE].Index, val.Length); val.StepNumber = Convert.ToInt32(package.Substring(this.fields[(int)DataFields.VALUE].Index + val.Length, this.fields[(int)DataFields.STEP_NUMBER].Size)); return(val); }
/// <summary> /// Creates a new symbol. /// </summary> /// <returns>The anonymous.</returns> /// <param name="value">Value.</param> /// <param name="flag">Flag.</param> public static Symbol CreateAnonymous(LLVMValueRef value, SpecialValue flag) => new Symbol(string.Empty, value) { isanonymous = true, specialvalue = flag };
/// <summary> /// 增加查询条件,查询方式默认为等于查询 /// </summary> /// <param name="fieldName">字段名</param> /// <param name="fieldValue">字段值</param> /// <returns></returns> public SearchCondition AddSearch(string fieldName, SpecialValue fieldValue) { return(AddSearch(fieldName, fieldValue.ToString())); }
public void AddSelectedValue() { SpecialValue.CopiedValue = SpecialValue.GetValueAgainstSpecialValue(SelectedSpecialValue); }
/// <inheritdoc /> /// <exception cref="System.ArgumentException"> /// Thrown always since special value is not valid in an expression /// </exception> public override void VisitSpecialValue(SpecialValue value) { throw new ArgumentException("Expression cannot contain any special value"); }
public static Value Special(SpecialValue value) { return(new Value { _special = value }); }