public void Input()
        {
            // Open the "Create Condition" menu.
            InputSim.Press(Keys.Space, Wait.Long);

            // Setup control spot
            InputSim.Press(Keys.Tab, Wait.Short);
            // The spot will be at the bottom when tab is pressed.
            // Pressing up once will select the operator value, up another time will select the first value paramerer.
            InputSim.Press(Keys.Up, Wait.Short, 2);

            // Input value1.
            Value1.Input();

            // Set the operator.
            InputSim.Press(Keys.Down, Wait.Short);
            InputSim.SelectEnumMenuOption(CompareOperator);

            // Input value2.
            InputSim.Press(Keys.Down, Wait.Short);
            Value2.Input();

            // Close the Create Condition menu.
            InputSim.Press(Keys.Escape, Wait.Long);
        }
示例#2
0
 public bool SamePair(Pair <T> obj)
 {
     return(Equals(obj) ||
            (!Object.ReferenceEquals(null, obj) &&
             Value1.Equals(obj.Value2) &&
             Value2.Equals(obj.Value1)));
 }
示例#3
0
 public override int GetHashCode()
 {
     unchecked
     {
         return(((Value1 != null ? Value1.GetHashCode() : 0) * 397) ^ (Value2 != null ? Value2.GetHashCode() : 0));
     }
 }
示例#4
0
 partial void WriteValue1(ESPWriter writer)
 {
     if (Value1 != null)
     {
         Value1.WriteBinary(writer);
     }
 }
示例#5
0
 public override int GetHashCode()
 {
     unchecked
     {
         return((Value0.GetHashCode() * 397) ^ Value1.GetHashCode());
     }
 }
示例#6
0
        /// <summary>
        /// Returns true if PolicySubmit instances are equal
        /// </summary>
        /// <param name="other">Instance of PolicySubmit to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(PolicySubmit other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Value1 == other.Value1 ||
                     Value1 != null &&
                     Value1.Equals(other.Value1)
                     ) &&
                 (
                     Value2 == other.Value2 ||
                     Value2 != null &&
                     Value2.Equals(other.Value2)
                 ) &&
                 (
                     Value3 == other.Value3 ||
                     Value3 != null &&
                     Value3.Equals(other.Value3)
                 ));
        }
示例#7
0
 private void SampleCommandExecute(string digit)
 {
     if (Operator == OperatorType.NONE)
     {
         if (Value1 != null && Value1.Equals("0"))
         {
             Value1 = digit;
         }
         else
         {
             Value1 += digit;
         }
     }
     else
     {
         if (Value2 != null && Value2.Equals("0"))
         {
             Value2 = digit;
         }
         else
         {
             Value2 += digit;
         }
     }
 }
示例#8
0
        private void Update(EvaluationContext context)
        {
            var a = Value1.GetValue(context);
            var b = Value2.GetValue(context);

            Result.Value = a + b;
        }
示例#9
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Uuid != null)
         {
             hashCode = hashCode * 59 + Uuid.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (Value1 != null)
         {
             hashCode = hashCode * 59 + Value1.GetHashCode();
         }
         if (Value2 != null)
         {
             hashCode = hashCode * 59 + Value2.GetHashCode();
         }
         if (Value3 != null)
         {
             hashCode = hashCode * 59 + Value3.GetHashCode();
         }
         return(hashCode);
     }
 }
示例#10
0
        public override string GCode_GetValueName(CodeGenerateSystem.Base.LinkPinControl element, CodeGenerateSystem.Base.GenerateCodeContext_Method context)
        {
            switch (CSParam.ConstructParam)
            {
            case "+":
                return("(" + m_strValueName1 + " + " + m_strValueName2 + ")");

            case "-":
                return("(" + m_strValueName1 + " - " + m_strValueName2 + ")");

            case "×":
                return("(" + m_strValueName1 + " * " + m_strValueName2 + ")");

            case "·":       // 点乘
            case "dot":
                return("dot(" + m_strValueName1 + " ," + m_strValueName2 + ")");

            case "÷":
                return("(" + m_strValueName1 + "/" + m_strValueName2 + ")");

            case "cross":      // 叉乘
            {
                if ((Value1.GetLinkType(0, true) == enLinkType.Float2 && Value2.GetLinkType(0, true) == enLinkType.Float2) ||
                    (Value1.GetLinkType(0, true) == enLinkType.Float3 && Value2.GetLinkType(0, true) == enLinkType.Float3) ||
                    (Value1.GetLinkType(0, true) == enLinkType.Float4 && Value2.GetLinkType(0, true) == enLinkType.Float4))
                {
                    return("cross(" + m_strValueName1 + ", " + m_strValueName2 + ")");
                }

                return("(" + m_strValueName1 + " * " + m_strValueName2 + ")");
            }
            }

            return(base.GCode_GetValueName(element, context));
        }
