<DataGrid x:Name="dataGrid"
ItemsSource="{Binding SelectionList}"
LoadingRow="LoadingRow">
<DataGrid.Columns>
<DataGridTextColumn Header="Номер выработки"
IsReadOnly="True"
Width="120"
Binding="{Binding NameBore}" />
<DataGridTextColumn Header="Х устья"
IsReadOnly="True"
Width="80"
Binding="{Binding XCoor}" />
<DataGridTextColumn Header="Y устья"
IsReadOnly="True"
Width="80"
Binding="{Binding YCoor}" />
<DataGridTextColumn Header="Отметка устья в м"
IsReadOnly="True"
Width="120"
Binding="{Binding ElevationMouth}" />
<DataGridTextColumn Header="Дата начала работ"
IsReadOnly="True"
Width="120"
Binding="{Binding DateBegin, StringFormat=\{0:dd.MM.yy\}}" />
<DataGridTextColumn Header="Дата окончания работ"
IsReadOnly="True"
Width="140"
Binding="{Binding DateEnd, StringFormat=\{0:dd.MM.yy\}}" />
<DataGridTextColumn Header="Полная глубина, м"
IsReadOnly="True"
Width="120"
Binding="{Binding Depth}" />
<DataGridTextColumn Header="Исполнитель"
IsReadOnly="True"
Width="120"
Binding="{Binding Autor}" />
<DataGridTextColumn Header="Номер при проходке"
IsReadOnly="True"
Width="120"
Binding="{Binding NumberProhod}" />
<DataGridTextColumn Header="Столб воды"
IsReadOnly="True"
Width="120"
Binding="{Binding WaterColumn}" />
</DataGrid.Columns>
</DataGrid>
private static void Test(int bufSize)
{
var intput = @"D:\Для тестов\1гб\SW_DVD5_Office_2010w_SP1_W32_Russian_CORE_MLF_X17-82148.ISO";
var output = @"D:\temp\1.gz";
var watch = new Stopwatch();
for (int i = 0; i < 100; i++)
{
watch.Start();
WorkWithFile(intput, output, bufSize);
watch.Stop();
measurements.Add(watch.Elapsed);
File.Delete(@"D:\temp\1.gz");
watch.Reset();
}
}
public static void WorkWithFile(string sourceFile, string outputFile, int bufferSize)
{
using (var readStream = new FileStream(sourceFile, FileMode.Open, FileAccess.ReadWrite))
{
using (var writeStream = new FileStream(outputFile, FileMode.OpenOrCreate, FileAccess.Write, FileShare.ReadWrite))
{
int bytesRead = -1;
byte[] bytes = new byte[bufferSize];
while ((bytesRead = readStream.Read(bytes, 0, bufferSize)) > 0)
{
writeStream.Write(bytes, 0, bytesRead);
}
}
}
}