瀏覽代碼

Merge branch 'master' of ssh://10.10.100.21/source/mes-client

Hcsy 7 年之前
父節點
當前提交
b875470f02

+ 0 - 1
UAS_Web/Browser.Designer.cs

@@ -39,7 +39,6 @@
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
             this.Name = "Browser";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
-            this.Text = "思拓微-供应商条码打印";
             this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Browser_FormClosing);
             this.Load += new System.EventHandler(this.Browser_Load);

+ 38 - 8
UAS_Web/Browser.cs

@@ -1,31 +1,61 @@
-using CefSharp.WinForms;
-using System;
+using System;
+using System.Diagnostics;
+using System.Runtime.InteropServices;
 using System.Windows.Forms;
+using UAS_Web.tool;
+using CefSharp;
+using CefSharp.WinForms;
 
 namespace UAS_Web
 {
     public partial class Browser : Form
     {
+
+        [DllImport("User32.dll")]
+        public static extern IntPtr GetForegroundWindow();     //获取活动窗口句柄  
+
+        [DllImport("User32.dll", CharSet = CharSet.Auto)]
+        public static extern int GetWindowThreadProcessId(IntPtr hwnd, out int ID);   //获取线程ID  
+
         private ChromiumWebBrowser webBrowser;
 
         public Browser()
         {
             InitializeComponent();
-        }
-
-        private void Browser_Load(object sender, EventArgs e)
-        {
-            string path = "http://stwecig.vicp.io:8099/ERP/jsps/vendbarcode/login.jsp";
+            Text = "思拓微-供应商条码打印";
+            string path = "http://192.168.253.6/uas_dev/jsps/vendbarcode/login.jsp";
             webBrowser = new ChromiumWebBrowser(path)
             {
                 Dock = DockStyle.Fill
             };
+            webBrowser.RegisterJsObject("", new BoundObject(), true);
+            webBrowser.MenuHandler = new MenuHandler();
+            webBrowser.RequestHandler = new RequestHandler();
             Controls.Add(webBrowser);
+            webBrowser.LoadError += WebBrowser_LoadError;
+        }
+
+        private void WebBrowser_LoadError(object sender, LoadErrorEventArgs e)
+        {
+            MessageBox.Show("当前网络无法访问" + e.ErrorText);
         }
 
         private void Browser_FormClosing(object sender, FormClosingEventArgs e)
         {
-            CefSharp.Cef.Shutdown();
+            webBrowser.GetBrowser().CloseBrowser(true);
+            Cef.Shutdown();
+        }
+
+        private void Browser_Load(object sender, EventArgs e)
+        {
+            Process[] pro = Process.GetProcessesByName("UAS_Web");
+            for (int i = 0; i < pro.Length; i++)
+            {
+                if (pro[i].Id != Process.GetCurrentProcess().Id)
+                {
+                    pro[i].Kill();
+                }
+            }
         }
     }
 }

+ 12 - 0
UAS_Web/UAS_Web.csproj

@@ -80,6 +80,10 @@
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\packages\CefSharp.WinForms.49.0.1\CefSharp\x86\CefSharp.WinForms.dll</HintPath>
     </Reference>
+    <Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+      <HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net40\Newtonsoft.Json.dll</HintPath>
+      <Private>True</Private>
+    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core" />
     <Reference Include="System.Xml.Linq" />
@@ -100,6 +104,14 @@
     </Compile>
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="tool\BoundObject.cs" />
+    <Compile Include="tool\ExceptionTestBoundObject.cs" />
+    <Compile Include="tool\FilterManager.cs" />
+    <Compile Include="tool\FormatterConverter.cs" />
+    <Compile Include="tool\MenuHandler.cs" />
+    <Compile Include="tool\MessageFilter.cs" />
+    <Compile Include="tool\RequestHandler.cs" />
+    <Compile Include="tool\SubBoundObject.cs" />
     <EmbeddedResource Include="Browser.resx">
       <DependentUpon>Browser.cs</DependentUpon>
     </EmbeddedResource>

+ 1 - 0
UAS_Web/packages.config

