Make properties case insensitive

Add unimplemented boxes to Log File.
This commit is contained in:
Rich 2011-10-06 14:43:51 +00:00
parent 12a9006816
commit faf4e1b5d9
2 changed files with 26 additions and 5 deletions

View File

@ -54,7 +54,9 @@ namespace VEPROMS.CSLA.Library
} }
private XmlNode GetGroup(string group) private XmlNode GetGroup(string group)
{ {
XmlNodeList xl = _XmlContents.DocumentElement.SelectNodes(string.Format("//{0}", group)); //XmlNodeList xl = _XmlContents.DocumentElement.SelectNodes(string.Format("//{0}", group));
XmlNodeList xl = _XmlContents.DocumentElement.SelectNodes(
string.Format("//*[translate(local-name(), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')='{0}']", group.ToLower()));
switch (xl.Count) switch (xl.Count)
{ {
case 0: // No nodes found case 0: // No nodes found
@ -69,7 +71,9 @@ namespace VEPROMS.CSLA.Library
} }
private XmlAttribute GetItem(XmlNode xx, string item) private XmlAttribute GetItem(XmlNode xx, string item)
{ {
XmlNodeList xl = xx.SelectNodes(string.Format("@{0}", item)); //XmlNodeList xl = xx.SelectNodes(string.Format("@{0}", item));
XmlNodeList xl = xx.SelectNodes(
string.Format("//@*[translate(local-name(), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')='{0}']", item.ToLower()));
switch (xl.Count) switch (xl.Count)
{ {
case 0: // No nodes found case 0: // No nodes found

View File

@ -97,9 +97,13 @@ namespace Volian.Print.Library
cb.Rectangle(left + llxOffset, bottom + (lineThickness / 2), right - left, (Height - lineThickness) * MyPageHelper.YMultiplier); cb.Rectangle(left + llxOffset, bottom + (lineThickness / 2), right - left, (Height - lineThickness) * MyPageHelper.YMultiplier);
break; break;
default: default:
// For other than thick, thin and double. // For other than thick, thin and double.
//Console.WriteLine("NO BOXES"); if (!_UnimplementedBoxStyles.Contains(MyBox.BoxStyle))
_MyLog.WarnFormat("INVALID BOX SYTLE {0} \"{1}\"", MyParent.MyItemInfo.FormatStepData.Type, CharToAsc(MyBox.BoxStyle)); {
_UnimplementedBoxStyles.Add(MyBox.BoxStyle);
_MyLog.InfoFormat("Unimplemented Box Style {0} {1}", ShowBoxStyle(MyBox.BoxStyle), MyParent.MyItemInfo.ShortPath);
//Console.WriteLine("Unimplemented Box Style {0} {1}", ShowBoxStyle(MyBox.BoxStyle), MyParent.MyItemInfo.ShortPath);
}
break; break;
//throw new Exception("Missing vlnBox handler"); //throw new Exception("Missing vlnBox handler");
} }
@ -110,6 +114,19 @@ namespace Volian.Print.Library
return yPageStart; return yPageStart;
} }
private string ShowBoxStyle(string str)
{
StringBuilder sb = new StringBuilder();
foreach (Char c in str)
{
if (c >= ' ' && c < 128)
sb.Append(c);
else
sb.Append(string.Format("x{0:X0000}", (int)c));
}
return sb.ToString();
}
private static List<string> _UnimplementedBoxStyles = new List<string>();
private string CharToAsc(string p) private string CharToAsc(string p)
{ {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();