Esempio n. 1
0
        public void ParseConditionList()
        {
            var conditions = (new Tws().ParseConditions("default Price of 8314(SMART) is <= 0 and the margin cushion percent is <= 5 or trade occurs for ANY symbol on ANY exchange for * security type and time is <= 20151030 21:56:26 GMT+03:00 or Volume of 265598(SMART) is <= 8 and PercentCange of 43645865(ISLAND) is <= 0") as ArrayList).OfType <OrderCondition>();

            var conds = new[] {
                OperatorCondition.Parse("default Price of 8314(SMART) is <= 0 and"),
                OperatorCondition.Parse("the margin cushion percent is <= 5 or"),
                OperatorCondition.Parse("trade occurs for ANY symbol on ANY exchange for * security type and"),
                OperatorCondition.Parse("time is <= 20151030 21:56:26 GMT+03:00 or"),
                OperatorCondition.Parse("Volume of 265598(SMART) is <= 8 and"),
                OperatorCondition.Parse("PercentCange of 43645865(ISLAND) is <= 0")
            };

            Assert.IsTrue(conds.SequenceEqual(conditions));
        }
Esempio n. 2
0
 private void fillOperator(OperatorCondition condition, ComboBox op)
 {
     condition.IsMore = op.SelectedIndex == 1;
 }
Esempio n. 3
0
        private void ultraGrid1_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            e.Layout.Bands[1].Columns["size"].SortComparer = new SizeComparer();
            e.Layout.Bands[1].Columns["size"].SortIndicator = SortIndicator.Ascending;
            //this.ultraGrid1.Rows[0].Height = 25;

            e.Layout.Override.SelectTypeRow = SelectType.Single;
            e.Layout.Override.CellClickAction = CellClickAction.RowSelect;
            //列名
            e.Layout.Bands[0].Columns["cartonNumber"].Header.Caption = "箱号";

            // e.Layout.Bands[0].Columns["cartonNumber"].Layout.Override.DefaultColWidth = 60;
            e.Layout.Bands[0].Columns["qty"].Header.Caption = "开箱双数";
            e.Layout.Bands[0].Columns["qty2"].Header.Caption = "封箱双数";
            e.Layout.Bands[0].Columns["valid"].Header.Caption = "满箱";
            e.Layout.Bands[0].Columns["status"].Header.Caption = "状态";

            //   e.Layout.Bands[0].Columns["valid"].Header.Caption = "是否满箱";
            e.Layout.Bands[1].Columns["cartonNumber"].Header.Caption = "箱号";
            e.Layout.Bands[1].Columns["type"].Header.Caption = "款号";
            e.Layout.Bands[1].Columns["color"].Header.Caption = "颜色";
            e.Layout.Bands[1].Columns["size"].Header.Caption = "尺码";
            e.Layout.Bands[1].Columns["qty"].Header.Caption = "开箱双数";
            e.Layout.Bands[1].Columns["qty2"].Header.Caption = "封箱双数";
            e.Layout.Appearance.FontData.SizeInPoints = 12;
            e.Layout.Appearance.TextVAlign = VAlign.Middle;
            //  grid.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
            ConditionValueAppearance cva = new ConditionValueAppearance();
            OperatorCondition oc = new OperatorCondition(ConditionOperator.Contains, "未保存");
            Infragistics.Win.Appearance apce1 = new Infragistics.Win.Appearance("apce1");
            apce1.ForeColor = Color.Red;
            apce1.BackColor = Color.Yellow;
            cva.Add(oc, apce1);
            e.Layout.Bands[0].Columns["status"].ValueBasedAppearance = cva;

            ConditionValueAppearance cva2 = new ConditionValueAppearance();
            OperatorCondition oc2 = new OperatorCondition(ConditionOperator.Contains, "否");
            Infragistics.Win.Appearance apce2 = new Infragistics.Win.Appearance("apce2");
            apce2.ForeColor = Color.Red;
            apce2.BackColor = Color.Yellow;
            cva2.Add(oc2, apce2);
            e.Layout.Bands[0].Columns["valid"].ValueBasedAppearance = cva2;
        }
Esempio n. 4
0
 private void fillOperator(ComboBox op, OperatorCondition condition)
 {
     op.SelectedIndex = condition.IsMore ? 1 : 0;
 }
Esempio n. 5
0
    private ConditionValueAppearance CreateOperatorConditionValueAppearance()
    {
      // This method will create a ConditionValueAppearance using OperatorConditions. OperatorConditions
      // do not rely on UltraCalcManager and they cannot use formulas. They need a ConditionOperator
      // and a value to determine if the cell matches the condition. 

      // Create a new ConditionValueAppearance
      var conditionValueAppearance = new ConditionValueAppearance();

      // Create a OperatorCondition that checks for negative numbers
      var negativeCondition = new OperatorCondition(ConditionOperator.LessThan, 0);

      // Create an appearance that sets the ForeColor to red.
      var negativeAppearance = new Infragistics.Win.Appearance("Negative")
      {
        ForeColor = LookFeel.NegativeColor
      };

      // Create a OperatorCondition that checks for positive numbers
      var positiveCondition = new OperatorCondition(ConditionOperator.GreaterThanOrEqualTo, 0);

      // Create an appearance that sets the ForeColor to blue.
      var positiveAppearance = new Infragistics.Win.Appearance("Positive")
      {
        ForeColor = LookFeel.PositiveColor
      };

      // Now that we have the conditions and appearances we need, add them to the 
      // conditionValueAppearance. The conditions will be evaluated in order.
      conditionValueAppearance.Add(negativeCondition, negativeAppearance);
      conditionValueAppearance.Add(positiveCondition, positiveAppearance);

      return conditionValueAppearance;
    }