@@ -4,4 +4,5 @@
   <package id="cef.redist.x86" version="3.2623.1401" targetFramework="net40" />
   <package id="CefSharp.Common" version="49.0.1" targetFramework="net40" />
   <package id="CefSharp.WinForms" version="49.0.1" targetFramework="net40" />
+  <package id="Newtonsoft.Json" version="11.0.2" targetFramework="net40" />
 </packages>

+ 355 - 0
UAS_Web/tool/BoundObject.cs

@@ -0,0 +1,355 @@
+using CefSharp;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace UAS_Web.tool
+{
+    class BoundObject
+    {
+        public int MyProperty { get; set; }
+
+        public string MyReadOnlyProperty { get; internal set; }
+        public Type MyUnconvertibleProperty { get; set; }
+        public SubBoundObject SubObject { get; set; }
+        public ExceptionTestBoundObject ExceptionTestObject { get; set; }
+
+        public int this[int i]
+        {
+            get { return i; }
+            set { }
+        }
+
+        public uint[] MyUintArray
+        {
+            get { return new uint[] { 7, 8 }; }
+        }
+
+        public int[] MyIntArray
+        {
+            get { return new[] { 1, 2, 3, 4, 5, 6, 7, 8 }; }
+        }
+
+        public Array MyArray
+        {
+            get { return new short[] { 1, 2, 3 }; }
+        }
+
+        public byte[] MyBytes
+        {
+            get { return new byte[] { 3, 4, 5 }; }
+        }
+
+        public BoundObject()
+        {
+            MyProperty = 42;
+            MyReadOnlyProperty = "I'm immutable!";
+            IgnoredProperty = "I am an Ignored Property";
+            MyUnconvertibleProperty = GetType();
+            SubObject = new SubBoundObject();
+            ExceptionTestObject = new ExceptionTestBoundObject();
+        }
+
+        public void TestCallback(IJavascriptCallback javascriptCallback)
+        {
+            //Task.Factory.StartNew(async () =>
+            //{
+            //    using (javascriptCallback)
+            //    {
+            //        //Computer computer = new Computer();
+            //        string response = JsonConvert.SerializeObject(new
+            //        {
+            //            //cpu_id = computer.CPU_Id,
+            //            //disk_id = computer.Disk_Id,
+            //            //host_name = computer.HostName,
+            //            //networkcard = computer.NetworkCard,
+            //            //serialNumber = computer.SerialNumber_Manufacturer_Product.Item1,
+            //            //manufacturer = computer.SerialNumber_Manufacturer_Product.Item2,
+            //            //product = computer.SerialNumber_Manufacturer_Product.Item3,
+            //        });
+            //        //await javascriptCallback.ExecuteAsync(null);
+            //    }
+            //});
+            //const int taskDelay = 1500;
+            //Task.Factory.StartNew(async () =>
+            //{
+            //    await TaskEx.Delay(taskDelay);
+
+            //    using (javascriptCallback)
+            //    {
+            //        //NOTE: Classes are not supported, simple structs are
+            //        var response = new CallbackResponseStruct("This callback from C# was delayed " + taskDelay + "ms");
+            //        await javascriptCallback.ExecuteAsync(response);
+            //    }
+            //});
+        }
+
+        //public string TestCallbackFromObject(SimpleClass simpleClass)
+        //{
+        //    if (simpleClass == null)
+        //    {
+        //        return "TestCallbackFromObject dictionary param is null";
+        //    }
+
+        //    IJavascriptCallback javascriptCallback = simpleClass.Callback;
+
+        //    if (javascriptCallback == null)
+        //    {
+        //        return "callback property not found or property is not a function";
+        //    }
+
+        //    const int taskDelay = 1500;
+
+        //    TaskEx.Run(async () =>
+        //    {
+        //        await TaskEx.Delay(taskDelay);
+
+        //        if (javascriptCallback != null)
+        //        {
+        //            using (javascriptCallback)
+        //            {
+        //                await javascriptCallback.ExecuteAsync("message from C# " + simpleClass.TestString + " - " + simpleClass.SubClasses[0].PropertyOne);
+        //            }
+        //        }
+        //    });
+
+        //    return "waiting for callback execution...";
+        //}
+
+        public int EchoMyProperty()
+        {
+            return MyProperty;
+        }
+
+        public string Repeat(string str, int n)
+        {
+            string result = String.Empty;
+            for (int i = 0; i < n; i++)
+            {
+                result += str;
+            }
+            return result;
+        }
+
+        public string EchoParamOrDefault(string param = "This is the default value")
+        {
+            return param;
+        }
+
+        public void EchoVoid()
+        {
+        }
+
+        public Boolean EchoBoolean(Boolean arg0)
+        {
+            return arg0;
+        }
+
+        public Boolean? EchoNullableBoolean(Boolean? arg0)
+        {
+            return arg0;
+        }
+
+        public SByte EchoSByte(SByte arg0)
+        {
+            return arg0;
+        }
+
+        public SByte? EchoNullableSByte(SByte? arg0)
+        {
+            return arg0;
+        }
+
+        public Int16 EchoInt16(Int16 arg0)
+        {
+            return arg0;
+        }
+
+        public Int16? EchoNullableInt16(Int16? arg0)
+        {
+            return arg0;
+        }
+
+        public Int32 EchoInt32(Int32 arg0)
+        {
+            return arg0;
+        }
+
+        public Int32? EchoNullableInt32(Int32? arg0)
+        {
+            return arg0;
+        }
+
+        public Int64 EchoInt64(Int64 arg0)
+        {
+            return arg0;
+        }
+
+        public Int64? EchoNullableInt64(Int64? arg0)
+        {
+            return arg0;
+        }
+
+        public Byte EchoByte(Byte arg0)
+        {
+            return arg0;
+        }
+
+        public Byte? EchoNullableByte(Byte? arg0)
+        {
+            return arg0;
+        }
+
+        public UInt16 EchoUInt16(UInt16 arg0)
+        {
+            return arg0;
+        }
+
+        public UInt16? EchoNullableUInt16(UInt16? arg0)
+        {
+            return arg0;
+        }
+
+        public UInt32 EchoUInt32(UInt32 arg0)
+        {
+            return arg0;
+        }
+
+        public UInt32? EchoNullableUInt32(UInt32? arg0)
+        {
+            return arg0;
+        }
+
+        public UInt64 EchoUInt64(UInt64 arg0)
+        {
+            return arg0;
+        }
+
+        public UInt64? EchoNullableUInt64(UInt64? arg0)
+        {
+            return arg0;
+        }
+
+        public Single EchoSingle(Single arg0)
+        {
+            return arg0;
+        }
+
+        public Single? EchoNullableSingle(Single? arg0)
+        {
+            return arg0;
+        }
+
+        public Double EchoDouble(Double arg0)
+        {
+            return arg0;
+        }
+
+        public Double? EchoNullableDouble(Double? arg0)
+        {
+            return arg0;
+        }
+
+        public Char EchoChar(Char arg0)
+        {
+            return arg0;
+        }
+
+        public Char? EchoNullableChar(Char? arg0)
+        {
+            return arg0;
+        }
+
+        public DateTime EchoDateTime(DateTime arg0)
+        {
+            return arg0;
+        }
+
+        public DateTime? EchoNullableDateTime(DateTime? arg0)
+        {
+            return arg0;
+        }
+
+        public Decimal EchoDecimal(Decimal arg0)
+        {
+            return arg0;
+        }
+
+        public Decimal? EchoNullableDecimal(Decimal? arg0)
+        {
+            return arg0;
+        }
+
+        public String EchoString(String arg0)
+        {
+            return arg0;
+        }
+
+        // TODO: This will currently not work, as it causes a collision w/ the EchoString() method. We need to find a way around that I guess.
+        //public String echoString(String arg)
+        //{
+        //    return "Lowercase echo: " + arg;
+        //}
+
+        public String lowercaseMethod()
+        {
+            return "lowercase";
+        }
+
+        public string ReturnJsonEmployeeList()
+        {
+            return "{\"employees\":[{\"firstName\":\"John\", \"lastName\":\"Doe\"},{\"firstName\":\"Anna\", \"lastName\":\"Smith\"},{\"firstName\":\"Peter\", \"lastName\":\"Jones\"}]}";
+        }
+
+        [JavascriptIgnore]
+        public string IgnoredProperty { get; set; }
+
+        [JavascriptIgnore]
+        public string IgnoredMethod()
+        {
+            return "I am an Ignored Method";
+        }
+
+        public string ComplexParamObject(object param)
+        {
+            if (param == null)
+            {
+                return "param is null";
+            }
+            return "The param type is:" + param.GetType();
+        }
+
+        public SubBoundObject GetSubObject()
+        {
+            return SubObject;
+        }
+
+        /// <summary>
+        /// Demonstrates the use of params as an argument in a bound object
+        /// </summary>
+        /// <param name="name">Dummy Argument</param>
+        /// <param name="args">Params Argument</param>
+        public string MethodWithParams(string name, params object[] args)
+        {
+            return "Name:" + name + ";Args:" + string.Join(", ", args.ToArray());
+        }
+
+        public string MethodWithoutParams(string name, string arg2)
+        {
+            return string.Format("{0}, {1}", name, arg2);
+        }
+
+        public string MethodWithoutAnything()
+        {
+            return "Method without anything called and returned successfully.";
+        }
+
+        public string MethodWithThreeParamsOneOptionalOneArray(string name, string optionalParam = null, params object[] args)
+        {
+            return "MethodWithThreeParamsOneOptionalOneArray:" + (name ?? "No Name Specified") + " - " + (optionalParam ?? "No Optional Param Specified") + ";Args:" + string.Join(", ", args.ToArray());
+        }
+    }
+}

