Esempio n. 1
0
 public override object GetValue(SourceGrid2.Position pos)
 {
     if (pos.Row == 1)
     {
         return("=");
     }
     else if (pos.Row == Grid.RowsCount - 1)
     {
         return("*");
     }
     else
     {
         return(pos.Row - 2);
     }
 }
Esempio n. 2
0
 public override void SetValue(SourceGrid2.Position pos, object x)
 {
     if (pos.Column == 4)
     {
         if (pos.Row == Grid.RowsCount - 1)
         {
             data.Length     = Grid.RowsCount - M;
             Grid.RowsCount += 1;
         }
         data.dy[pos.Row - M] = (double)x;
     }
     else
     {
         throw new IndexOutOfRangeException("invalid column index: " + pos.Column);
     }
     OnValueChanged(new SourceGrid2.PositionEventArgs(pos, this));
 }
Esempio n. 3
0
 public override object GetValue(SourceGrid2.Position pos)
 {
     if (pos.Column == 4)
     {
         if (pos.Row == Grid.RowsCount - 1)
         {
             return(null);
         }
         else
         {
             return(data.dy[pos.Row - M]);
         }
     }
     else
     {
         throw new IndexOutOfRangeException("invalid column index: " + pos.Column);
     }
 }
Esempio n. 4
0
            public override object GetValue(SourceGrid2.Position pos)
            {
                switch (pos.Column)
                {
                case 1:
                    return("x[n]");

                case 2:
                    return("y[n]");

                case 3:
                    return("dx[n]");

                case 4:
                    return("dy[n]");

                default:
                    throw new IndexOutOfRangeException("invalid column index: " + pos.Column);
                }
            }
Esempio n. 5
0
            public override void SetValue(SourceGrid2.Position pos, object x)
            {
                string s = (string)x;

                if (EmptyString(s))
                {
                    s = null;
                }
                switch (pos.Column)
                {
                case 1:
                    data.x.source = s;
                    Compile();
                    break;

                case 2:
                    data.y.source = s;
                    Compile();
                    break;

                case 3:
                    data.dx.source = s;
                    Compile();
                    break;

                case 4:
                    data.dy.source = s;
                    Compile();
                    break;

                default:
                    throw new IndexOutOfRangeException("invalid column index: " + pos.Column);
                }
                ((DataGrid)Grid).RefreshCellStyle();
                OnValueChanged(new SourceGrid2.PositionEventArgs(pos, this));
            }
Esempio n. 6
0
 public override void SetValue(SourceGrid2.Position p_Position, object p_Value)
 {
     throw new ApplicationException("Cannot change this kind of cell");
 }
Esempio n. 7
0
 public override object GetValue(SourceGrid2.Position p_Position)
 {
     return("n");
 }
Esempio n. 8
0
 public override void SetSortMode(SourceGrid2.Position p_Position, SourceGrid2.GridSortMode p_Mode)
 {
 }
Esempio n. 9
0
 public override SourceGrid2.SortStatus GetSortStatus(SourceGrid2.Position p_Position)
 {
     return(new SourceGrid2.SortStatus(SourceGrid2.GridSortMode.None, false));
 }