コード例 #1
0
        /// <summary>
        /// Converts this instance of <see cref="AlarmConfiguration"/> to an instance of <see cref="AlarmConfigurationDto"/>.
        /// </summary>
        /// <param name="entity"><see cref="AlarmConfiguration"/> to convert.</param>
        public static AlarmConfigurationDto ToDTO(this AlarmConfiguration entity)
        {
            if (entity == null)
            {
                return(null);
            }

            var dto = new AlarmConfigurationDto();

            dto.VariableId       = entity.VariableId;
            dto.HIHI_Enabled     = entity.HIHI.Enabled;
            dto.HIHI_Name        = entity.HIHI.Name;
            dto.HIHI_LevelChange = entity.HIHI.LevelChange;
            dto.HIHI_Delay       = entity.HIHI.Delay;
            dto.HI_Enabled       = entity.HI.Enabled;
            dto.HI_Name          = entity.HI.Name;
            dto.HI_LevelChange   = entity.HI.LevelChange;
            dto.HI_Delay         = entity.HI.Delay;
            dto.LO_Enabled       = entity.LO.Enabled;
            dto.LO_Name          = entity.LO.Name;
            dto.LO_LevelChange   = entity.LO.LevelChange;
            dto.LO_Delay         = entity.LO.Delay;
            dto.LOLO_Enabled     = entity.LOLO.Enabled;
            dto.LOLO_Name        = entity.LOLO.Name;
            dto.LOLO_LevelChange = entity.LOLO.LevelChange;
            dto.LOLO_Delay       = entity.LOLO.Delay;
            dto.Enabled          = entity.Enabled;
            dto.Location         = entity.Location;

            entity.OnDTO(dto);

            return(dto);
        }
コード例 #2
0
        /// <summary>
        /// Converts this instance of <see cref="AlarmConfigurationDto"/> to an instance of <see cref="AlarmConfiguration"/>.
        /// </summary>
        /// <param name="dto"><see cref="AlarmConfigurationDto"/> to convert.</param>
        public static AlarmConfiguration ToEntity(this AlarmConfigurationDto dto)
        {
            if (dto == null)
            {
                return(null);
            }

            var entity = new AlarmConfiguration();

            entity.VariableId       = dto.VariableId;
            entity.HIHI             = new AlarmLevelConfiguration();
            entity.HIHI.Enabled     = dto.HIHI_Enabled;
            entity.HIHI.Name        = dto.HIHI_Name;
            entity.HIHI.LevelChange = dto.HIHI_LevelChange;
            entity.HIHI.Delay       = dto.HIHI_Delay;
            entity.HI               = new AlarmLevelConfiguration();
            entity.HI.Enabled       = dto.HI_Enabled;
            entity.HI.Name          = dto.HI_Name;
            entity.HI.LevelChange   = dto.HI_LevelChange;
            entity.HI.Delay         = dto.HI_Delay;
            entity.LO               = new AlarmLevelConfiguration();
            entity.LO.Enabled       = dto.LO_Enabled;
            entity.LO.Name          = dto.LO_Name;
            entity.LO.LevelChange   = dto.LO_LevelChange;
            entity.LO.Delay         = dto.LO_Delay;
            entity.LOLO             = new AlarmLevelConfiguration();
            entity.LOLO.Enabled     = dto.LOLO_Enabled;
            entity.LOLO.Name        = dto.LOLO_Name;
            entity.LOLO.LevelChange = dto.LOLO_LevelChange;
            entity.LOLO.Delay       = dto.LOLO_Delay;
            entity.Enabled          = dto.Enabled;
            entity.Location         = dto.Location;

            dto.OnEntity(entity);

            return(entity);
        }
コード例 #3
0
 /// <summary>
 /// Invoked when <see cref="ToEntity"/> operation is about to return.
 /// </summary>
 /// <param name="entity"><see cref="AlarmConfiguration"/> converted from <see cref="AlarmConfigurationDto"/>.</param>
 static partial void OnEntity(this AlarmConfigurationDto dto, AlarmConfiguration entity);
コード例 #4
0
 /// <summary>
 /// Invoked when <see cref="ToDTO"/> operation is about to return.
 /// </summary>
 /// <param name="dto"><see cref="AlarmConfigurationDto"/> converted from <see cref="AlarmConfiguration"/>.</param>
 static partial void OnDTO(this AlarmConfiguration entity, AlarmConfigurationDto dto);