+ 70 - 0
UAS_Web/tool/ExceptionTestBoundObject.cs

@@ -0,0 +1,70 @@
+using CefSharp;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace UAS_Web.tool
+{
+    class ExceptionTestBoundObject
+    {
+        [DebuggerStepThrough]
+        private double DivisionByZero(int zero)
+        {
+            return 10 / zero;
+        }
+
+        [DebuggerStepThrough]
+        public double TriggerNestedExceptions()
+        {
+            try
+            {
+                try
+                {
+                    return DivisionByZero(0);
+                }
+                catch (Exception innerException)
+                {
+                    throw new InvalidOperationException("Nested Exception Invalid", innerException);
+                }
+            }
+            catch (Exception e)
+            {
+                throw new OperationCanceledException("Nested Exception Canceled", e);
+            }
+        }
+
+        [DebuggerStepThrough]
+        public int TriggerParameterException(int parameter)
+        {
+            return parameter;
+        }
+
+        public void TestCallbackException(IJavascriptCallback errorCallback, IJavascriptCallback errorCallbackResult)
+        {
+            const int taskDelay = 500;
+
+            //Task.Run(async () =>
+            //{
+            //    await TaskEx.Delay(taskDelay);
+
+            //    using (errorCallback)
+            //    {
+            //        JavascriptResponse result = await errorCallback.ExecuteAsync("This callback from C# was delayed " + taskDelay + "ms");
+            //        string resultMessage;
+            //        if (result.Success)
+            //        {
+            //            resultMessage = "Fatal: No Exception thrown in error callback";
+            //        }
+            //        else
+            //        {
+            //            resultMessage = "Exception Thrown: " + result.Message;
+            //        }
+            //        await errorCallbackResult.ExecuteAsync(resultMessage);
+            //    }
+            //});
+        }
+    }
+}

