Ejemplo n.º 1
0
        public static void Write(this RunObjectLinkProperty property, bool isLastProperty, PropertiesStyle style, CSideWriter writer)
        {
            writer.Write("{0}=", property.Name);
            writer.Indent(writer.Column);

            foreach (var line in property.Value)
            {
                var isLastLine = (line == property.Value.Last());

                switch (isLastProperty && isLastLine)
                {
                case true:
                    writer.Write("{0}={1}({2}) ", line.FieldName, line.Type.GetValueOrDefault().AsString(), line.Value);
                    break;

                case false:
                    writer.Write("{0}={1}({2})", line.FieldName, line.Type.GetValueOrDefault().AsString(), line.Value);
                    writer.WriteLineIf(isLastLine, ";");
                    writer.WriteLineIf(!isLastLine, ",");
                    break;
                }
            }

            writer.Unindent();
        }
Ejemplo n.º 2
0
        internal static void SetObjectLinkProperty(this RunObjectLinkProperty property, string propertyValue)
        {
            //			Payment Term=FIELD(Code);

            while (propertyValue.Length > 0)
            {
                var fieldName = Parsing.MustMatch(ref propertyValue, @"^([^=]+)=").Groups[1].Value;
                var type      = Parsing.MustMatch(ref propertyValue, @"(CONST|FILTER|FIELD)").Groups[1].Value.ToEnum <TableFilterType>();
                Parsing.MustMatch(ref propertyValue, @"^\(");
                var value = Parsing.MatchUntilUnnested(ref propertyValue, ')', '(');

                property.Value.Add(new RunObjectLinkLine(fieldName, type, value));

                Parsing.TryMatch(ref propertyValue, @"^,\s?");
            }
        }