Beispiel #1
0
 public ElementModel(string description, int height, int width, int depth, int x, int y, int z, EnumCabinetElement enumCabinet, bool horizontal)
 {
     _guid        = Guid.NewGuid();
     Description  = description;
     Height       = height;
     Width        = width;
     Depth        = depth;
     X            = x;
     Y            = y;
     Z            = z;
     _enumCabinet = enumCabinet;
     Horizontal   = horizontal;
 }
 public ElementModelDTO(string description, int height, int width, int depth, int x, int y, int z, EnumCabinetElement enumCabinet, bool horizontal)
 {
     _guid        = Guid.NewGuid();
     _description = description;
     _height      = height;
     _width       = width;
     _depth       = depth;
     _x           = x;
     _y           = y;
     _z           = z;
     _enumCabinet = enumCabinet;
     _horizontal  = horizontal;
 }
Beispiel #3
0
        public void Zmaian_parametrow_elementu_szafki(EnumCabinetElement enumCabinetElement, EnumElementParameter enumElementParameter, int value, int newValue)
        {
            var cabinet = new Cabinet();

            cabinet.Should().NotBeNull();

            var elem         = cabinet.GetElements(enumCabinetElement);
            var elementWidth = elem.GetElementParameter(enumElementParameter);

            elementWidth.Should().Be(value);

            elem.SetWidth(newValue);

            elementWidth = elem.GetElementParameter(enumElementParameter);
            elementWidth.Should().Be(newValue);
        }
Beispiel #4
0
        // TODO: Logger
        private void ChangeCabinetElement(EnumCabinetElement enumCabinetElement, ElementModel element)
        {
            Logger.Trace("Start ChangeCabinetElement");

            if (CabinetElements.Exists(c => c.GetEnumName() == enumCabinetElement))
            {
                Logger.Trace("Change an existing item");
                CabinetElements[CabinetElements.FindIndex(c => c.GetEnumName() == enumCabinetElement)] = element;
            }
            else
            {
                Logger.Trace("Adding a new item: {0}", element.ToString());
                CabinetElements.Add(element);
            }
            Logger.Trace("Stop ChangeCabinetElement");
        }
Beispiel #5
0
 public void SetEnumName(EnumCabinetElement enumCabinet)
 {
     _enumCabinet = enumCabinet;
 }
Beispiel #6
0
 public ElementModel GetElements(EnumCabinetElement enumCabinetElement)
 {
     return(CabinetElements.Find(x => x.GetEnumName() == enumCabinetElement));
 }