+ 28 - 0
UAS_Web/tool/FilterManager.cs

@@ -0,0 +1,28 @@
+using CefSharp;
+using System.Collections.Generic;
+
+namespace UAS_Web.tool
+{
+    class FilterManager
+    {
+        public static Dictionary<string, IResponseFilter> dataList = new Dictionary<string, IResponseFilter>();
+
+        public static IResponseFilter CreateFilter(string guid)
+        {
+            lock (dataList)
+            {
+                var filter = new MessageFilter();
+                dataList.Add(guid, filter);
+                return filter;
+            }
+        }
+
+        public static IResponseFilter GetFileter(string guid)
+        {
+            lock (dataList)
+            {
+                return dataList[guid];
+            }
+        }
+    }
+}

+ 93 - 0
UAS_Web/tool/FormatterConverter.cs

@@ -0,0 +1,93 @@
+using System;
+using System.Runtime.Serialization;
+
+namespace UAS_Web.tool
+{
+    class FormatterConverter : IFormatterConverter
+    {
+        public object Convert(object value, TypeCode typeCode)
+        {
+            return value;
+        }
+
+        public object Convert(object value, Type type)
+        {
+            throw new NotImplementedException();
+        }
+
+        public bool ToBoolean(object value)
+        {
+            throw new NotImplementedException();
+        }
+
+        public byte ToByte(object value)
+        {
+            throw new NotImplementedException();
+        }
+
+        public char ToChar(object value)
+        {
+            throw new NotImplementedException();
+        }
+
+        public DateTime ToDateTime(object value)
+        {
+            throw new NotImplementedException();
+        }
+
+        public decimal ToDecimal(object value)
+        {
+            throw new NotImplementedException();
+        }
+
+        public double ToDouble(object value)
+        {
+            throw new NotImplementedException();
+        }
+
+        public short ToInt16(object value)
+        {
+            throw new NotImplementedException();
+        }
+
+        public int ToInt32(object value)
+        {
+            throw new NotImplementedException();
+        }
+
+        public long ToInt64(object value)
+        {
+            throw new NotImplementedException();
+        }
+
+        public sbyte ToSByte(object value)
+        {
+            throw new NotImplementedException();
+        }
+
+        public float ToSingle(object value)
+        {
+            throw new NotImplementedException();
+        }
+
+        public string ToString(object value)
+        {
+            throw new NotImplementedException();
+        }
+
+        public ushort ToUInt16(object value)
+        {
+            throw new NotImplementedException();
+        }
+
+        public uint ToUInt32(object value)
+        {
+            throw new NotImplementedException();
+        }
+
+        public ulong ToUInt64(object value)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 31 - 0
UAS_Web/tool/MenuHandler.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using CefSharp;
+
+namespace UAS_Web.tool
+{
+    class MenuHandler : IContextMenuHandler
+    {
+        public void OnBeforeContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model)
+        {
+            model.Clear();
+        }
+
+        public bool OnContextMenuCommand(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, CefMenuCommand commandId, CefEventFlags eventFlags)
+        {
+            return false;
+        }
+
+        public void OnContextMenuDismissed(IWebBrowser browserControl, IBrowser browser, IFrame frame)
+        {
+            //throw new NotImplementedException();
+        }
+
+        public bool RunContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model, IRunContextMenuCallback callback)
+        {
+            return false;
+        }
+    }
+}

