string GetPartsSet(IConfiguration configuration)
        {
            IEngine     engine     = configuration.GetEngine();
            IWheels     wheels     = configuration.GetWheels();
            ISuspension suspension = configuration.GetSuspension();

            return($"engine capacity={engine.Capacity}, wheels diameter={wheels.Diameter}, suspension type={suspension.Type}");
        }
Пример #2
0
        public void DestroySuspension(GridDirection direction)
        {
            switch (direction)
            {
                case GridDirection.LEFT:
                    left = null;
                    break;

                case GridDirection.RIGHT:
                    right = null;
                    break;

                case GridDirection.DOWN:
                    down = null;
                    break;
            }
        }
Пример #3
0
        public void Add(GridDirection direction, Building building)
        {
            switch (direction)
            {
                case GridDirection.LEFT:
                    left = left == null ? building : left;
                    break;

                case GridDirection.RIGHT:
                    right = right == null ? building : right;
                    break;

                case GridDirection.DOWN:
                    down = down == null ? building : down;
                    break;
            }
        }
Пример #4
0
        /// <summary>
        /// Creates the edit suspension view.
        /// </summary>
        /// <param name="suspensionInfo">The suspension information.</param>
        /// <param name="companyInfo">The company information.</param>
        /// <param name="employeeCollection">The employee collection.</param>
        /// <param name="queryCollection">The query collection.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException">
        /// suspensionInfo
        /// or
        /// employeeCollection
        /// or
        /// queryCollection
        /// </exception>
        public ISuspensionView CreateEditSuspensionView(ISuspension suspensionInfo, int companyId, IList <IEmployee> employeeCollection, IList <IQuery> queryCollection)
        {
            if (suspensionInfo == null)
            {
                throw new ArgumentNullException(nameof(suspensionInfo));
            }

            if (employeeCollection == null)
            {
                throw new ArgumentNullException(nameof(employeeCollection));
            }

            if (queryCollection == null)
            {
                throw new ArgumentNullException(nameof(queryCollection));
            }

            var employeeDDL = GetDropDownList.EmployeeListitems(employeeCollection, -1);
            var queryDDL    = GetDropDownList.QueryListItems(queryCollection, -1);

            var returnSuspension = new SuspensionView
            {
                SuspensionId     = suspensionInfo.SuspensionId,
                EmployeeId       = suspensionInfo.EmployeeId,
                QueryId          = suspensionInfo.QueryId,
                StartDate        = suspensionInfo.StartDate,
                EndDate          = suspensionInfo.EndDate,
                Percentage       = suspensionInfo.EmployeeId,
                IsActive         = suspensionInfo.IsActive,
                DateCreated      = suspensionInfo.DateCreated,
                CompanyId        = companyId,
                EmployeeDropDown = employeeDDL,
                QueryDropDown    = queryDDL,
                QueryName        = suspensionInfo.QueryName
            };

            return(returnSuspension);
        }
Пример #5
0
 public void SetSuspension(ISuspension suspension)
 {
     _suspension = suspension;
 }
Пример #6
0
 public Car(ICarFactory factory)
 {
     _engine     = factory.CreateEngine();
     _suspension = factory.CreateSuspension();
     _wheel      = factory.CreateWheel();
 }