public virtual bool TryParse(string s, string startTime, out object obj) { if (IsCoded) { var code = CodeList.Get(s); if (code == null) { obj = null; return(false); } obj = code.Id.ToString(); return(true); } else { return(TextFormat.TryParse(s, startTime, out obj)); } }
public bool TrySerialize(object obj, out string s, out string startTime) { if (IsCoded) { var code = CodeList.Get(obj.ToString()); if (code == null) { s = startTime = null; return(false); } s = code.Id; startTime = null; return(true); } else { return(TextFormat.TrySerialize(obj, out s, out startTime)); } }