예제 #1
0
        /// <summary>
        /// CreateField in EntryForm
        ///
        /// </summary>
        /// <param name="param">
        /// param.PropertyInfo
        /// param.Location
        /// param.OrientationField
        /// param.SizeLabel
        /// param.SizeControl
        /// param.ConfigProperty
        /// param.TabIndex
        /// param.Service
        /// param.ConfigEntity
        /// param.TabControlForm
        /// param.Entity
        /// param.ConteneurFormulaire
        /// </param>
        /// <returns>the created field</returns>
        public BaseField CreateField_In_EntryForm(CreateFieldParams param)
        {
            this.errorProvider = param.errorProvider;

            DateTimeField dateTimeField = new DateTimeField();

            dateTimeField.StopAutoSizeConfig();
            dateTimeField.Name             = param.PropertyInfo.Name;
            dateTimeField.Location         = param.Location;
            dateTimeField.OrientationField = param.OrientationField;
            dateTimeField.SizeLabel        = param.SizeLabel;
            dateTimeField.SizeControl      = param.SizeControl;

            dateTimeField.TabIndex   = param.TabIndex;
            dateTimeField.Text_Label = param.ConfigProperty.DisplayProperty.Title;
            dateTimeField.ConfigSizeField();

            // Validation
            // We can not check validation of DateTime Control because we can not knew the default value
            //dateTimeField.Validating += DateTimeField_Validating;

            // Insertion à l'interface
            param.ConteneurFormulaire.Controls.Add(dateTimeField);
            return(dateTimeField);
        }
예제 #2
0
        public BaseField CreateField_In_Filter(CreateField_In_Filter_Params param)
        {
            DateTimeField dateTimeField = new DateTimeField();

            dateTimeField.StopAutoSizeConfig();
            dateTimeField.Name             = param.ConfigProperty.PropertyInfo.Name;
            dateTimeField.SizeLabel        = param.SizeLabel;
            dateTimeField.SizeControl      = param.SizeControl;
            dateTimeField.OrientationField = Orientation.Horizontal;
            dateTimeField.TabIndex         = param.TabIndex;
            dateTimeField.Text_Label       = param.ConfigProperty.DisplayProperty.Title;

            dateTimeField.ConfigSizeField();
            param.FilterContainer.Controls.Add(dateTimeField);

            return(dateTimeField);
        }
예제 #3
0
        public void DateTimeField_Vertical_Test()
        {
            Size SizeLabel   = new Size(101, 21);
            Size SizeControl = new Size(101, 21);

            DateTimeField DateTimeField_Vertical = new DateTimeField();

            DateTimeField_Vertical.StopAutoSizeConfig();
            DateTimeField_Vertical.SizeLabel        = SizeLabel;
            DateTimeField_Vertical.SizeControl      = SizeControl;
            DateTimeField_Vertical.OrientationField = Orientation.Vertical;
            DateTimeField_Vertical.ConfigSizeField();
            DateTimeField_Vertical.ValueChanged += DateTimeField_FieldChanged;
            DateTimeField_Vertical.Value         = DateTime.Now;

            Assert.AreEqual(SizeControl.Height, DateTimeField_Vertical.Height);

            Assert.AreEqual(SizeLabel.Width + SizeControl.Width, DateTimeField_Vertical.Width);
        }