示例#11
0
        public override string ToString()
        {
            StringBuilder builder = new StringBuilder();

            builder.Append('[');
            if (Key != null)
            {
                builder.Append(Key.ToString());
            }

            builder.Append(", ");
            if (Value1 != null)
            {
                builder.Append(Value1.ToString());
            }

            builder.Append(", ");
            if (Value2 != null)
            {
                builder.Append(Value2.ToString());
            }

            builder.Append(']');
            return(builder.ToString());
        }
示例#12
0
        public override bool Equals(object obj)
        {
            var v = obj as Pair <T>;

            return(!Object.ReferenceEquals(null, v) &&
                   Value1.Equals(v.Value1) &&
                   Value2.Equals(v.Value2));
        }
示例#13
0
        public override int GetHashCode()
        {
            int hash = 13;

            hash = (hash * 7) + Value1.GetHashCode();
            hash = (hash * 7) + Value2.GetHashCode();
            return(hash);
        }
示例#14
0
 public void ResetCalculator()
 {
     Value1    = 0;
     Value2    = null;
     Result    = null;
     Operation = OperationType.None;
     Display   = Value1.ToString();
 }
示例#15
0
 public Task Execute(IBotEngine instance)
 {
     if (Value1.Equals(Player.Cell, StringComparison.OrdinalIgnoreCase))
     {
         instance.Index++;
     }
     return(Task.FromResult <object>(null));
 }
示例#16
0
 public bool Equals(AreaSpriteCommand other)
 {
     return(!Size.Equals(other.Size)
         ? false
         : !Value1.Equals(other.Value1) || Value2.Equals(other.Value2)
             ? false
             : Size == 2 || Value3.Equals(other.Value3));
 }
示例#17
0
        public GeneratedShape Do()
        {
            if (Value1 == null || Value2 == null)
            {
                return(null);
            }

            return(Value1.Do(Operation, Value2));
        }
 /// <summary>
 /// Gets a string representation of the sample.
 /// </summary>
 public override string ToString()
 {
     return
         (string.Format(
              Resources.ExerciseSampleTwoValueToStringFormat,
              OffsetInSeconds.ToString(),
              Value1.ToString(),
              Value2.ToString()));
 }
示例#19
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = (Value1 != null ? Value1.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Value2;
         hashCode = (hashCode * 397) ^ Value3.GetHashCode();
         return(hashCode);
     }
 }
示例#20
0
 public bool Equals(AreaObjectCommand other)
 {
     return(!Size.Equals(other.Size)
         ? false
         : !Value1.Equals(other.Value1) || !Value2.Equals(other.Value2)
         ? false
         : Size == 3
         ? Value3.Equals(other.Value3)
         : true);
 }
        public void TestCacheStartFromCodeRegistersMetaForQueryEntityTypes()
        {
            var cfg = new CacheConfiguration
            {
                Name          = TestUtils.TestName,
                QueryEntities = new[]
                {
                    new QueryEntity
                    {
                        KeyType   = typeof(Key1),
                        ValueType = typeof(Value1)
                    }
                }
            };

            var cache = Ignition.GetIgnite("0").CreateCache <Key1, Value1>(cfg);

            foreach (var ignite in Ignition.GetAll())
            {
                // Do not use GetBinaryType which always returns something.
                // Use GetBinaryTypes to make sure that types are actually registered.
                var types     = ignite.GetBinary().GetBinaryTypes();
                var qryEntity = ignite.GetCache <object, object>(cfg.Name).GetConfiguration().QueryEntities.Single();

                var keyType = types.Single(t => t.TypeName == qryEntity.KeyTypeName);
                var valType = types.Single(t => t.TypeName == qryEntity.ValueTypeName);

                Assert.AreEqual(typeof(Key1).FullName, qryEntity.KeyTypeName);
                Assert.AreEqual(typeof(Value1).FullName, qryEntity.ValueTypeName);

                Assert.AreEqual("Bar", keyType.AffinityKeyFieldName);
                Assert.IsEmpty(keyType.Fields);

                Assert.IsNull(valType.AffinityKeyFieldName);
                Assert.IsEmpty(valType.Fields);
            }

            // Verify put/get on server and client.
            cache[new Key1 {
                      Foo = "a", Bar = 2
                  }] = new Value1 {
                Name = "x", Value = 1
            };

            using (var client = Ignition.StartClient(new IgniteClientConfiguration("localhost")))
            {
                var clientCache = client.GetCache <Key1, Value1>(cache.Name);
                var val         = clientCache.Get(new Key1 {
                    Foo = "a", Bar = 2
                });

                Assert.AreEqual("x", val.Name);
                Assert.AreEqual(1, val.Value);
            }
        }
 public int ElementCount(bool optimized)
 {
     if (optimized)
     {
         return(1 + Value1.Optimize().ElementCount() + Value2.Optimize().ElementCount());
     }
     else
     {
         return(1 + Value1.ElementCount() + Value2.ElementCount());
     }
 }
