public static BoundaryBaseViewModel GetBoundaryFromModel(IBoundaryBase model) { IArtefactsBoundary artefactModel = model as IArtefactsBoundary; if (artefactModel != null) { return(new ArtefactsBoundaryViewModel(artefactModel, model.Points)); } IBoxBoundary boxModel = model as IBoxBoundary; if (model is IBoxBoundary) { return(new BoxesBoundary(boxModel, model.Points)); } ICircleBoundary circleModel = model as ICircleBoundary; if (model is ICircleBoundary) { return(new CircularBoundary(circleModel, model.Points)); } IOuterBoundary outerModel = model as IOuterBoundary; if (model is IOuterBoundary) { return(new OuterBoundaryViewModel(outerModel, model.Points)); } return(null); }
protected BoundaryBaseViewModel(IBoundaryBase model) { Model = model; Id = Model.Id; }