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)); }
private void ParseSpecial(CSVLoader csvLoader) { for (int i = 0; i < csvLoader.Rows; i++) { csvLoader.ReadValue(0, i, string.Empty, out string Value); csvLoader.ReadValue(1, i, string.Empty, out string Value2); csvLoader.ReadValue(2, i, string.Empty, out string Value3); csvLoader.ReadValue(3, i, string.Empty, out string Value4); csvLoader.ReadValue(4, i, def: false, out bool Value5); csvLoader.ReadValue(5, i, string.Empty, out string Value6); csvLoader.ReadValue(6, i, string.Empty, out string Value7); csvLoader.ReadValue(7, i, def: false, out bool Value8); csvLoader.ReadValue(8, i, string.Empty, out string Value9); csvLoader.ReadValue(9, i, def: false, out bool Value10); csvLoader.ReadValue(10, i, string.Empty, out string Value11); csvLoader.ReadValue(11, i, string.Empty, out string Value12); csvLoader.ReadValue(12, i, 100, out int Value13); Value.Trim(); Value.ToLower(); Value2.Trim(); Value3.Trim(); Value4.Trim(); Value4.ToLower(); Value6 = Value6.Trim(); Value6 = Value6.ToLower(); Value7.Trim(); Value11.Trim(); int ct = TItem.String2Type(Value4); Add(Value, new TSpecial(Value, Value2, FindIcon(Value3), ct, Value5, TItem.String2FunctionMask(Value6), Value7, Value8, Value9, Value10, Convert.ToInt32(Value11), Value12, Value13)); } }
private void ParseUpgradeChargeTable(CSVLoader csvLoader) { upgradeChargeTables = new UpgradeTable[csvLoader.Rows]; for (int i = 0; i < csvLoader.Rows; i++) { upgradeChargeTables[i] = new UpgradeTable(); csvLoader.ReadValue(0, i, string.Empty, out string Value); csvLoader.ReadValue(1, i, string.Empty, out string Value2); csvLoader.ReadValue(2, i, string.Empty, out string Value3); csvLoader.ReadValue(3, i, string.Empty, out string Value4); csvLoader.ReadValue(4, i, string.Empty, out string Value5); csvLoader.ReadValue(5, i, string.Empty, out string Value6); csvLoader.ReadValue(6, i, string.Empty, out string Value7); csvLoader.ReadValue(7, i, string.Empty, out string Value8); Value.Trim(); Value2.Trim(); Value3.Trim(); Value4.Trim(); Value5.Trim(); Value6.Trim(); Value7.Trim(); Value8.Trim(); upgradeChargeTables[i].Level = Convert.ToInt32(Value); upgradeChargeTables[i].AssultAtkVal = (float)Convert.ToDouble(Value2); upgradeChargeTables[i].SubmachineAtkVal = (float)Convert.ToDouble(Value3); upgradeChargeTables[i].SniperAtkVal = (float)Convert.ToDouble(Value4); upgradeChargeTables[i].HeavyAtkVal = (float)Convert.ToDouble(Value5); upgradeChargeTables[i].HandgunAtkVal = (float)Convert.ToDouble(Value6); upgradeChargeTables[i].SpecialAtkVal = (float)Convert.ToDouble(Value7); upgradeChargeTables[i].Price = Convert.ToInt32(Value8); } }
private void ParseMonTable(CSVLoader csvLoader) { monTables = new MonTable[csvLoader.Rows]; for (int i = 0; i < csvLoader.Rows; i++) { monTables[i] = new MonTable(); csvLoader.ReadValue(0, i, string.Empty, out string Value); csvLoader.ReadValue(1, i, string.Empty, out string Value2); csvLoader.ReadValue(2, i, string.Empty, out string Value3); csvLoader.ReadValue(3, i, string.Empty, out string Value4); csvLoader.ReadValue(4, i, string.Empty, out string Value5); csvLoader.ReadValue(5, i, string.Empty, out string Value6); Value.Trim(); Value2.Trim(); Value3.Trim(); Value4.Trim(); Value5.Trim(); Value6.Trim(); monTables[i].name = Value; monTables[i].str = Value2; monTables[i].HP = Convert.ToInt32(Value3); monTables[i].MoveSpeed = (float)Convert.ToDouble(Value4); monTables[i].toCoreDmg = Convert.ToInt32(Value5); monTables[i].Dp = Convert.ToInt32(Value6); } }
private void ParseUpgrade(CSVLoader csvLoader) { for (int i = 0; i < csvLoader.Rows; i++) { csvLoader.ReadValue(0, i, string.Empty, out string Value); csvLoader.ReadValue(1, i, string.Empty, out string Value2); csvLoader.ReadValue(2, i, string.Empty, out string Value3); csvLoader.ReadValue(3, i, string.Empty, out string Value4); csvLoader.ReadValue(4, i, -1, out int Value5); csvLoader.ReadValue(5, i, string.Empty, out string Value6); csvLoader.ReadValue(6, i, -1, out int Value7); csvLoader.ReadValue(7, i, -1, out int Value8); csvLoader.ReadValue(8, i, -1, out int Value9); csvLoader.ReadValue(9, i, string.Empty, out string Value10); csvLoader.ReadValue(10, i, 100, out int Value11); Value.Trim(); Value.ToLower(); Value2.Trim(); Value3.Trim(); Value4.Trim(); Value4.ToLower(); Value6.Trim(); Value6.ToLower(); Value10.Trim(); int ct = TItem.String2Type(Value4); Add(Value, new TUpgrade(Value, Value2, FindIcon(Value3), ct, Value5, Value6, Value7, Value8, Value9, Value10, Value11)); } }
/// <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); } }
public override string GetStringValue() { string t = Value2.ToString("X4").Substring(1, 3); string t2 = _variable.GetStringValue(); return(t2.Substring(0, 1) + t + "." + t2.Substring(1, 1)); }
/// <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) )); }
private void Update(EvaluationContext context) { var a = Value1.GetValue(context); var b = Value2.GetValue(context); Result.Value = a + b; }
public override string GetStringValue() { string t = Value2.ToString("X4"); t = "1" + t.Substring(0, 2) + "." + t.Substring(2, 2); return(t); }
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; } } }
partial void WriteValue2(ESPWriter writer) { if (Value2 != null) { Value2.WriteBinary(writer); } }
private void ParseData(CSVLoader csvLoader) { _dicString = new Dictionary <string, string> [12]; for (int i = 0; i < _dicString.Length; i++) { _dicString[i] = new Dictionary <string, string>(); } for (int j = 0; j < csvLoader.Rows; j++) { csvLoader.ReadValue(0, j, string.Empty, out string Value); Value.Trim(); for (int k = 0; k < 12; k++) { csvLoader.ReadValue(k + 1, j, string.Empty, out string Value2); Value2 = Value2.Trim(); if (Value.Length <= 0) { Debug.LogError("ERROR, Empty key at row:" + j + " Col: " + k + " Key: " + Value + " Value: " + Value2); } if (_dicString[k].ContainsKey(Value)) { Debug.LogError("ERROR, Duplicate string key: " + Value + " at row: " + j + " Col: " + k + " Key: " + Value + " Value: " + Value2); } else { Value2 = Value2.Replace("\\0", "\n"); _dicString[k].Add(Value, Value2); if (displayReadString) { Debug.Log(" Key: " + Value + " Val: " + Value2); } } } } }
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)); }
public bool Evaluate(object column1Value, object column2Value) { var value1 = Column1 == null ? Value1 : column1Value; var value2 = Column2 == null ? Value2 : column2Value; if (Operator == ECompare.IsIn && Value2.GetType().IsArray) { foreach (var value in (IEnumerable)Value2) { var compare = Compare(CompareDataType, value1, value); if (compare == ECompareResult.Equal) { return(true); } } return(false); } if (Operator == ECompare.IsNull) { return(value1 == null || value1 is DBNull); } if (Operator == ECompare.IsNotNull) { return(value1 != null && !(value1 is DBNull)); } var compareResult = Compare(CompareDataType, value1, value2); switch (Operator) { case ECompare.IsEqual: return(compareResult == ECompareResult.Equal); case ECompare.GreaterThan: return(compareResult == ECompareResult.Greater); case ECompare.GreaterThanEqual: return(compareResult == ECompareResult.Greater || compareResult == ECompareResult.Equal); case ECompare.LessThan: return(compareResult == ECompareResult.Less); case ECompare.LessThanEqual: return(compareResult == ECompareResult.Less || compareResult == ECompareResult.Equal); case ECompare.NotEqual: return(compareResult != ECompareResult.Equal); case ECompare.IsIn: return(compareResult == ECompareResult.Equal); default: throw new QueryException($"The {Operator} is not currently supported in the query evaluation."); } }
public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { #region << Init >> var initSuccess = InitFilter(context, output); if (!initSuccess) { return(Task.CompletedTask); } #endregion var inputGroupEl = new TagBuilder("div"); inputGroupEl.AddCssClass("input-group"); inputGroupEl.InnerHtml.AppendHtml(FilterTypeSelect); #region << valueDateControl >> { var valueDateControl = new TagBuilder("input"); valueDateControl.AddCssClass("form-control value"); if (QueryType != FilterType.BETWEEN && QueryType != FilterType.NOTBETWEEN) { valueDateControl.AddCssClass("rounded-right"); } valueDateControl.Attributes.Add("value", (Value != null ? Value.ToString("yyyy-MM-dd") : "")); valueDateControl.Attributes.Add("type", "date"); valueDateControl.Attributes.Add("name", UrlQueryOfValue); inputGroupEl.InnerHtml.AppendHtml(valueDateControl); } #endregion inputGroupEl.InnerHtml.AppendHtml(AndDivider); #region << value2DateControl >> { var value2DateControl = new TagBuilder("input"); value2DateControl.Attributes.Add("value", (Value2 != null ? Value2.ToString("yyyy-MM-dd") : "")); value2DateControl.AddCssClass("form-control value2"); value2DateControl.Attributes.Add("type", "date"); if (QueryType == FilterType.BETWEEN || QueryType == FilterType.NOTBETWEEN) { value2DateControl.Attributes.Add("name", UrlQueryOfValue2); } else { value2DateControl.AddCssClass("d-none"); } inputGroupEl.InnerHtml.AppendHtml(value2DateControl); } #endregion output.Content.AppendHtml(inputGroupEl); return(Task.CompletedTask); }
private void Value2Downbutton_Click(object sender, EventArgs e) { Value2 = Value2 - i; if (Value2 == 60 || Value2 == -1) { Value2 = 0; } Value2textBox.Text = Value2.ToString(); }
public void AddSpaces() { const string Value = "TheBrownFoxIsAwesome.ButTheBlueFoxIsNot.2222"; Assert.Equal("The Brown Fox Is Awesome. But The Blue Fox Is Not.2222", Value.AddSpaces()); const string Value2 = "IBM is an acronym, but IBM doesn't stand for IBM"; Assert.Equal("IBM is an acronym, but IBM doesn't stand for IBM", Value2.AddSpaces()); }
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 override int GetHashCode() { unchecked { var hashCode = Code; hashCode = (hashCode * 397) ^ (Value1 != null ? Value1.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Value2 != null ? Value2.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// Gets the expression that will be used to evaluate this comparison. /// </summary> /// <param name="property">The property.</param> /// <returns>A LINQ Expression that will evaluate this comparison.</returns> public override Expression GetExpression(MemberExpression property) { object value = Value.ToLower(); object value2 = !string.IsNullOrEmpty(Value2) ? Value2.ToLower() : null; if (property.Type != typeof(string)) { value = Convert.ChangeType(value, property.Type); if (value2 != null) { value2 = Convert.ChangeType(value2, property.Type); } } // // Handle processing of Regular Expressions since they are not supported // by the ComparisonHelper. // if (Comparison == Model.ComparisonType.RegularExpression) { Expression valueExpression; if (property.Type.IsGenericType && property.Type.GetGenericTypeDefinition() == typeof(Nullable <>)) { // if Nullable Type compare on the .Value of the property (if it HasValue) valueExpression = Expression.Property(property, "Value"); } else { valueExpression = property; } if (valueExpression.Type == typeof(string)) { var miToLower = typeof(string).GetMethod("ToLower", new Type[] { }); valueExpression = Expression.Call(valueExpression, miToLower); } var methodInfo = typeof(System.Text.RegularExpressions.Regex) .GetMethod("IsMatch", BindingFlags.Static | BindingFlags.Public, null, new[] { typeof(string), typeof(string), typeof(System.Text.RegularExpressions.RegexOptions) }, null); return(Expression.Call(null, methodInfo, valueExpression, Expression.Constant(value), Expression.Constant(System.Text.RegularExpressions.RegexOptions.IgnoreCase))); } if (property.Type == typeof(string)) { var fakeObject = new { Value = Expression.Lambda <Func <string> >(property).Compile()().ToStringSafe().ToLower() }; property = Expression.Property(Expression.Constant(fakeObject), "Value"); } return(Rock.Reporting.ComparisonHelper.ComparisonExpression(Comparison, property, Expression.Constant(value), value2 != null ? Expression.Constant(value2) : null)); }
private void ParseAccessory(CSVLoader csvLoader) { for (int i = 0; i < csvLoader.Rows; i++) { csvLoader.ReadValue(0, i, string.Empty, out string Value); csvLoader.ReadValue(1, i, string.Empty, out string Value2); csvLoader.ReadValue(2, i, string.Empty, out string Value3); csvLoader.ReadValue(3, i, string.Empty, out string Value4); csvLoader.ReadValue(4, i, string.Empty, out string Value5); csvLoader.ReadValue(5, i, string.Empty, out string Value6); csvLoader.ReadValue(6, i, def: true, out bool Value7); csvLoader.ReadValue(7, i, string.Empty, out string Value8); csvLoader.ReadValue(8, i, string.Empty, out string Value9); csvLoader.ReadValue(9, i, string.Empty, out string Value10); csvLoader.ReadValue(10, i, string.Empty, out string Value11); csvLoader.ReadValue(11, i, def: false, out bool Value12); csvLoader.ReadValue(12, i, string.Empty, out string Value13); csvLoader.ReadValue(13, i, string.Empty, out string Value14); csvLoader.ReadValue(14, i, string.Empty, out string Value15); csvLoader.ReadValue(15, i, 0, out int Value16); csvLoader.ReadValue(16, i, 0f, out float Value17); csvLoader.ReadValue(17, i, string.Empty, out string Value18); csvLoader.ReadValue(18, i, string.Empty, out string Value19); csvLoader.ReadValue(19, i, string.Empty, out string Value20); csvLoader.ReadValue(20, i, string.Empty, out string Value21); csvLoader.ReadValue(21, i, string.Empty, out string Value22); csvLoader.ReadValue(22, i, 100, out int Value23); Value.Trim(); Value.ToLower(); Value2.Trim(); Value3.Trim(); Value4.Trim(); Value4.ToLower(); Value5.Trim(); Value5.ToLower(); Value6.Trim(); Value6.ToLower(); Value8.Trim(); Value9.Trim(); Value10.Trim(); Value11.Trim(); Value19.Trim(); Value20.Trim(); Value21.Trim(); Value22.Trim(); Value14 = Value14.Trim(); Value14 = Value14.ToLower(); Value15.Trim(); Value18 = Value18.ToLower(); int num = TItem.String2Type(Value4); int ck = TItem.String2Kind(num, Value5); int upCat = TItem.String2UpgradeCategory(Value18); Add(Value, new TAccessory(Value, Value2, Value9, FindPrefab(Value8), FindIcon(Value3), num, ck, Value7, TItem.String2Slot(Value6), Value10, BuffManager.Instance.Get(Value11), Value12, Value13, TItem.String2FunctionMask(Value14), Value16, Value17, upCat, Convert.ToInt32(Value19), Value20, Value21, Value22, FindIcon(Value15), Value23)); } }
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); }
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()); }
/// <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; }
private void ParseData(CSVLoader csvBuldleItem) { for (int i = 0; i < csvBuldleItem.Rows; i++) { csvBuldleItem.ReadValue(0, i, string.Empty, out string Value); csvBuldleItem.ReadValue(1, i, string.Empty, out string Value2); csvBuldleItem.ReadValue(2, i, 0, out int Value3); csvBuldleItem.ReadValue(3, i, 0, out int _); Value2 = Value2.Trim().ToLower(); Pack(Value, Value2, Value3); } }
public override int GetHashCode() { unchecked { if (HasValue2) { return(Value2.Aggregate(19, (hash, i) => hash * 31 + i.GetHashCode())); } return(base.GetHashCode()); } }
public sealed override T Evaluate(EvalContext context) { if (Value1 != null && Value2 != null && Weight != null) { return(Interpolate(Value1.Evaluate(context), Value2.Evaluate(context), easingCurve.Ease(Weight.Evaluate(context)))); } else { return(default(T)); } }
public override void GCode_GenerateCode(ref string strDefinitionSegment, ref string strSegment, int nLayer, CodeGenerateSystem.Base.LinkPinControl element, CodeGenerateSystem.Base.GenerateCodeContext_Method context) { if (Value1.HasLink) { Value1.GetLinkedObject(0, true).GCode_GenerateCode(ref strDefinitionSegment, ref strSegment, nLayer, element, context); m_strValueName1 = Value1.GetLinkedObject(0, true).GCode_GetValueName(Value1.GetLinkedPinControl(0, true), context); } if (Value2.HasLink) { Value2.GetLinkedObject(0, true).GCode_GenerateCode(ref strDefinitionSegment, ref strSegment, nLayer, element, context); m_strValueName2 = Value2.GetLinkedObject(0, true).GCode_GetValueName(Value2.GetLinkedPinControl(0, true), context); } }
/// <summary> /// Serves as a hash function for a particular type. /// </summary> /// <returns> /// A hash code for the current <see cref="T:System.Object" />. /// </returns> /// <filterpriority>2</filterpriority> public override int GetHashCode() { unchecked { int result = (Column != null ? Column.GetHashCode() : 0); result = (result * 397) ^ (Value != null ? Value.GetHashCode() : 0); result = (result * 397) ^ (Value2 != null ? Value2.GetHashCode() : 0); result = (result * 397) ^ Comparison.GetHashCode(); result = (result * 397) ^ (NextInGroup != null ? NextInGroup.GetHashCode() : 0); result = (result * 397) ^ OrNextPredicate.GetHashCode(); result = (result * 397) ^ OrToPreviousGroup.GetHashCode(); return(result); } }
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(); }