public void ResetOrder() { var order = new BoardOrderDetails() { ProjectName = string.Empty, Zipcode = string.Empty, BoardsQuantity = 1, BoardThickness = 1.0, SelectedMaterial = this.preferenceOptions.Materials.FirstOrDefault(), SelectedSurfaceFinish = this.preferenceOptions.SurfaceFinishes.FirstOrDefault(), SelectedMaskColor = this.preferenceOptions.SolderMaskColors.FirstOrDefault(), SelectedSilkscreenColor = this.preferenceOptions.SilkscreenColors.FirstOrDefault(), SelectedInnerLayersCopperWeight = this.preferenceOptions.InnerLayersCopperWeights.FirstOrDefault(), SelectedOuterLayersCopperWeight = this.preferenceOptions.OuterLayersCopperWeights.FirstOrDefault(), SelectedLeadFreeOption = this.preferenceOptions.LeadFreeOptions.FirstOrDefault(), SelectedIPCClass = this.preferenceOptions.IpcClasses.FirstOrDefault(), SelectedITARComplianceOption = this.preferenceOptions.ItarComplianceOptions.FirstOrDefault(), SelectedFluxType = this.preferenceOptions.FluxTypes.FirstOrDefault(), SelectedControlledImpedanceOption = this.preferenceOptions.ControlledImpedanceOptions.FirstOrDefault(), SelectedTentingForViasOption = this.preferenceOptions.TentingForViasOptions.FirstOrDefault(), SelectedStackup = this.preferenceOptions.StackupOptions.FirstOrDefault(), }; this.SetCurrentOrder(order); this.CurrentOrder.Quote = null; this.OrderReset?.Invoke(); }
public async Task <IEnumerable <BoardOrderItem> > ExtractQuote(BoardOrderDetails orderDetails) { var values = orderDetails.GetType().GetProperties().Where(prop => typeof(BoardOrderItem).IsAssignableFrom(prop.PropertyType)); await Task.Delay(100).ConfigureAwait(false); var items = values.Select(p => p.GetValue(orderDetails)).Cast <BoardOrderItem>(); return(items); }
private void SetCurrentOrder(BoardOrderDetails orderDetails) { if (this.CurrentOrder != null) { this.CurrentOrder.PropertyChanged -= HandleCurrentOrderPropertyChanged; } this.CurrentOrder = orderDetails; this.CurrentOrder.PropertyChanged += HandleCurrentOrderPropertyChanged; this.OrderModified?.Invoke(this, new PropertyChangedEventArgs(nameof(BoardOrderDetails.Error))); }