private void Open_bt_Click(object sender, RoutedEventArgs e) { OpenFileDialog open_dlg = new OpenFileDialog(); open_dlg.Multiselect = true; List <UpdateFileData> newfiles = files.ToList(); if (open_dlg.ShowDialog() == true) { foreach (string file in open_dlg.FileNames) { UpdateFileData filedata = new UpdateFileData(); filedata.FullName = file; filedata.Url = urlserver_tb.Text + System.IO.Path.GetFileName(file); filedata.FileName = System.IO.Path.GetFileName(file); filedata.Md5 = Hasher.Hashfile(file, HashType.MD5); newfiles.Add(filedata); } newfiles = newfiles.Distinct().ToList(); files.Clear(); foreach (UpdateFileData newfile in newfiles) { files.Add(newfile); } } }
public MainWindow() { InitializeComponent(); files_lb.DataContext = files; Mainfile = new UpdateFileData(); AppData = new UpdateAppData(); mainfile_stack.DataContext = AppData; }