예제 #1
0
        /// <summary>
        /// Creates a control for a parameter
        /// </summary>
        /// <param name="param">The type of the parameter that will be displayed</param>
        /// <param name="location">The location at which the control should be added</param>
        /// <returns>An IParam object that's been added to the control</returns>
        private IParam AddParam(ParamDef param, Point location)
        {
            UserControl c = null;

            switch (param.ParamType)
            {
            case BoxPropType.Boolean:

                c = new BoolParam();
                break;

            case BoxPropType.DateTime:

                c = new DateTimeParam();
                break;

            case BoxPropType.Enumeration:

                c = new EnumParam();
                (c as EnumParam).EnumValues        = param.EnumValues;
                (c as EnumParam).EnumValueChanged += new EventHandler(ConstructorsViewer_EnumValueChanged);
                break;

            case BoxPropType.Map:

                c = new MapParam();
                break;

            case BoxPropType.Numeric:

                c = new NumericParam();
                break;

            case BoxPropType.Other:

                c = new TextParam();
                (c as TextParam).IsOther = true;
                break;

            case BoxPropType.Point3D:

                c = new Point3DParam();
                break;

            case BoxPropType.Text:

                c = new TextParam();
                break;

            case BoxPropType.TimeSpan:

                c = new TimeSpanParam();
                break;
            }

            (c as IParam).ParamName = param.Name;
            c.Location = location;
            Controls.Add(c);

            return(c as IParam);
        }
예제 #2
0
		/// <summary>
		/// Creates a control for a parameter
		/// </summary>
		/// <param name="param">The type of the parameter that will be displayed</param>
		/// <param name="location">The location at which the control should be added</param>
		/// <returns>An IParam object that's been added to the control</returns>
		private IParam AddParam( ParamDef param, Point location )
		{
			UserControl c = null;

			switch ( param.ParamType )
			{
				case BoxPropType.Boolean:

					c = new BoolParam();
					break;

				case BoxPropType.DateTime:

					c = new DateTimeParam();
					break;

				case BoxPropType.Enumeration:

					c = new EnumParam();
					( c as EnumParam ).EnumValues = param.EnumValues;
					( c as EnumParam ).EnumValueChanged += new EventHandler(ConstructorsViewer_EnumValueChanged);
					break;

				case BoxPropType.Map:

					c = new MapParam();
					break;

				case BoxPropType.Numeric:

					c = new NumericParam();
					break;

				case BoxPropType.Other:

					c = new TextParam();
					( c as TextParam ).IsOther = true;
					break;

				case BoxPropType.Point3D:

					c = new Point3DParam();
					break;

				case BoxPropType.Text:

					c = new TextParam();
					break;

				case BoxPropType.TimeSpan:

					c = new TimeSpanParam();
					break;
			}

			( c as IParam ).ParamName = param.Name;
			c.Location = location;
			Controls.Add( c );

			return c as IParam;
		}