private void ReloadMyCabinet() { _myCabinet.Height = _cabinet.Height().ToString(); _myCabinet.Width = _cabinet.Width().ToString(); _myCabinet.Depth = _cabinet.Depth().ToString(); _myCabinet.Name = _cabinet.Name().ToString(); _myCabinet.SizeElement = _cabinet.SizeElement().ToString(); RaisePropertyChanged(MyCabinetPropertyName); }
public void Utworzenie_domyslej_szafki_i_zmiana_jej_wymiarow(int height, int width, int depth) { var cabinet = new Cabinet(); cabinet.Should().NotBeNull(); cabinet.Height().Should().Be(720); cabinet.Width().Should().Be(600); cabinet.Depth().Should().Be(510); cabinet.SizeElement().Should().Be(18); cabinet.Name().Should().Be("Default"); cabinet.Height(height); cabinet.Width(width); cabinet.Depth(depth); cabinet.Height().Should().Be(height); cabinet.Width().Should().Be(width); cabinet.Depth().Should().Be(depth); }
public void Utworzenie_szafki_o_zadanych_wymiarach(int height, int width, int depth, string name) { var cabinet = new Cabinet(height, width, depth, name); cabinet.Should().NotBeNull(); cabinet.Height().Should().Be(height); cabinet.Width().Should().Be(width); cabinet.Depth().Should().Be(depth); cabinet.SizeElement().Should().Be(18); cabinet.Name().Should().Be(name); }
public void Utworzenie_szafki_z_domyslnymi_wartosciami() { var cabinet = new Cabinet(); cabinet.Should().NotBeNull(); cabinet.Height().Should().Be(720); cabinet.Width().Should().Be(600); cabinet.Depth().Should().Be(510); cabinet.SizeElement().Should().Be(18); cabinet.Name().Should().Be("Default"); }
// TDOD to modification Result<List<ElementModelDTO>> // TODO new Result<List<ElementModelDTO>> { Value = _frontList, IsValid = false, Errors = new List<Error> { new Error { ErrorMessage = "Obiekt nie znaleziomy" } } }; //public List<ElementModelDTO> Update(ElementModelDTO front) //{ // Logger.Info("Update(ElementModelDTO front) in FrontFactory"); // if (!_frontList.Exists(x => x.GetGuid() == front.GetGuid())) return _frontList; // { // var T = _frontList.FirstOrDefault(x => x.GetGuid() == front.GetGuid()); // T.SetWidth(front.GetWidth()); // T.SetHeight(front.GetHeight()); // T.SetDepth(front.GetDepth()); // T.SetX(front.GetX()); // T.SetY(front.GetY()); // T.SetZ(front.GetZ()); // T.SetDescription(front.GetDescription()); // } // //var result = new Result<List<ElementModelDTO>> // //{ // // Value = _frontList, // // IsValid = true // //}; // return _frontList; //} private List <ElementModelDTO> Recalculate() { Logger.Info("Recalculate() in FrontFactory"); if (number == 0) { return(_frontList); } _frontList = new List <ElementModelDTO>(); var width = _enumFront.HasFlag(EnumFront.Pionowo) ? (_cabinet.Width() - slots.Left - slots.Right - slots.BetweenVertically * (number - 1)) / number : _cabinet.Width() - slots.Left - slots.Right; var height = _enumFront.HasFlag(EnumFront.Poziomo) ? (_cabinet.Height() - slots.Top - slots.Bottom - slots.BetweenHorizontally * (number - 1)) / number : _cabinet.Height() - slots.Top - slots.Bottom; for (var i = 0; i < number; i++) { var front = new ElementModelDTO( description: "Front", height: height, width: width, depth: _cabinet.SizeElement(), x: _enumFront.HasFlag(EnumFront.Pionowo) ? slots.Left + (width + slots.BetweenVertically) * i : slots.Left, y: _enumFront.HasFlag(EnumFront.Poziomo) ? slots.Bottom + (height + slots.BetweenHorizontally) * i : slots.Right, z: _cabinet.Depth() + slots.BetweenCabinet, enumCabinet: EnumCabinetElement.Front, horizontal: false); _frontList.Add(front); } return(_frontList); }