Keine Beschreibung

aleukhin b982972b9f 1st com vor 6 Monaten
.vs b982972b9f 1st com vor 6 Monaten
WpfApp1 b982972b9f 1st com vor 6 Monaten
img b982972b9f 1st com vor 6 Monaten
WpfApp1.sln 90ca23d239 1st com vor 6 Monaten
readme.md b982972b9f 1st com vor 6 Monaten

readme.md

data_csv

все что добавилось с прошлой работы:

изменения в Xaml.Cs

public class JSONDataProvider : LocalDataProvider, IDataProvider
{
    private List<Worker> _WorkerList;

    public JSONDataProvider()
    {
        var serializer = new DataContractJsonSerializer(typeof(Worker[]));
        using (var sr = new StreamReader("./data.json"))
        {
            _WorkerList = ((Worker[])serializer.ReadObject(sr.BaseStream)).ToList();

        }
    }
    public IEnumerable<Worker> getWorker()
    {
        return _WorkerList;
    }
}
private bool sortAsc = true;

private bool sortAsc = true;

private void RadioButton_Checked(object sender, RoutedEventArgs e) {

 sortAsc = (sender as RadioButton).Tag.ToString() == "1";
 Invalidate();

}

изменился еще class 4

using System; using System.Collections.Generic; using System.Formats.Asn1; using System.Globalization; using System.IO; using System.Linq; using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; using CsvHelper; using WpfApp1;

namespace WpfApp1.model {

[DataContract]
public class Worker
{
    [DataMember]
    public string name { get; set; }
    [DataMember]
    public string Pos { get; set; }
    [DataMember]
    public int Age { get; set; }
    [DataMember]
    public string Sex { get; set; }

    [DataMember]
    public bool available { get; set; }

    [DataMember(Name = "date")]
    private string? stringdate { get; set; }

    [IgnoreDataMember]
    public DateTime? date
    {
        get
        {
            return stringdate == null ? null : DateTime.Parse(stringdate);
        }
        set
        {
            stringdate = value.ToString();
        }
    }
}

}

```