+ 60 - 0
UAS_Web/tool/MessageFilter.cs

@@ -0,0 +1,60 @@
+using CefSharp;
+using System;
+using System.Collections.Generic;
+using System.IO;
+
+namespace UAS_Web.tool
+{
+    class MessageFilter : IResponseFilter
+    {
+        public event Action<byte[]> NotifyData;
+        private int contentLength = 0;
+        public List<byte> dataAll = new List<byte>();
+
+        public void SetContentLength(int contentLength)
+        {
+            this.contentLength = contentLength;
+        }
+
+        public void Dispose()
+        {
+
+        }
+
+        public FilterStatus Filter(Stream dataIn, out long dataInRead, Stream dataOut, out long dataOutWritten)
+        {
+            try
+            {
+                if (dataIn == null || dataIn.Length == 0)
+                {
+                    dataInRead = 0;
+                    dataOutWritten = 0;
+
+                    return FilterStatus.Done;
+                }
+                dataInRead = dataIn.Length;
+                dataOutWritten = Math.Min(dataInRead, dataOut.Length);
+                dataIn.CopyTo(dataOut);
+                dataIn.Seek(0, SeekOrigin.Begin);
+                byte[] bs = new byte[dataIn.Length];
+                dataIn.Read(bs, 0, bs.Length);
+                dataAll.AddRange(bs);
+
+                dataInRead = dataIn.Length;
+                dataOutWritten = dataIn.Length;
+                return FilterStatus.NeedMoreData;
+            }
+            catch (Exception )
+            {
+                dataInRead = dataIn.Length;
+                dataOutWritten = dataIn.Length;
+                return FilterStatus.Done;
+            }
+        }
+
+        public bool InitFilter()
+        {
+            return true;
+        }
+    }
+}

