public void Toggle(hello a) { StringBuilder sb = new StringBuilder(); sb.AppendLine("toggleVideo();"); var task = browser.EvaluateScriptAsync(sb.ToString()); task.ContinueWith(t => { if (!t.IsFaulted) { var response = t.Result; if (response.Success == true) { var state = response.Result.ToString(); if (state == "stop") { t2.Abort(); a(false); } else { t2 = new Thread(ts2); t2.Start(); a(true); } } } }, TaskScheduler.FromCurrentSynchronizationContext()); }
// GET: AddNumbers public ActionResult Index1(int a, int b) { hello g = new hello(); g.helloo = a + b; g.MyProperty = a * b; return(View(g)); }
static void Main() { hello h = new hello(); string name = "Ashok"; string name2; Console.WriteLine("pure value: " + name); h.method1(name); Console.WriteLine("value type: " + name); h.method2(ref name); //we write name variable here because it has value assigned Console.WriteLine("ref type: " + name); h.method3(out name2); //we write name2 here because it doesnot has value assigned although we can use both name and name2 Console.WriteLine("out type: " + name2); Console.ReadLine(); }
public void Read(TProtocol iprot) { iprot.IncrementRecursionDepth(); try { TField field; iprot.ReadStructBegin(); while (true) { field = iprot.ReadFieldBegin(); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 0: if (field.Type == TType.Struct) { Success = new hello(); Success.Read(iprot); } else { TProtocolUtil.Skip(iprot, field.Type); } break; default: TProtocolUtil.Skip(iprot, field.Type); break; } iprot.ReadFieldEnd(); } iprot.ReadStructEnd(); } finally { iprot.DecrementRecursionDepth(); } }
protected void Page_Load(object sender, EventArgs e) { del myDel = x => x * x; int j = myDel(5); com delCom = (string x, int y) => x.Length > y; bool isOk = delCom("123", 6); com1 delCom1 = () => 3 > 2; bool isOk1 = delCom1(); write1 delWrite1 = (string fg) => { string s = fg; string a = "欢迎 " + s; return(a); }; string re = delWrite1("aaa"); hello delHello = new hello(hello2); delHello += hello1; string bb = GetHello("liut", delHello); GetFunk(); }
static void testDynamic(hello h) { h.writeDynamic(); }
static void Main(string[] args) { hello man = new hello(neww.sum); man.Invoke(22, 33); }
private string GetHello(string name, hello delHello) { return(delHello(name)); }