Import settings

Screenshot: panel of file import settings

ImportSettingsPanel - a panel that configures the data import from a text file. It defines the separator, the date and time format, the encoding and, most importantly, the set and the order of the columns.

Main properties

Fields are moved between the two lists and up and down until their order matches the order of the columns in the file. The ImportSettingsPanel.HasErrors method validates the settings before the import starts.

Below are code snippets showing its usage:

<Window x:Class="Sample.ImportWindow"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:xaml="http://schemas.stocksharp.com/xaml"
	Height="600" Width="900">
	<xaml:ImportSettingsPanel x:Name="ImportPanel" />
</Window>
// Configure the tick data import
ImportPanel.Settings = new ImportSettings(DataType.Ticks, fields);

// Do not start the import with invalid settings
if (ImportPanel.HasErrors())
	return;

// Create the parser from the configured fields
var parser = new CsvParser(ImportPanel.Settings.DataType, ImportPanel.SelectedFields);

See also

Service panels