private void PlaceElement(ITypeProvider provider, double x, double y) { BaseElementViewModel viewModel = BaseElementViewModel.GetViewModel(provider.ElementType, this); viewModel.Left = x - _trackerCenterX; viewModel.Top = y - _trackerCenterY; BaseElements.Add(viewModel); AddUndoAction(new GenericAddedAction <BaseElementViewModel>(this, viewModel)); }
/// <summary> /// Add tracker, selection and drawing connection view models /// </summary> private void AddDefaultElements() { Tracker = new TrackerViewModel(this); Selection = new SelectionViewModel(this); _drawingConnectionViewModel = new DrawingConnectionViewModel(this); BaseElements.Add(Tracker); BaseElements.Add(Selection); BaseElements.Add(_drawingConnectionViewModel); }
public static async Task <OperationResult <IEnumerable <Element> > > GetBaseElements() { BaseElements intermediateResult = null; try { var url = Constants.ApiUrl + "/api/Elements/base"; intermediateResult = await HttpClient.GetWithRetries <BaseElements>(url, 5); } catch { return(OperationResult <IEnumerable <Element> > .Failure()); } var elements = intermediateResult.elements.Select(r => new Element(new Guid(r.id), r.imageName, r.name, r.score, r.description)); return(OperationResult <IEnumerable <Element> > .Success(elements)); }
public TwoHolesMeasurementMethod() { BaseElements.Add(new Hole()); BaseElements.Add(new Hole()); }
public OneHoleMeasurementMethod() { BaseElements.Add(new Hole()); }
public void DeleteItem(BaseElementViewModel item) { BaseElements.Remove(item); AddUndoAction(new GenericDeletedAction <BaseElementViewModel>(this, item)); }
public SurfacePerpendicularityMeasurementMethod() { BaseElements.Add(new Surface()); BaseElements.Add(new Surface()); }
public SurfaceParalellismMeasurementMethod() { BaseElements.Add(new Surface()); BaseElements.Add(new Surface()); }