public ReferenceByIntProperty(ReferencableMasterInfo source, string idPropertyName)
 {
     Source = source;
     PropertyToReference = Source.Type.GetProperty(idPropertyName);
     IntValue            = SelectedObject.Where(x => x != null)
                           .Select(x => (int)(PropertyToReference?.GetValue(x) ?? -1))
                           .ToReactiveProperty(-1);
     Value = IntValue.Select(x => (object)x).ToReactiveProperty();
 }
Ejemplo n.º 2
0
 public IntProperty()
 {
     Value = IntValue.Select(x => (object)x).ToReactiveProperty();
 }
    private void AddAverageTableEntry(IntValue[] values, string tableName) {
      if (!ResultCollection.ContainsKey(tableName)) {
        var newTable = new DataTable(tableName, "");
        newTable.VisualProperties.YAxisTitle = "Average";
        newTable.VisualProperties.YAxisMaximumAuto = false;

        DataRow row = new DataRow("Average");
        row.VisualProperties.StartIndexZero = true;
        newTable.Rows.Add(row);

        ResultCollection.Add(new Result(tableName, newTable));
      }
      var table = ((DataTable)ResultCollection[tableName].Value);
      table.Rows["Average"].Values.Add(values.Select(x => x.Value).Average());
    }