public override Variable Duplicate()
        {
            VariableScalar v = new VariableScalar();

            v.Value       = Value;
            v.LastChanger = LastChanger;
            v.LastChanged = LastChanged;
            return(v);
        }
 public override int CompareTo(object o)
 {
     if ((o is Variable) == false)
     {
         throw new InvalidOperationException();
     }
     if (o is VariableScalar)
     {
         VariableScalar v = (VariableScalar)o;
         return(Value.CompareTo(v.Value));
     }
     return(-1);
 }
 public void InsertColumn(int index)
 {
     Resize(Width + 1, Height > 0 ? Height : 1);
     for (int y = 0; y < Height; y++)
     {
         for (int x = Width - 1; x > index; x--)
         {
             Values[y][x] = Values[y][x - 1];
         }
         if (index >= Width)
         {
             index = Width - 1;
         }
         Values[y][index] = new VariableScalar();
     }
 }
 public void InsertRow(int index)
 {
     Resize(Width > 0 ? Width : 1, Height + 1);
     for (int y = Height - 1; y > index; y--)
     {
         Rows[y] = Rows[y - 1];
     }
     if (index >= Height)
     {
         index = Height - 1;
     }
     VariableScalar[] vs = new VariableScalar[Width];
     Rows[index]        = new VariableTableRow();
     Rows[index].Values = new List <Variable>();
     Rows[index].Values.AddRange(vs);
 }