예제 #1
0
파일: DateNode.cs 프로젝트: wrmsr/xdc
        public DateContext(NodeContext parent, TerminalNode node)
            : base(parent, node)
        {
            DateTime to = !string.IsNullOrEmpty(Node.Atts["To"]) ? DateTime.Parse(Node.Atts["To"]) : Root.Now;
            DateTime from  = !string.IsNullOrEmpty(Node.Atts["From"]) ? DateTime.Parse(Node.Atts["From"]) : Root.Now;

            TimeSpan diff = to.Subtract(from);
            DateTime dt = to.AddMilliseconds(Root.Rand.Next(diff.Milliseconds));

            val = new StaticNodeValue(dt.ToString(Node.Atts["Fmt"] ?? string.Empty));
        }
예제 #2
0
파일: SQLRenderer.cs 프로젝트: wrmsr/xdc
 public virtual string TransformValue(FieldContext field, StaticNodeValue sv)
 {
     return QuoteStr(sv.Value);
 }