protected ColumnSettingsVM(SerializationInfo info, StreamingContext context) { layersTemplateSource = (ILayersTemplateSource)info.GetValue("LayersTemplateSource", typeof(ILayersTemplateSource)); layerRankNameSource = (ILayerRankNamesSource)info.GetValue("LayerRankNameSource", typeof(ILayerRankNamesSource)); colSettingPersistence = (IColumnSettingsPersistence)info.GetValue("SettingsPersister", typeof(IColumnSettingsPersistence)); columnDefinitions = (ColumnDefinitionVM[])info.GetValue("Columns", typeof(ColumnDefinitionVM[])); Initialize(); foreach (var col in columnDefinitions) { InitializeColumn(col); } }
public ProjectVM( IImageStorage imageStorage, ILayersTemplateSource layersTemplateSource, ILayerRankNamesSource layerRankSource, IColumnSettingsPersistence columnSettingsPersister) { boreIntervalsVM = new BoreIntervalsVM(imageStorage); this.layerRankNameSource = layerRankSource; this.layersTemplateSource = layersTemplateSource; columnSettingsPersistence = columnSettingsPersister; Initialize(); }
protected ProjectVM(SerializationInfo info, StreamingContext context) { boreName = info.GetString("BoreName"); boreIntervalsVM = (BoreIntervalsVM)info.GetValue("Intervals", typeof(BoreIntervalsVM)); PlaneVM = (AnnotationPlane.PlaneVM)info.GetValue("Annotation", typeof(AnnotationPlane.PlaneVM)); layersTemplateSource = (ILayersTemplateSource)info.GetValue("LayersTemplateSource", typeof(ILayersTemplateSource)); layerRankNameSource = (ILayerRankNamesSource)info.GetValue("LayersRankSource", typeof(ILayerRankNamesSource)); columnSettingsPersistence = (IColumnSettingsPersistence)info.GetValue("ColumnValuePersistence", typeof(IColumnSettingsPersistence)); planeColumnSettingsVM = (ColumnSettingsVM)info.GetValue("ColumnsSettings", typeof(ColumnSettingsVM)); if (PlaneVM != null) { AnnotationDirection = PlaneVM.AnnotationDirection; } Initialize(); }
public ColumnSettingsVM( ILayersTemplateSource layersTemplateSource, ILayerRankNamesSource layerRankNameSource, IColumnSettingsPersistence settingsPersister) { this.layersTemplateSource = layersTemplateSource; this.layerRankNameSource = layerRankNameSource; this.colSettingPersistence = settingsPersister; ColumnDefinitions = new ColumnDefinitionVM[0]; ColumnDefinitionVM[] settings = null; if (settingsPersister.LoadDefaults(out settings)) { ColumnDefinitions = settings; Initialize(); foreach (var col in columnDefinitions) { InitializeColumn(col); } } else { //default column set Initialize(); List <ColumnDefinitionVM> result = new List <ColumnDefinitionVM>(); var ranks = layerRankNameSource.InstrumentalMultipleNames.Reverse().ToArray(); foreach (string rank in ranks) { LayerEditColumnDefinitionVM column = new LayerEditColumnDefinitionVM(layerRankNameSource); column.Selected = rank; result.Add(column); ColumnDefinitions = result.ToArray(); // As InitializeColumn uses ColumnDefinitions InitializeColumn(column); } AddDepthCommand.Execute(null); AddPhotoCommand.Execute(null); } }