+ 115 - 0
UAS_Web/tool/RequestHandler.cs

@@ -0,0 +1,115 @@
+using CefSharp;
+using System;
+using System.IO;
+using System.Runtime.Serialization;
+using System.Windows.Forms;
+
+namespace UAS_Web.tool
+{
+    class RequestHandler : IRequestHandler
+    {
+        public event Action<byte[]> NotifyMsg;
+        IResponseFilter IRequestHandler.GetResourceResponseFilter(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response)
+        {
+            var url = new Uri(request.Url);
+            if (url.AbsoluteUri.Contains("action"))
+            {
+                Console.WriteLine(request.Url);
+                var filter = FilterManager.CreateFilter(request.Identifier.ToString()) as MessageFilter;
+                string str = System.Text.Encoding.UTF8.GetString(filter.dataAll.ToArray());
+                Console.WriteLine("Response" + str);
+                return filter;
+            }
+            return null;
+        }
+
+        void filter_NotifyData(byte[] data)
+        {
+            if (NotifyMsg != null)
+            {
+                NotifyMsg(data);
+            }
+        }
+
+        void IRequestHandler.OnResourceLoadComplete(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response, UrlRequestStatus status, long receivedContentLength)
+        {
+            if (request.Url.Contains("action"))
+            {
+                Console.WriteLine(request.Url);
+                var filter = FilterManager.GetFileter(request.Identifier.ToString()) as MessageFilter;
+                string str = System.Text.Encoding.UTF8.GetString(filter.dataAll.ToArray());
+                Console.WriteLine("Request" + str);
+                filter_NotifyData(filter.dataAll.ToArray());
+            }
+        }
+
+        public bool GetAuthCredentials(IWebBrowser browserControl, IBrowser browser, IFrame frame, bool isProxy, string host, int port, string realm, string scheme, IAuthCallback callback)
+        {
+            return false;
+        }
+
+        public bool OnBeforeBrowse(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, bool isRedirect)
+        {
+            return false;
+        }
+
+        public CefReturnValue OnBeforeResourceLoad(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IRequestCallback callback)
+        {
+            return CefReturnValue.Continue;
+        }
+
+        public bool OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback)
+        {
+            return false;
+        }
+
+        public bool OnOpenUrlFromTab(IWebBrowser browserControl, IBrowser browser, IFrame frame, string targetUrl, WindowOpenDisposition targetDisposition, bool userGesture)
+        {
+            return false;
+        }
+
+        public void OnPluginCrashed(IWebBrowser browserControl, IBrowser browser, string pluginPath)
+        {
+
+        }
+
+        public bool OnProtocolExecution(IWebBrowser browserControl, IBrowser browser, string url)
+        {
+            return false;
+        }
+
+        public bool OnQuotaRequest(IWebBrowser browserControl, IBrowser browser, string originUrl, long newSize, IRequestCallback callback)
+        {
+            return false;
+        }
+
+        public void OnRenderProcessTerminated(IWebBrowser browserControl, IBrowser browser, CefTerminationStatus status)
+        {
+        }
+
+        public void OnRenderViewReady(IWebBrowser browserControl, IBrowser browser)
+        {
+
+        }
+
+        public void OnResourceLoadComplete(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response, UrlRequestStatus status, long receivedContentLength)
+        {
+
+        }
+
+        public void OnResourceRedirect(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, ref string newUrl)
+        {
+            //Console.WriteLine("OnResourceRedirect");
+        }
+
+        bool IRequestHandler.OnResourceResponse(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response)
+        {
+            return false;
+        }
+
+        public void GetData()
+        {
+
+        }
+    }
+}

+ 27 - 0
UAS_Web/tool/SubBoundObject.cs

@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace UAS_Web.tool
+{
+    class SubBoundObject
+    {
+        public string SimpleProperty { get; set; }
+
+        public SubBoundObject()
+        {
+            SimpleProperty = "This is a very simple property.";
+        }
+
+        public string GetMyType()
+        {
+            return "My Type is " + GetType();
+        }
+
+        public string EchoSimpleProperty()
+        {
+            return SimpleProperty;
+        }
+    }
+}