-
Notifications
You must be signed in to change notification settings - Fork 1
/
CellImageToolArray.cs
33 lines (31 loc) · 978 Bytes
/
CellImageToolArray.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (c) 2004-2008 Userwise Solutions LLC. All rights reserved.
using System;
namespace NetCams
{
/// <summary>
///
/// </summary>
public class CellImageToolArray : SourceGrid2.Cells.Virtual.CellVirtual
{
private ToolDefinition[,] m_Array;
public CellImageToolArray(ToolDefinition[,] p_Array):base(typeof(string))
{
m_Array = p_Array;
}
public override object GetValue(SourceGrid2.Position p_Position)
{
if( m_Array[p_Position.Row, p_Position.Column] == null ) return "x";
return m_Array[p_Position.Row, p_Position.Column].Name;
}
public override void SetValue(SourceGrid2.Position p_Position, object p_Value)
{
m_Array[p_Position.Row, p_Position.Column].Name = (string)p_Value;
OnValueChanged(new SourceGrid2.PositionEventArgs(p_Position, this));
}
public void SetObjectPosition(int row, int col, ToolDefinition tool)
{
// TODO: throw error or adjust position if value isn't null
m_Array[row, col] = tool;
}
}
}