protected VisualColumnDefinitionVM(SerializationInfo info, StreamingContext context) : base(info, context) { layersTemplateSource = (ILayersTemplateSource)info.GetValue("LayersTemplateSource", typeof(ILayersTemplateSource)); Initialize(); string backgroundSelectedPropID = info.GetString("BackgroundSelectedPropID"); string widthSelectedPropID = info.GetString("WidthSelectedPropID"); string rightSideSelectedPropID = info.GetString("RightSideSelectedPropID"); string bottomSideSelectedPropID = info.GetString("BottomSideSelectedPropID"); //setting the user choice but only if it is avaialabe in loaded template if (backgroundSelectedPropID != null) { selectedBackgroundImageProp = AvailableBackgroundImageProps.FirstOrDefault(v => (v.PropID == backgroundSelectedPropID) && (v.Presentation == Presentation.BackgroundImage)); } if (widthSelectedPropID != null) { selectedWidthProp = AvailableWidthProps.FirstOrDefault(v => (v.PropID == widthSelectedPropID) && (v.Presentation == Presentation.Width)); } if (rightSideSelectedPropID != null) { selectedRightSideProp = AvailableRightSideProps.FirstOrDefault(v => (v.PropID == rightSideSelectedPropID) && (v.Presentation == Presentation.RightSide)); } if (bottomSideSelectedPropID != null) { selectedBottomSideProp = AvailableBottomSideProps.FirstOrDefault(v => (v.PropID == bottomSideSelectedPropID) && (v.Presentation == Presentation.BottomSide)); } }
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 IconsColumnDefinitionVM(SerializationInfo info, StreamingContext context) : base(info, context) { layersTemplateSource = (ILayersTemplateSource)info.GetValue("LayersTemplateSource", typeof(ILayersTemplateSource)); Initialize(); string selectePropID = info.GetString("SelectedPropID"); if (selectePropID != null) { //setting the user choice but only if it is avaialabe in loaded template Presentation presentationToSet = (Presentation)info.GetValue("SelectedPresentation", typeof(Presentation)); selectedIconProp = AvailableIconProps.FirstOrDefault(v => (v.PropID == selectePropID) && (v.Presentation == presentationToSet)); } }
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); } }
public IconsColumnDefinitionVM(ILayersTemplateSource layersTemplateSource) { this.layersTemplateSource = layersTemplateSource; Initialize(); }