public bool TryUnparse(StringBuilder sb) { Contracts.AssertValue(sb); if (ResultType == null && KeyRange == null) { return(TryUnparseCore(sb)); } if (!TrySanitize()) { return(false); } if (CmdQuoter.NeedsQuoting(Name) || CmdQuoter.NeedsQuoting(Source)) { return(false); } int ich = sb.Length; sb.Append(Name); sb.Append(':'); if (ResultType != null) { sb.Append(ResultType.Value.GetString()); } if (KeyRange != null) { sb.Append('['); if (!KeyRange.TryUnparse(sb)) { sb.Length = ich; return(false); } sb.Append(']'); } else if (!string.IsNullOrEmpty(Range)) { sb.Append(Range); } sb.Append(':'); sb.Append(Source); return(true); }