示例#23
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Breadcrumb != null ? Breadcrumb.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ChildProperty != null ? ChildProperty.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Value1 != null ? Value1.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Value2 != null ? Value2.GetHashCode() : 0);
         return(hashCode);
     }
 }
示例#24
0
        public DoubleRangeSliderOptionModel(Option option)
            : base(option.Id, option.DisplayName, option.Description, option.Params)
        {
            UpdateValue(option.Value);

            MaxValue.Value = option.MinMax[0].Max;
            MinValue.Value = option.MinMax[0].Min;

            Value1.Subscribe(_ => SignalValueChanged());
            Value2.Subscribe(_ => SignalValueChanged());
        }
示例#25
0
        public Task Execute(IBotEngine instance)
        {
            string map = Value1.Contains("-") ?
                         Value1.Split('-')[0] : Value1;

            if (!map.Equals(Player.Map, StringComparison.OrdinalIgnoreCase))
            {
                instance.Index++;
            }
            return(Task.FromResult <object>(null));
        }
示例#26
0
        public override IEnumerable <string> GetValueString()
        {
            List <string> result = new List <string>();

            result.Add(FuncName);
            result.Add(Value1.ToString());
            result.Add(Value2.ToString());
            result.Add(Value3.ToString());
            result.Add(Value4.ToString());
            return(result);
        }
        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {
            double rsi0, rsi1, dar, tr, dv;

            if (CurrentBar <= StartBar)
            {
                return;
            }


            Value1.Set(EMA(RSI(rSI_Period, 3), sF)[0]);



            AtrRsi.Set(Math.Abs(Value1[1] - Value1[0]));

            MaAtrRsi.Set(EMA(AtrRsi, Wilders_Period)[0]);

            tr   = Value2[1];
            rsi1 = Value1[1];

            rsi0 = Value1[0];
            dar  = EMA(MaAtrRsi, Wilders_Period)[0] * 4.236;

            dv = tr;
            if (rsi0 < tr)
            {
                tr = rsi0 + dar;
                if (rsi1 < dv)
                {
                    if (tr > dv)
                    {
                        tr = dv;
                    }
                }
            }
            else if (rsi0 > tr)
            {
                tr = rsi0 - dar;
                if (rsi1 > dv)
                {
                    if (tr < dv)
                    {
                        tr = dv;
                    }
                }
            }
            Value2.Set(tr);


            //Change Colors
            PlotColors[0][0] = Line_01;
            PlotColors[1][0] = Line_02;
        }
示例#28
0
        public override string GCode_GetTypeString(CodeGenerateSystem.Base.LinkPinControl element, CodeGenerateSystem.Base.GenerateCodeContext_Method context)
        {
            if (element == null || element == ResultLink)
            {
                if (Value1.HasLink)
                {
                    return(Value1.GetLinkedObject(0, true).GCode_GetTypeString(Value1.GetLinkedPinControl(0, true), context));
                }
            }

            return(base.GCode_GetTypeString(element, context));
        }
示例#29
0
        protected sealed override bool check()
        {
            var value1 = Value1.GetValueAsObject() as IComparable;
            var value2 = Value2.GetValueAsObject() as IComparable;

            if (value1 == null || value2 == null)
            {
                return(false);
            }

            return(value1.CompareTo(value2) < 0);
        }
        public override int GetHashCode()
        {
            int hash;

            unchecked
            {
                hash = 27;
                hash = (hash * 23) + ((Value1 == null) ? 0 : Value1.GetHashCode());
                hash = (hash * 23) + Value2.GetHashCode();
            }

            return(hash);
        }
示例#31
0
 public void ThreadTarget()
 {
     autoEvent.WaitOne();
     v0 = new Value0();
     v1 = new Value1();
     v2 = new Value2();
     v3 = new Value3();
     v4 = new Value4();
     v5 = new Value5();
     pass = v0.CheckValues()
             && v1.CheckValues()
             && v2.CheckValues()
             && v3.CheckValues()
             && v4.CheckValues()
             && v5.CheckValues();
 }