2017-03-05 23:44:37 +01:00
|
|
|
// Copyright © 2010-2017 The CefSharp Authors. All rights reserved.
|
2015-08-03 10:41:29 +10:00
|
|
|
//
|
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
|
|
using System;
|
2015-08-03 11:37:49 +10:00
|
|
|
using System.Diagnostics;
|
2015-07-29 13:39:07 +02:00
|
|
|
using System.Threading;
|
|
|
|
|
|
|
|
|
|
namespace CefSharp.Example
|
|
|
|
|
{
|
2017-03-13 11:37:55 +00:00
|
|
|
public struct JsObject
|
|
|
|
|
{
|
|
|
|
|
public string Value;
|
|
|
|
|
}
|
|
|
|
|
|
2015-07-29 13:39:07 +02:00
|
|
|
public class AsyncBoundObject
|
|
|
|
|
{
|
2015-08-03 11:37:49 +10:00
|
|
|
//We expect an exception here, so tell VS to ignore
|
|
|
|
|
[DebuggerHidden]
|
2015-07-29 13:39:07 +02:00
|
|
|
public void Error()
|
|
|
|
|
{
|
|
|
|
|
throw new Exception("This is an exception coming from C#");
|
|
|
|
|
}
|
|
|
|
|
|
2015-08-03 11:37:49 +10:00
|
|
|
//We expect an exception here, so tell VS to ignore
|
|
|
|
|
[DebuggerHidden]
|
2015-07-29 13:39:07 +02:00
|
|
|
public int Div(int divident, int divisor)
|
|
|
|
|
{
|
|
|
|
|
return divident / divisor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string Hello(string name)
|
|
|
|
|
{
|
|
|
|
|
return "Hello " + name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void DoSomething()
|
|
|
|
|
{
|
|
|
|
|
Thread.Sleep(1000);
|
|
|
|
|
}
|
2017-03-13 11:37:55 +00:00
|
|
|
|
|
|
|
|
public JsObject[] ObjectArray(string name)
|
|
|
|
|
{
|
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
new JsObject() { Value = "Item1" },
|
|
|
|
|
new JsObject() { Value = "Item2" }
|
|
|
|
|
};
|
|
|
|
|
}
|
2015-07-29 13:39:07 +02:00
|
|
|
}
|
|
|
|
|
}
|