Esempio n. 1
0
		public void Start(FileInfo[] files, Template template, bool storeObjects)
		{
			this.files = files;
			this.template = template;
			this.storeObjects = storeObjects;
			this.state = EngineState.Running;
		}
Esempio n. 2
0
		public void Add(Template template)
		{
			TemplateXmlNode templateXmlNode = (TemplateXmlNode)this.AppendChildNode<TemplateXmlNode>();
			templateXmlNode.TemplateName = template.Name;
			templateXmlNode.CSV.Separator = template.CSVOptions.Separator.DisplayName;
			templateXmlNode.CSV.HeaderLineCount = template.CSVOptions.HeaderLineCount;
			templateXmlNode.CSV.Culture = template.CSVOptions.CultureInfo.Name;
			templateXmlNode.Data.DataType = template.DataOptions.DataType;
			templateXmlNode.Data.BarSize = template.DataOptions.BarSize;
			templateXmlNode.Data.BarDateTime = template.DataOptions.BarDateTime;
			templateXmlNode.Date.DateType = template.DateOptions.DateType;
			templateXmlNode.Date.Date = template.DateOptions.Date;
			templateXmlNode.Symbol.SymbolOption = template.SymbolOptions.Option;
			templateXmlNode.Symbol.Name_ = template.SymbolOptions.Name;
			templateXmlNode.Other.CreateInstrument = template.OtherOptions.CreateInstrument;
			templateXmlNode.Other.InstrumentType = template.OtherOptions.InstrumentType;
			templateXmlNode.Other.ClearSeries = template.OtherOptions.ClearSeries;
			templateXmlNode.Other.SkipDataInsideExistingRange = template.OtherOptions.SkipDataInsideExistingRange;
			foreach (Column column in (List<Column>) template.Columns)
				templateXmlNode.Columns.Add(column);
		}
Esempio n. 3
0
 private TemplateCollection ReadTemplates()
 {
   string str = string.Format("{0}\\{1}", (object) this.templateDirectory.FullName, (object) "import.templates.xml");
   if (!File.Exists(str))
     return new TemplateCollection();
   try
   {
     TemplateCollection templateCollection = new TemplateCollection();
     TemplateXmlDocument templateXmlDocument = new TemplateXmlDocument();
     ((XmlDocument) templateXmlDocument).Load(str);
     foreach (TemplateXmlNode templateXmlNode in templateXmlDocument.Templates)
     {
       Template template = new Template();
       template.Name = templateXmlNode.TemplateName;
       template.CSVOptions.Separator = Separator.GetSeparator(templateXmlNode.CSV.Separator);
       template.CSVOptions.HeaderLineCount = templateXmlNode.CSV.HeaderLineCount;
       template.CSVOptions.CultureInfo = CultureInfo.CreateSpecificCulture(templateXmlNode.CSV.Culture);
       template.DataOptions.DataType = templateXmlNode.Data.DataType;
       template.DataOptions.BarSize = templateXmlNode.Data.BarSize;
       template.DataOptions.BarDateTime = templateXmlNode.Data.BarDateTime;
       template.DateOptions.DateType = templateXmlNode.Date.DateType;
       template.DateOptions.Date = templateXmlNode.Date.Date;
       template.SymbolOptions.Option = templateXmlNode.Symbol.SymbolOption;
       template.SymbolOptions.Name = templateXmlNode.Symbol.Name_;
       template.OtherOptions.CreateInstrument = templateXmlNode.Other.CreateInstrument;
       template.OtherOptions.InstrumentType = templateXmlNode.Other.InstrumentType;
       template.OtherOptions.ClearSeries = templateXmlNode.Other.ClearSeries;
       template.OtherOptions.SkipDataInsideExistingRange = templateXmlNode.Other.SkipDataInsideExistingRange;
       foreach (ColumnXmlNode columnXmlNode in templateXmlNode.Columns)
         template.Columns.Add(new Column()
         {
           ColumnType = columnXmlNode.ColumnType,
           ColumnFormat = columnXmlNode.Format
         });
       templateCollection.Add(template);
     }
     return templateCollection;
   }
   catch (Exception ex)
   {
     int num = (int) MessageBox.Show((IWin32Window) this, ((object) ex).ToString(), "Error reading templates!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     return new TemplateCollection();
   }
 }
Esempio n. 4
0
 public void SetError(Template template, ErrorEventArgs args)
 {
   this.lblFile.Text = args.File.FullName;
   this.lblMessage.Text = args.Message;
   this.ltvFragment.Columns.Add("Line #", 60, HorizontalAlignment.Left);
   foreach (Column column in (List<Column>) template.Columns)
   {
     string text = Column.ToString(column.ColumnType);
     if (column.ColumnFormat != "")
       text = text + " (" + column.ColumnFormat + ")";
     this.ltvFragment.Columns.Add(text, 100, HorizontalAlignment.Center);
   }
   ListViewItem listViewItem = new ListViewItem(args.Row.ToString());
   listViewItem.UseItemStyleForSubItems = false;
   string[] strArray = args.Line.Split((char[]) template.CSVOptions.Separator);
   for (int index = 0; index < strArray.Length; ++index)
     listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem()
     {
       Text = strArray[index],
       BackColor = index == args.Column ? Color.Red : listViewItem.BackColor
     });
   this.ltvFragment.Items.Add(listViewItem);
 }
Esempio n. 5
0
		public void Add(Template template)
		{
			this.collection.Add(template.Name, template);
		}
Esempio n. 6
0
 public void Add(Template template)
 {
     this.collection.Add(template.Name, template);
 }
Esempio n. 7
0
		public ImportSettings()
		{
			this.Files = new FileInfo[0];
			this.Template = new Template();
		}