internal Column(XmlNode n) { string p=" <c"; // This is the cell name foreach(XmlAttribute a in n.Attributes) if (a.Name!="r" && a.Name!="t") p=p+" "+a.Name+"=\""+a.Value+"\""; // Get all attributes except r and t string ci=new String(n.Attribute("r").Where(c => (c > '9')).ToArray()); // Get col Index as [r] without numeric chars part1=ASCIIEncoding.ASCII.GetBytes(p+" r=\""+ci); part2=ASCIIEncoding.ASCII.GetBytes("\"><v>"); part3=ASCIIEncoding.ASCII.GetBytes("</v></c>\n"); }
private bool TryGetConfigId(XmlNode query, out string configId) { configId = query.Attribute(XmlFlags.Attr_ConfigId); if (configId != null) return true; var where = query.Attribute("where"); if (string.IsNullOrWhiteSpace(where)) return false; var type = query.Attribute("type"); if (string.IsNullOrWhiteSpace(type)) return false; var prefix = string.Format("[{0}].[config_id] = '", type.Replace(' ', '_')); if (where.StartsWith(prefix, StringComparison.OrdinalIgnoreCase) && where.Length >= (prefix.Length + 33)) { configId = prefix.Substring(prefix.Length, 32); return true; } return false; }