예제 #1
0
 internal static void SetQueryOrderByLinesProperty(this QueryOrderByLinesProperty property, string propertyValue)
 {
     //    OrderBy=Country_Region_Code=Ascending,
     //            VAT_Registration_No=Ascending;
     while (!string.IsNullOrEmpty(propertyValue))
     {
         var column    = Parsing.MustMatch(ref propertyValue, @"^([^=]+)=").Groups[1].Value;
         var direction = Parsing.MustMatch(ref propertyValue, @"(Ascending|Descending),?\s?").Groups[1].Value.ToEnum <QueryOrderByDirection>();
         property.Value.Add(new QueryOrderByLine(column, direction));
     }
 }
예제 #2
0
        public static void Write(this QueryOrderByLinesProperty 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());
                writer.WriteLine("{0}={1}{2}", line.Column, line.Direction, isLastLine ? ";" : ",");
            }

            writer.Unindent();
        }