/// <summary>
        /// 参数验证
        /// </summary>
        /// <param name="parameter">当前参数</param>
        /// <param name="type">验证方式</param>
        /// <returns>True:验证失败</returns>
        public static bool CheckParameter(string parameter, ParameterEnum type) {
            bool returnValue = false;
            //不能为空
            if ((type & ParameterEnum.NoEmpty) == ParameterEnum.NoEmpty) {
                if (string.IsNullOrEmpty(parameter.Replace(" ", ""))) {
                    returnValue = true;
                }
            }
            //必须是数字
            if ((type & ParameterEnum.Number) == ParameterEnum.Number) {
                if (!StringHelper.IsNumeric(parameter)) {
                    returnValue = true;
                }
                else {
                    //如果是数字必须大于0
                    if ((type & ParameterEnum.NotDefaultInt) == ParameterEnum.NotDefaultInt) {
                        if (Convert.ToInt32(parameter) <= 0) {
                            returnValue = true;
                        }
                    }
                }
            }

            //必须是日期
            if ((type & ParameterEnum.Date) == ParameterEnum.Date) {

            }
            return returnValue;
        }
Exemple #2
0
 public override System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer> ReadFields(System.IO.BinaryReader binaryReader)
 {
     System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer> pointerQueue = new System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer>(base.ReadFields(binaryReader));
     this.Parameter       = ((ParameterEnum)(binaryReader.ReadInt32()));
     this.fieldpad        = binaryReader.ReadBytes(4);
     this.StringList      = binaryReader.ReadTagReference();
     this.TitleText       = binaryReader.ReadStringID();
     this.HeaderText      = binaryReader.ReadStringID();
     this.DescriptionText = binaryReader.ReadStringID();
     pointerQueue.Enqueue(binaryReader.ReadBlamPointer(12));
     return(pointerQueue);
 }
        private DataTable BuildDummyDataTable <T>(TableEnum tableName, ParameterEnum columnName, T[] columnValues)
        {
            DataTable returnValue;

            returnValue = new DataTable(tableName.ToString());
            returnValue.Columns.Add(columnName.ToString());
            returnValue.Columns[0].DataType = typeof(T);
            if (columnValues != null)
            {
                foreach (object Item in columnValues)
                {
                    returnValue.Rows.Add(Item);
                }
            }

            return(returnValue);
        }
        /// <summary>
        /// 参数模型选择按钮被点击
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void PSelect_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            TextBlock tb = (TextBlock)sender;

            //如果点击的是已经选择的,则直接忽略
            if (tb == NowSelectTB)
            {
                return;
            }

            //取消之前的选择状态
            if (NowSelectTB != null)
            {
                NowSelectTB.Foreground = new SolidColorBrush(Color.FromArgb(0x7F, 0x43, 0x43, 0x43));
            }

            //点击自动关闭
            BeginStoryboard((Storyboard)this.Resources["SelectBoxClose"]);
            IsSelectBoxOpen = false;
            NowSelectTB     = tb;

            //字符显示到正确位置
            ParameterModelDisplayTB.Text = tb.Text;

            //选择对应的参数类型
            if (tb.Tag.ToString() == "ITU4")
            {
                SelectParameter = ParameterEnum.ITU4;
            }
            else if (tb.Tag.ToString() == "ITU5")
            {
                SelectParameter = ParameterEnum.ITU5;
            }
            else if (tb.Tag.ToString() == "ITU6")
            {
                SelectParameter = ParameterEnum.ITU6;
            }
            else if (tb.Tag.ToString() == "ITU8")
            {
                SelectParameter = ParameterEnum.ITU8;
            }
        }
