This commit is contained in:
2011-03-23 15:01:19 +00:00
parent 7193488913
commit 5877037beb
2 changed files with 14 additions and 5 deletions

View File

@@ -226,6 +226,7 @@ namespace Volian.Controls.Library
public class LinePatternArray
{
#region Properties
protected static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private int _Rows;
[XmlAttribute("Rows")]
public int Rows
@@ -262,7 +263,13 @@ namespace Volian.Controls.Library
#region Array Access
public GridLinePattern this[int r, int c]
{
get { return Lines[r * Columns + c]; }
get
{
int indx = r * Columns + c;
if (indx < Lines.Length) return Lines[r * Columns + c];
_MyLog.WarnFormat("GridLinePattern: Lines Array Access out-of-bounds ({0}, {1}) within ({2}, {3})", r, c, Rows, Columns);
return GridLinePattern.Single;
}
set { Lines[r * Columns + c] = value; }
}
#endregion