protected static IEnumerator <object> ExecuteTask(Future <QueryDataReader> fReader) { yield return(fReader); using (var reader = fReader.Result) { Func <bool> moveNext = () => reader.Reader.Read(); var nv = new NextValue(reader.Reader); while (true) { var f = Future.RunInThread(moveNext); yield return(f); if (f.Result == false) { break; } else { yield return(nv); } } } }
protected override void afterPopulateProps() { if (CswTools.IsPrimaryKey(RelationalId)) { NextValue.SetOnBeforeRender(delegate(CswNbtNodeProp prop) { NextValue.Text = getCurrent(); }); } } //afterPopulateProps()
// 求 x*x-a=0; static double Newton(double a, NextValue next) { double x1 = 1.0; double x2 = next(x1, a); while (Math.Abs(x2 - x1) > 1e-6) { x1 = x2; x2 = next(x1, a); } return(x2); }
private static void IncrementLogin(char[] login, int position) { if (position < 0 || position >= login.Length) { return; } NextValue result = IncrementValue(login[position]); login[position] = result.value; if (result.isReset) { IncrementLogin(login, position - 1); } else { logins.Add(new String(login)); } }
public void writeXml(XmlWriter writer) { writer.WriteElementString("Type", RuleType.ToString()); writer.WriteElementString("Values", String.Join("<~>", Values.ToArray())); writer.WriteElementString("NextValue", NextValue.ToString()); }
private void Compile() { m_continue = Continue.Compile(); m_next = NextValue.Compile(); }