protected override void Initialize(bool initData) { base.Initialize(initData); if (initData) { _positions = new ObservableCollection <Boxed <int> >(Boxed <int> .ToBoxedItems(_doc.StartPositions)); } if (null != _view) { _view.StartPositions = _positions; } }
protected override void Initialize(bool initData) { base.Initialize(initData); if (initData) { _asciiDocumentAnalysisOptionsController = (IMVCANController)Current.Gui.GetController(new object[] { _analysisOptions }, typeof(IMVCANController), UseDocument.Directly); _separationStrategyInstances.Clear(); if (null != _doc.SeparationStrategy) { _separationStrategyInstances.Add(_doc.SeparationStrategy.GetType(), _doc.SeparationStrategy); } _separationStrategyList = new SelectableListNodeList(); var types = Altaxo.Main.Services.ReflectionService.GetNonAbstractSubclassesOf(typeof(Altaxo.Serialization.Ascii.IAsciiSeparationStrategy)); foreach (var t in types) { _separationStrategyList.Add(new SelectableListNode(Current.Gui.GetUserFriendlyClassName(t), t, _doc.SeparationStrategy == null ? false : t == _doc.SeparationStrategy.GetType())); } GetAvailableCultures(ref _numberFormatList, _doc.NumberFormatCulture); GetAvailableCultures(ref _dateTimeFormatList, _doc.DateTimeFormatCulture); _headerLinesDestination = new SelectableListNodeList(_doc.HeaderLinesDestination); if (_doc.RecognizedStructure != null) { _tableStructure = new System.Collections.ObjectModel.ObservableCollection <Boxed <AsciiColumnType> >(Boxed <AsciiColumnType> .ToBoxedItems(_doc.RecognizedStructure.ColumnTypes)); } else { _tableStructure = new System.Collections.ObjectModel.ObservableCollection <Boxed <AsciiColumnType> >(); } } if (null != _view) { _asciiDocumentAnalysisOptionsController.ViewObject = _view.AsciiDocumentAnalysisOptionsView; _view.NumberOfMainHeaderLines = _doc.NumberOfMainHeaderLines; _view.IndexOfCaptionLine = _doc.IndexOfCaptionLine; _view.RenameColumnsWithHeaderNames = _doc.RenameColumns; _view.RenameWorksheetWithFileName = _doc.RenameWorksheet; _view.GuiSeparationStrategyIsKnown = _doc.SeparationStrategy != null; _view.SetGuiSeparationStrategy(_separationStrategyList); EhSeparationStrategyChanged(); _view.NumberFormatCultureIsKnowm = _doc.NumberFormatCulture != null; _view.DateTimeFormatCultureIsKnown = _doc.DateTimeFormatCulture != null; _view.TableStructureIsKnown = _doc.RecognizedStructure != null; _view.SetNumberFormatCulture(_numberFormatList); _view.SetDateTimeFormatCulture(_dateTimeFormatList); _view.TableStructure = _tableStructure; _view.HeaderLinesDestination = _headerLinesDestination; _view.ImportMultipleAsciiVertically = _doc.ImportMultipleStreamsVertically; } }