private void RedrawCabinetElements() { Logger.Info("RedrawCabinetElements in Cabinet"); _leftSide.SetDescription(_leftSide.ChangeDescription ? _leftSide.Description : "Bok Lewy", false); _leftSide.SetHeight(_leftSide.ChangeHeight ? _leftSide.Height : _height, false); _leftSide.SetWidth(_leftSide.ChangeWidth ? _leftSide.Width : _sizeElement, false); _leftSide.SetDepth(_leftSide.ChangeDepth ? _leftSide.Depth : _depth, false); _leftSide.SetX(_leftSide.ChangeX ? _leftSide.X : 0, false); _leftSide.SetY(_leftSide.ChangeY ? _leftSide.Y : 0, false); _leftSide.SetZ(_leftSide.ChangeZ ? _leftSide.Z : SwitchBack.ValueAxisZbyBackTypeAndSize(this), false); _leftSide.SetEnumName(EnumCabinetElement.Leftside); _leftSide.SetHorizontal(false); _rightSide.SetDescription(_rightSide.ChangeDescription ? _rightSide.Description : "Bok Prawy", false); _rightSide.SetHeight(_rightSide.ChangeHeight ? _rightSide.Height : _height, false); _rightSide.SetWidth(_rightSide.ChangeWidth ? _rightSide.Width : _sizeElement, false); _rightSide.SetDepth(_rightSide.ChangeDepth ? _rightSide.Depth : _depth, false); _rightSide.SetX(_rightSide.ChangeX ? _rightSide.X : _width - _rightSide.Width, false); _rightSide.SetY(_rightSide.ChangeY ? _rightSide.Y : 0, false); _rightSide.SetZ(_rightSide.ChangeZ ? _rightSide.Z : SwitchBack.ValueAxisZbyBackTypeAndSize(this), false); _rightSide.SetEnumName(EnumCabinetElement.Rightside); _rightSide.SetHorizontal(false); _bottom.SetDescription(_bottom.ChangeDescription ? _bottom.Description : "Spód", false); _bottom.SetHeight(_bottom.ChangeHeight ? _bottom.Height : _width - _leftSide.Width - _rightSide.Width, false); _bottom.SetWidth(_bottom.ChangeWidth ? _bottom.Width : _sizeElement, false); _bottom.SetDepth(_bottom.ChangeDepth ? _bottom.Depth : _depth, false); _bottom.SetX(_bottom.ChangeX ? _bottom.X : _leftSide.Width, false); _bottom.SetY(_bottom.ChangeY ? _bottom.Y : 0, false); _bottom.SetZ(_bottom.ChangeZ ? _bottom.Z : SwitchBack.ValueAxisZbyBackTypeAndSize(this), false); _bottom.SetEnumName(EnumCabinetElement.Bottom); _bottom.SetHorizontal(true); _top.SetDescription(_top.ChangeDescription ? _top.Description : "Góra", false); _top.SetHeight(_top.ChangeHeight ? _top.Height : _width - _leftSide.Width - _rightSide.Width, false); _top.SetWidth(_top.ChangeWidth ? _top.Width : _sizeElement, false); _top.SetDepth(_top.ChangeDepth ? _top.Depth : _depth, false); _top.SetX(_top.ChangeX ? _top.X : _leftSide.Width, false); _top.SetY(_top.ChangeY ? _top.Y : _height - _top.Width, false); _top.SetZ(_top.ChangeZ ? _top.Z : SwitchBack.ValueAxisZbyBackTypeAndSize(this), false); _top.SetEnumName(EnumCabinetElement.Top); _top.SetHorizontal(true); }
// TODO: Przeniesc elementy zmian do odpowiednich fabryk // TODO: Update - zmienia tylko elementy glowne szafki private static void SwitchChange(EnumElementParameter parameter, string text, int result, ElementModel item) { Logger.Info("SwitchChange(EnumElementParameter parameter, string text, int result, ElementModel item) in Cabinet"); switch (parameter) { case EnumElementParameter.Width: item.SetWidth(result); break; case EnumElementParameter.Height: item.SetHeight(result); break; case EnumElementParameter.Depth: item.SetDepth(result); break; case EnumElementParameter.Description: item.SetDescription(text); break; case EnumElementParameter.X: item.SetX(result); break; case EnumElementParameter.Y: item.SetY(result); break; case EnumElementParameter.Z: item.SetZ(result); break; default: break; } }