Beispiel #1
0
        /// <summary>
        /// todoComment
        /// </summary>
        /// <param name="ADBFieldName"></param>
        /// <param name="ADataRow"></param>
        /// <param name="ACriteriaField"></param>
        /// <param name="AMatchField"></param>
        /// <param name="AOdbcType"></param>
        /// <param name="AOdbcSize"></param>
        /// <param name="AWhereClause"></param>
        /// <param name="AIntParamArray"></param>
        public TDynamicSearchHelper(String ADBFieldName,
                                    DataRow ADataRow,
                                    String ACriteriaField,
                                    String AMatchField,
                                    OdbcType AOdbcType,
                                    Int32 AOdbcSize,
                                    ref String AWhereClause,
                                    ref ArrayList AIntParamArray)
        {
            object        ParameterValue;
            OdbcParameter miParam;

            FDBFieldName   = ADBFieldName;
            FDataRow       = ADataRow;
            FCriteriaField = ACriteriaField;
            FMatchField    = AMatchField;

            ParameterValue = GetParameterValue();

            if (ParameterValue.ToString() != String.Empty)
            {
                miParam       = new OdbcParameter("", AOdbcType, AOdbcSize);
                miParam.Value = ParameterValue;

                AIntParamArray.Add(miParam);
                AWhereClause = AWhereClause + GetWhereString();
            }
        }
Beispiel #2
0
        internal XmlElement getXML(XmlDocument doc, string name, Dictionary <string, XmlElement> processed, DatabaseIfc db)
        {
            XmlElement result = doc.CreateElement(name, db.mXmlNamespace);

            if (!double.IsNaN(ParameterValue))
            {
                XmlElement element = doc.CreateElement("IfcParameterValue-wrapper", db.mXmlNamespace);
                element.InnerText = ParameterValue.ToString();
                result.AppendChild(element);
            }
            if (CartesianPoint != null)
            {
                result.AppendChild(CartesianPoint.GetXML(doc, "", null, processed));
            }
            return(result);
        }
Beispiel #3
0
        protected override void OnSaving()
        {
            base.OnSaving();

            if (ParameterValue != null)
            {
                if (DataType == DataTypeEnnum.Datetime)
                {
                    var date = DateTime.Parse(ParameterValue.ToString());
                    DefaultValue = date.ToString("yyyy.MMM.dd HH:mm");
                }
                else
                {
                    DefaultValue = ParameterValue.ToString();
                }
            }
        }
        public override void PaintValue(PaintValueEventArgs e)
        {
            rc = e.Bounds;
            ParameterValue dv = e.Context.Instance as ParameterValue;

            if (dv != null)
            {
                if (dv.DataIcon == null)
                {
                    IMathExpression mew = e.Value as IMathExpression;
                    if (mew != null)
                    {
                        dv.DataIcon = mew.CreateIcon(e.Graphics);
                    }
                }
                if (dv.DataIcon != null)
                {
                    e.Graphics.DrawImage(dv.DataIcon, e.Bounds);
                }
                e.Graphics.DrawString(dv.ToString(), f, br, (float)16, (float)1);
            }
            base.PaintValue(e);
        }
Beispiel #5
0
        //[ReadOnly(true)]
        //[Description("Values for action method parameters. Their value are given when an action is created using the method. When the action is executed these values are passed into the method.")]
        //public ListProperty<ParameterValue> ActionValues
        //{
        //    get
        //    {
        //        if (_actionValues == null)
        //        {
        //            _actionValues = new ListProperty<ParameterValue>(this,"ActionValues");
        //            _actionValues.AssignValue("value", Value);
        //        }
        //        return _actionValues;
        //    }
        //}
        #endregion
        #region methods
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            if (this.SetProperty == null)
            {
                sb.Append("?");
            }
            else
            {
                sb.Append(this.SetProperty.Name);
            }
            sb.Append("=");
            if (_value == null)
            {
                sb.Append("?");
            }
            else
            {
                sb.Append(_value.ToString());
            }
            return(sb.ToString());
        }
Beispiel #6
0
        private void btnEvaluateExpressionStyle_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            #region #evaluateExpressionStyle
            FormulaEngine engine = spreadsheetControl1.Document.FormulaEngine;
            // Get coordinates of the active cell.
            int columnIndex = spreadsheetControl1.ActiveCell.ColumnIndex;
            int rowIndex    = spreadsheetControl1.ActiveCell.RowIndex;
            // Create the expression context.
            ExpressionContext context = new ExpressionContext(columnIndex, rowIndex, this.contextSheet,
                                                              CultureInfo.GetCultureInfo("en-US"), ReferenceStyle.UseDocumentSettings, (ExpressionStyle)editExpressionStyle.EditValue);
            // Evaluate the expression.
            ParameterValue result = engine.Evaluate(spreadsheetControl1.ActiveCell.Formula, context);
            // Get the result.
            string res = string.Empty;

            if (result.IsArray)
            {
                res += Environment.NewLine;
                int rowLength = result.ArrayValue.GetLength(0);
                int colLength = result.ArrayValue.GetLength(1);

                for (int i = 0; i < rowLength; i++)
                {
                    for (int j = 0; j < colLength; j++)
                    {
                        res += String.Format("{0} ", result.ArrayValue[i, j]);
                    }
                    res += Environment.NewLine;
                }
            }
            else
            {
                res = result.ToString();
            }
            #endregion #evaluateExpressionStyle
            MessageBox.Show(String.Format("The result is {0}", res), "Evaluate Using Expression Style");
        }
Beispiel #7
0
 public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
 {
     if (VPLUtil.GetBrowseableProperties(attributes))
     {
         PropertyDescriptorCollection ps   = TypeDescriptor.GetProperties(this, attributes, true);
         List <PropertyDescriptor>    list = new List <PropertyDescriptor>();
         foreach (PropertyDescriptor p in ps)
         {
             if (p.Name == Instance_Type)
             {
                 if (_var != null)
                 {
                     if (_var.BaseClassType.IsPrimitive || _var.BaseClassType.IsSealed || _var.BaseClassType.IsValueType)
                     {
                         PropertyDescriptorForDisplay pd = new PropertyDescriptorForDisplay(this.GetType(), p.Name, _valType.ToString(), attributes);
                         list.Add(pd);
                     }
                     else
                     {
                         list.Add(p);
                     }
                 }
             }
             else
             {
                 list.Add(p);
             }
         }
         ps = new PropertyDescriptorCollection(list.ToArray());
         return(ps);
     }
     else
     {
         return(TypeDescriptor.GetProperties(this, attributes, true));
     }
 }
Beispiel #8
0
 protected override string ParameterValueToCode(MethodInfo methodInfo)
 {
     return(ParameterValue.ToString());
 }
        public void ToStringTest(ParameterValue parameter)
        {
            var name = parameter.GetType().Name;

            Assert.IsTrue(parameter.ToString().StartsWith(name));
        }