Exemple #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="KapiConferenceSet" /> class.
 /// </summary>
 /// <param name="applicationName">applicationName (required).</param>
 /// <param name="conferenceID">conferenceID (required).</param>
 /// <param name="eventCategory">eventCategory.</param>
 /// <param name="eventName">eventName.</param>
 /// <param name="_parameter">_parameter (required).</param>
 /// <param name="value">value (required).</param>
 public KapiConferenceSet(ApplicationNameEnum applicationName = default(ApplicationNameEnum), string conferenceID = default(string), EventCategoryEnum?eventCategory = default(EventCategoryEnum?), EventNameEnum?eventName = default(EventNameEnum?), ParameterEnum _parameter = default(ParameterEnum), string value = default(string))
 {
     // to ensure "applicationName" is required (not null)
     if (applicationName == null)
     {
         throw new InvalidDataException("applicationName is a required property for KapiConferenceSet and cannot be null");
     }
     else
     {
         this.ApplicationName = applicationName;
     }
     // to ensure "conferenceID" is required (not null)
     if (conferenceID == null)
     {
         throw new InvalidDataException("conferenceID is a required property for KapiConferenceSet and cannot be null");
     }
     else
     {
         this.ConferenceID = conferenceID;
     }
     // to ensure "_parameter" is required (not null)
     if (_parameter == null)
     {
         throw new InvalidDataException("_parameter is a required property for KapiConferenceSet and cannot be null");
     }
     else
     {
         this.Parameter = _parameter;
     }
     // to ensure "value" is required (not null)
     if (value == null)
     {
         throw new InvalidDataException("value is a required property for KapiConferenceSet and cannot be null");
     }
     else
     {
         this.Value = value;
     }
     this.EventCategory = eventCategory;
     this.EventName     = eventName;
 }
        /// <summary>
        /// 参数验证
        /// </summary>
        /// <param name="parameter">当前参数</param>
        /// <param name="type">验证方式</param>
        /// <returns>True:验证失败</returns>
        public static bool CheckParameter(string parameter, ParameterEnum type)
        {
            bool returnValue = false;

            //不能为空
            if ((type & ParameterEnum.NoEmpty) == ParameterEnum.NoEmpty)
            {
                if (string.IsNullOrEmpty(parameter.Replace(" ", "")))
                {
                    returnValue = true;
                }
            }
            //必须是数字
            if ((type & ParameterEnum.Number) == ParameterEnum.Number)
            {
                if (!StringHelper.IsNumeric(parameter))
                {
                    returnValue = true;
                }
                else
                {
                    //如果是数字必须大于0
                    if ((type & ParameterEnum.NotDefaultInt) == ParameterEnum.NotDefaultInt)
                    {
                        if (Convert.ToInt32(parameter) <= 0)
                        {
                            returnValue = true;
                        }
                    }
                }
            }

            //必须是日期
            if ((type & ParameterEnum.Date) == ParameterEnum.Date)
            {
            }
            return(returnValue);
        }
Exemple #7
0
        public double GetFigureValues(FigureEnum figureType, ParameterEnum parameterToCompute, Dimensions dimensions, double output)
        {
            switch (figureType)
            {
            case FigureEnum.Triangle:
            {
                switch (parameterToCompute)
                {
                case ParameterEnum.Square:
                {
                    output = 1 / 2 * dimensions.FirstSide * dimensions.Height;
                    return(Math.Round(output - 1));
                }

                case ParameterEnum.Perimeter:
                {
                    output = dimensions.FirstSide + dimensions.SecondSide + dimensions.ThirdSide;
                    return(Math.Round(output - 1));
                }
                }

                return(output);
            }

            case FigureEnum.Rectangle:
            {
                switch (parameterToCompute)
                {
                case ParameterEnum.Square:
                {
                    output = dimensions.FirstSide * dimensions.Height;
                    return(Math.Round(output - 1));
                }

                case ParameterEnum.Perimeter:
                {
                    output = 2 * dimensions.FirstSide + 2 * dimensions.SecondSide;
                    return(Math.Round(output - 1));
                }
                }

                return(output);
            }

            case FigureEnum.Circle:
            {
                switch (parameterToCompute)
                {
                case ParameterEnum.Square:
                {
                    output = 3.14 * dimensions.Diameter;
                    return(Math.Round(output - 1));
                }

                case ParameterEnum.Perimeter:
                {
                    output = 2 * 3.14 * dimensions.Radius;
                    return(Math.Round(output - 1));
                }
                }
                return(output);
            }
            }
            return(output);
        }
Exemple #8
0
        public ReturnType MethodA(ParameterType a, GenericParameterType <GenericParameterTypeParameter> b, ParameterEnum c)
        {
            MethodVariableType d = new MethodVariableType();

            return(null);
        }