private void WriteParameterType(ArmStringLiteral typeName) { Write("[ArmParameter["); Write(typeName.Value); Write("]]"); WriteLine(); }
public object VisitStringValue(ArmStringLiteral stringValue) { Write("'"); Write(stringValue.Value.Replace("'", "''")); Write("'"); return(null); }
private TObject ReadSubobject <TObject, TValue>(JObject jObj, TObject armObj, Func <string, JToken, TValue> convert) where TObject : ArmObject where TValue : ArmElement { foreach (KeyValuePair <string, JToken> entry in jObj) { var key = new ArmStringLiteral(entry.Key); armObj[key] = convert(entry.Key, entry.Value); } return(armObj); }
public static bool TryConvertToArmExpression(object value, out ArmExpression armExpression) { if (value is null) { armExpression = ArmNullLiteral.Value; return(true); } Type type = value.GetType(); switch (Type.GetTypeCode(type)) { case TypeCode.String: case TypeCode.DateTime: case TypeCode.Char: armExpression = new ArmStringLiteral(value.ToString()); return(true); case TypeCode.Int32: case TypeCode.Int64: case TypeCode.Int16: case TypeCode.UInt32: case TypeCode.UInt64: case TypeCode.UInt16: case TypeCode.Byte: case TypeCode.SByte: armExpression = new ArmIntegerLiteral(Convert.ToInt64(value)); return(true); case TypeCode.Single: case TypeCode.Double: case TypeCode.Decimal: armExpression = new ArmDoubleLiteral(Convert.ToDouble(value)); return(true); case TypeCode.Boolean: armExpression = Convert.ToBoolean(value) ? ArmBooleanLiteral.True : ArmBooleanLiteral.False; return(true); case TypeCode.DBNull: armExpression = ArmNullLiteral.Value; return(true); } if (value is ArmExpression inputArmExpression) { armExpression = inputArmExpression; return(true); } armExpression = null; return(false); }
public static bool TryConvertToArmString(object value, out IArmString armString) { switch (value) { case string str: armString = new ArmStringLiteral(str); return(true); case IArmString armStr: armString = armStr; return(true); } armString = null; return(false); }
public virtual VisitAction VisitStringValue(ArmStringLiteral stringValue) => DefaultVisit(stringValue);
VisitAction IArmVisitor <VisitAction> .VisitStringValue(ArmStringLiteral stringValue) { return(GetFinalParentAction(VisitStringValue(stringValue))); }
public object VisitStringValue(ArmStringLiteral stringValue) { stringValue.RunVisit(_expressionWriter); return(null); }
protected ArmReferenceExpression(ArmStringLiteral referenceFunction, TReference referencedValue) : this(referenceFunction, referencedValue.ReferenceName) { ReferencedValue = referencedValue; }
protected ArmReferenceExpression(ArmStringLiteral referenceFunction, IArmString referencedName) : base(referenceFunction, new[] { (ArmExpression)referencedName }) { ReferenceName = referencedName; }
public JToken VisitStringValue(ArmStringLiteral stringValue) => new JValue(stringValue.Value);