示例#1
0
 private CfrV8Value CreateV8Value(object value)
 {
     if (value is bool)
     {
         return(CfrV8Value.CreateBool((bool)value));
     }
     else if (value is DateTime)
     {
         return(CfrV8Value.CreateDate(CfrTime.FromUniversalTime((DateTime)value)));
     }
     else if (value is double)
     {
         return(CfrV8Value.CreateDouble((double)value));
     }
     else if (value is int)
     {
         return(CfrV8Value.CreateInt((int)value));
     }
     else if (value is uint)
     {
         return(CfrV8Value.CreateUint((uint)value));
     }
     else if (value is string)
     {
         return(CfrV8Value.CreateString((string)value));
     }
     else if (value == null)
     {
         return(CfrV8Value.CreateUndefined());
     }
     else
     {
         throw new ArgumentException($"Type \"{ value.GetType().Name }\" is not supported.");
     }
 }
示例#2
0
        private void NewFile(object sender, Chromium.Remote.Event.CfrV8HandlerExecuteEventArgs e)
        {
            //新建文档的逻辑与保存文档的逻辑相似,这里就不再阐述

            var contents = e.Arguments.FirstOrDefault(p => p.IsString);
            var result   = false;

            result = MainFrame.NewFile(contents.StringValue);

            e.SetReturnValue(CfrV8Value.CreateBool(result));
        }
示例#3
0
        private static CfrV8Value ClrToV8Value(object clrValue)
        {
            var type = clrValue.GetType();

            var typeCode = Type.GetTypeCode(type);

            CfrV8Value value = null;


            switch (typeCode)
            {
            case TypeCode.Boolean:
                value = CfrV8Value.CreateBool((bool)clrValue);
                break;

            case TypeCode.Int16:
            case TypeCode.Int32:
            case TypeCode.Int64:
                value = CfrV8Value.CreateInt((int)clrValue);

                break;

            case TypeCode.SByte:
            case TypeCode.Byte:
            case TypeCode.UInt16:
            case TypeCode.UInt32:
            case TypeCode.UInt64:
                value = CfrV8Value.CreateUint((uint)clrValue);

                break;

            case TypeCode.Single:
            case TypeCode.Double:
                value = CfrV8Value.CreateDouble((double)clrValue);

                break;

            case TypeCode.Decimal:
                value = CfrV8Value.CreateDouble((double)Convert.ChangeType(clrValue, TypeCode.Double));
                break;

            case TypeCode.DateTime:
                value = CfrV8Value.CreateDate(CfrTime.FromUniversalTime((DateTime)clrValue));
                break;

            case TypeCode.Char:
            case TypeCode.String:
                value = CfrV8Value.CreateString((string)clrValue);
                break;
            }

            return(value);
        }
示例#4
0
        public Form1() : base("http://tools.greycloud.com/www/new.html")
        {
            //加载配置信息
            ci = JsonConvert.DeserializeObject <c_info>(info);
            ct = JsonConvert.DeserializeObject <C_Tools>(tools);

            InitializeComponent();

            //绑定事件
            LoadHandler.OnLoadStart += LoadHandler_OnLoadStart;
            DragHandler.OnDragEnter += DragHandler_OnDragEnter;
            LoadHandler.OnLoadEnd   += LoadHandler_OnLoadEnd;

            //greyTools_api
            var greyTools_api = GlobalObject.AddObject("greyTools_api");
            var setColor      = greyTools_api.AddFunction("setColor");

            setColor.Execute += (func, args) =>
            {
                var stringArgument = args.Arguments.FirstOrDefault(p => p.IsString);
                if (stringArgument != null)
                {
                    this.BorderColor = System.Drawing.ColorTranslator.FromHtml(stringArgument.StringValue);
                }
            };

            //windowsApi
            var windows_api = GlobalObject.AddObject("windows_api");
            var openWeb     = windows_api.AddFunction("openWeb");

            openWeb.Execute += (func, args) =>
            {
                var stringArgument = args.Arguments.FirstOrDefault(p => p.IsString);
                if (stringArgument != null)
                {
                    System.Diagnostics.Process.Start(stringArgument.StringValue);
                }
            };

            //Tools管理器
            ToolsManager = GlobalObject.AddObject("ToolsManager");
            var runTools = ToolsManager.AddFunction("runTools");

            runTools.Execute += (func, args) =>
            {
                var stringArgument = args.Arguments.FirstOrDefault(p => p.IsString);
                if (stringArgument != null)
                {
                    bool result = this.runTools(stringArgument.StringValue);
                    args.SetReturnValue(CfrV8Value.CreateBool(result));
                }
            };
        }
示例#5
0
        private void JsCodeEditorObject_ExecuteSave(object sender, Chromium.Remote.Event.CfrV8HandlerExecuteEventArgs e)
        {
            var result = parentForm.SaveFile();

            e.SetReturnValue(CfrV8Value.CreateBool(result));
        }
示例#6
0
        private void FormV8Handler_Execute(object sender, Chromium.Remote.Event.CfrV8HandlerExecuteEventArgs e)
        {
            switch (e.Name)
            {
            case "Minimize":
            {
                HostForm.RequireUIThread(() =>
                    {
                        if (HostForm.WindowState == FormWindowState.Minimized)
                        {
                            HostForm.WindowState = FormWindowState.Normal;
                        }
                        else
                        {
                            HostForm.WindowState = FormWindowState.Minimized;
                        }
                    });
            }
            break;

            case "Maximize":
            {
                HostForm.RequireUIThread(() =>
                    {
                        if (HostForm.WindowState == FormWindowState.Maximized)
                        {
                            HostForm.WindowState = FormWindowState.Normal;
                        }
                        else
                        {
                            HostForm.WindowState = FormWindowState.Maximized;
                        }
                    });
            }
            break;

            case "Restore":
            {
                HostForm.RequireUIThread(() =>
                    {
                        HostForm.WindowState = FormWindowState.Normal;
                    });
            }
            break;

            case "Close":
            {
                if (HostForm != null && !HostForm.IsDisposed)
                {
                    HostForm.RequireUIThread(() =>
                        {
                            HostForm.Close();
                        });
                }
            }
            break;

            case "GetWinActivated":
            {
                if (HostForm != null && !HostForm.IsDisposed)
                {
                    e.SetReturnValue(CfrV8Value.CreateBool(Form.ActiveForm == HostForm));
                }
            }
            break;

            case "GetWinState":
            {
                if (HostForm != null && !HostForm.IsDisposed)
                {
                    var obj          = CfrV8Value.CreateObject(new CfrV8Accessor());
                    var stateString  = "normal";
                    var currentState = 0;

                    if (HostForm.WindowState == FormWindowState.Maximized)
                    {
                        currentState = 2;
                        stateString  = "maximized";
                    }
                    else if (HostForm.WindowState == FormWindowState.Minimized)
                    {
                        currentState = 1;
                        stateString  = "minimized";
                    }

                    obj.SetValue("state", CfrV8Value.CreateInt(currentState), Chromium.CfxV8PropertyAttribute.ReadOnly | Chromium.CfxV8PropertyAttribute.DontDelete);
                    obj.SetValue("stateName", CfrV8Value.CreateString(stateString), Chromium.CfxV8PropertyAttribute.ReadOnly | Chromium.CfxV8PropertyAttribute.DontDelete);
                    obj.SetValue("width", CfrV8Value.CreateInt(HostForm.ClientSize.Width), Chromium.CfxV8PropertyAttribute.ReadOnly | Chromium.CfxV8PropertyAttribute.DontDelete);
                    obj.SetValue("height", CfrV8Value.CreateInt(HostForm.ClientSize.Height), Chromium.CfxV8PropertyAttribute.ReadOnly | Chromium.CfxV8PropertyAttribute.DontDelete);

                    e.SetReturnValue(obj);
                }
            }
            break;
            }
        }
示例#7
0
 public IJavascriptObject CreateBool(bool value)
 {
     return(CfrV8Value.CreateBool(value).Convert());
 }
        public static CfrV8Value V8Serialize(this object o, HashSet <object> refin = null)
        {
            if (Accessor == null)
            {
                Accessor = new CfrV8Accessor();
            }
            var propattr = CfxV8PropertyAttribute.DontDelete | CfxV8PropertyAttribute.ReadOnly;

            switch (o)
            {
            case null:
                return(CfrV8Value.CreateNull());

            case bool onb:
                return(CfrV8Value.CreateBool(onb));

            case string os:
                return(CfrV8Value.CreateString(os));

            case Enum oenum:
                return(CfrV8Value.CreateString(oenum.ToString()));

            case int oni:
                return(CfrV8Value.CreateInt(oni));

            case sbyte oni:
                return(CfrV8Value.CreateInt(oni));

            case short oni:
                return(CfrV8Value.CreateInt(oni));

            case long oni:
                return(CfrV8Value.CreateInt((int)oni));

            case uint onui:
                return(CfrV8Value.CreateUint(onui));

            case byte onui:
                return(CfrV8Value.CreateUint(onui));

            case ushort onui:
                return(CfrV8Value.CreateUint(onui));

            case double ond:
                return(CfrV8Value.CreateDouble(ond));

            case float onf:
                return(CfrV8Value.CreateDouble(onf));

            case ObjectBuilder oob:
                return(oob.Serialize(refin));

            case RGBAColor ocv:
                var vcolres = CfrV8Value.CreateObject(Accessor);
                vcolres.SetValue("r", CfrV8Value.CreateInt(ocv.Color.R), propattr);
                vcolres.SetValue("g", CfrV8Value.CreateInt(ocv.Color.G), propattr);
                vcolres.SetValue("b", CfrV8Value.CreateInt(ocv.Color.B), propattr);
                vcolres.SetValue("a", CfrV8Value.CreateDouble(ocv.A), propattr);
                vcolres.SetValue("name", CfrV8Value.CreateString("#" + ocv.Color.Name.Remove(0, 2)), propattr);
                return(vcolres);

            case Color4 ocdx:
                var dxcolres = CfrV8Value.CreateObject(Accessor);
                dxcolres.SetValue("r", CfrV8Value.CreateDouble(ocdx.Red * 255), propattr);
                dxcolres.SetValue("g", CfrV8Value.CreateDouble(ocdx.Green * 255), propattr);
                dxcolres.SetValue("b", CfrV8Value.CreateDouble(ocdx.Blue * 255), propattr);
                dxcolres.SetValue("a", CfrV8Value.CreateDouble(ocdx.Alpha), propattr);
                dxcolres.SetValue("name", CfrV8Value.CreateString(ocdx.ToString()), propattr);
                return(dxcolres);

            case TimeSpan ots:
                return(CfrV8Value.CreateDate(new CfrTime()
                {
                    Year = 0,
                    Month = 0,
                    DayOfMonth = ots.Days,
                    DayOfWeek = ots.Days,
                    Hour = ots.Hours,
                    Minute = ots.Minutes,
                    Second = ots.Seconds,
                    Millisecond = ots.Milliseconds
                }));

            case DateTime odt:
                return(CfrV8Value.CreateDate(new CfrTime()
                {
                    Year = odt.Year,
                    Month = odt.Month,
                    DayOfMonth = odt.Day,
                    DayOfWeek = (int)odt.DayOfWeek,
                    Hour = odt.Hour,
                    Minute = odt.Minute,
                    Second = odt.Second,
                    Millisecond = odt.Millisecond
                }));

            case IEnumerable oenum:
                lock (oenum)
                {
                    var reslist = (from object obj in oenum select obj.V8Serialize()).ToList();
                    var res     = CfrV8Value.CreateArray(reslist.Count);
                    for (int i = 0; i < reslist.Count; i++)
                    {
                        res.SetValue(i, reslist[i]);
                    }
                    return(res);
                }

            default:
                var referenced = refin;
                if (referenced != null && referenced.Contains(o))
                {
                    return(CfrV8Value.CreateNull());
                }
                else if (referenced == null)
                {
                    referenced = new HashSet <object> {
                        o
                    };
                }
                else
                {
                    referenced.Add(o);
                }

                var oT = o.GetType();
                if (oT.IsClass || (oT.IsValueType && !oT.IsPrimitive))
                {
                    var reso = CfrV8Value.CreateObject(Accessor);
                    foreach (var prop in oT.GetProperties().Where(p =>
                                                                  p.CanRead &&
                                                                  p.GetMethod.IsPublic &&
                                                                  !p.GetMethod.IsStatic &&
                                                                  !p.PropertyType.IsPointer)
                             )
                    {
                        var cobj = prop.GetValue(o).V8Serialize(referenced);
                        reso.SetValue(prop.Name, cobj, propattr);
                    }
                    foreach (var field in oT.GetFields().Where(f =>
                                                               f.IsPublic &&
                                                               !f.IsStatic &&
                                                               !f.FieldType.IsPointer)
                             )
                    {
                        var cobj = field.GetValue(o).V8Serialize(referenced);
                        reso.SetValue(field.Name, cobj, propattr);
                    }
                    return(reso);
                }
                else
                {
                    return(CfrV8Value.CreateNull());
                }
            }
        }
示例#9
0
        public IJavascriptObject CreateObject(bool readOnly)
        {
            var id = GetNextId();

            return(_ObjectBuilder.Value.ExecuteFunction(null, new[] { CfrV8Value.CreateInt((int)id), CfrV8Value.CreateBool(readOnly) }).ConvertObject(id));
        }
示例#10
0
        public Form1()
            : base("http://res.app.local/www/index.html")
        {
            InitializeComponent();

            LoadHandler.OnLoadEnd += LoadHandler_OnLoadEnd;

            //register the "my" object
            var myObject = GlobalObject.AddObject("my");

            //add property "name" to my, you should implemnt the getter/setter of name property by using PropertyGet/PropertySet events.
            var nameProp = myObject.AddDynamicProperty("name");

            nameProp.PropertyGet += (prop, args) =>
            {
                // getter - if js code "my.name" executes, it'll get the string "NanUI".
                args.Retval = CfrV8Value.CreateString("NanUI");
                args.SetReturnValue(true);
            };
            nameProp.PropertySet += (prop, args) =>
            {
                // setter's value from js context, here we do nothing, so it will store or igrone by your mind.
                var value = args.Value;
                args.SetReturnValue(true);
            };


            //add a function showCSharpMessageBox
            var showMessageBoxFunc = myObject.AddFunction("showCSharpMessageBox");

            showMessageBoxFunc.Execute += (func, args) =>
            {
                //it will be raised by js code "my.showCSharpMessageBox(`some text`)" executed.
                //get the first string argument in Arguments, it pass by js function.
                var stringArgument = args.Arguments.FirstOrDefault(p => p.IsString);

                if (stringArgument != null)
                {
                    MessageBox.Show(this, stringArgument.StringValue, "C# Messagebox", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            };

            //add a function getArrayFromCSharp, this function has an argument, it will combind C# string array with js array and return to js context.
            var friends = new string[] { "Mr.JSON", "Mr.Lee", "Mr.BONG" };

            var getArrayFromCSFunc = myObject.AddFunction("getArrayFromCSharp");

            getArrayFromCSFunc.Execute += (func, args) =>
            {
                var jsArray = args.Arguments.FirstOrDefault(p => p.IsArray);



                if (jsArray == null)
                {
                    jsArray = CfrV8Value.CreateArray(friends.Length);
                    for (int i = 0; i < friends.Length; i++)
                    {
                        jsArray.SetValue(i, CfrV8Value.CreateString(friends[i]));
                    }
                }
                else
                {
                    var newArray = CfrV8Value.CreateArray(jsArray.ArrayLength + friends.Length);

                    for (int i = 0; i < jsArray.ArrayLength; i++)
                    {
                        newArray.SetValue(i, jsArray.GetValue(i));
                    }

                    var jsArrayLength = jsArray.ArrayLength;

                    for (int i = 0; i < friends.Length; i++)
                    {
                        newArray.SetValue(i + jsArrayLength, CfrV8Value.CreateString(friends[i]));
                    }


                    jsArray = newArray;
                }


                //return the array to js context

                args.SetReturnValue(jsArray);

                //in js context, use code "my.getArrayFromCSharp()" will get an array like ["Mr.JSON", "Mr.Lee", "Mr.BONG"]
            };

            //add a function getObjectFromCSharp, this function has no arguments, but it will return a Object to js context.
            var getObjectFormCSFunc = myObject.AddFunction("getObjectFromCSharp");

            getObjectFormCSFunc.Execute += (func, args) =>
            {
                //create the CfrV8Value object and the accssor of this Object.
                var jsObjectAccessor = new CfrV8Accessor();
                var jsObject         = CfrV8Value.CreateObject(jsObjectAccessor);

                //create a CfrV8Value array
                var jsArray = CfrV8Value.CreateArray(friends.Length);

                for (int i = 0; i < friends.Length; i++)
                {
                    jsArray.SetValue(i, CfrV8Value.CreateString(friends[i]));
                }

                jsObject.SetValue("libName", CfrV8Value.CreateString("NanUI"), CfxV8PropertyAttribute.ReadOnly);
                jsObject.SetValue("friends", jsArray, CfxV8PropertyAttribute.DontDelete);


                args.SetReturnValue(jsObject);

                //in js context, use code "my.getObjectFromCSharp()" will get an object like { friends:["Mr.JSON", "Mr.Lee", "Mr.BONG"], libName:"NanUI" }
            };


            //add a function with callback

            var callbackTestFunc = GlobalObject.AddFunction("callbackTest");

            callbackTestFunc.Execute += (func, args) => {
                var callback = args.Arguments.FirstOrDefault(p => p.IsFunction);
                if (callback != null)
                {
                    var callbackArgs = CfrV8Value.CreateObject(new CfrV8Accessor());
                    callbackArgs.SetValue("success", CfrV8Value.CreateBool(true), CfxV8PropertyAttribute.ReadOnly);
                    callbackArgs.SetValue("text", CfrV8Value.CreateString("Message from C#"), CfxV8PropertyAttribute.ReadOnly);

                    callback.ExecuteFunction(null, new CfrV8Value[] { callbackArgs });
                }
            };


            //add a function with async callback
            var asyncCallbackTestFunc = GlobalObject.AddFunction("asyncCallbackTest");

            asyncCallbackTestFunc.Execute += async(func, args) => {
                //save current context
                var v8Context = CfrV8Context.GetCurrentContext();
                var callback  = args.Arguments.FirstOrDefault(p => p.IsFunction);

                //simulate async methods.
                await Task.Delay(5000);

                if (callback != null)
                {
                    //get render process context
                    var rc = callback.CreateRemoteCallContext();

                    //enter render process
                    rc.Enter();

                    //create render task
                    var task = new CfrTask();
                    task.Execute += (_, taskArgs) =>
                    {
                        //enter saved context
                        v8Context.Enter();

                        //create callback argument
                        var callbackArgs = CfrV8Value.CreateObject(new CfrV8Accessor());
                        callbackArgs.SetValue("success", CfrV8Value.CreateBool(true), CfxV8PropertyAttribute.ReadOnly);
                        callbackArgs.SetValue("text", CfrV8Value.CreateString("Message from C#"), CfxV8PropertyAttribute.ReadOnly);

                        //execute callback
                        callback.ExecuteFunction(null, new CfrV8Value[] { callbackArgs });


                        v8Context.Exit();

                        //lock task from gc
                        lock (task)
                        {
                            Monitor.PulseAll(task);
                        }
                    };

                    lock (task)
                    {
                        //post task to render process
                        v8Context.TaskRunner.PostTask(task);
                    }

                    rc.Exit();

                    GC.KeepAlive(task);
                }
            };
        }
示例#11
0
        // 浏览器Javascript环境初始化完成
        protected override void OnRegisterGlobalObject(JSObject global)
        {
            // 可以在此处将C#对象注入到当前窗口的JS上下文中



            //add a function with callback function
            Console.Write(global);
            var callbackTestFunc = global.AddFunction("callbackTest");

            callbackTestFunc.Execute += (func, args) => {
                var callback = args.Arguments.FirstOrDefault(p => p.IsFunction);
                if (callback != null)
                {
                    WebBrowser.ExecuteJavascript("ChangeTitle()");


                    var callbackArgs = CfrV8Value.CreateObject(new CfrV8Accessor());
                    callbackArgs.SetValue("success", CfrV8Value.CreateBool(true), CfxV8PropertyAttribute.ReadOnly);
                    callbackArgs.SetValue("text", CfrV8Value.CreateString("Message from Windows Client"), CfxV8PropertyAttribute.ReadOnly);

                    callback.ExecuteFunction(null, new CfrV8Value[] { callbackArgs });
                }
            };



            //register the "my" object
            var myObject = global.AddObject("my");

            //add property "name" to my, you should implemnt the getter/setter of name property by using PropertyGet/PropertySet events.
            var nameProp = myObject.AddDynamicProperty("name");

            nameProp.PropertyGet += (prop, args) =>
            {
                string computerName = Environment.MachineName;

                string value = $"My Computer Name is JoyNop :)\n{computerName}";

                // getter - if js code "my.name" executes, it'll get the string "NanUI".
                args.Retval = CfrV8Value.CreateString(value);
                args.SetReturnValue(true);
            };
            nameProp.PropertySet += (prop, args) =>
            {
                // setter's value from js context, here we do nothing, so it will store or igrone by your mind.
                var value = args.Value;
                args.SetReturnValue(true);
            };


            //add a function showCSharpMessageBox
            var showMessageBoxFunc = myObject.AddFunction("showCSharpMessageBox");

            showMessageBoxFunc.Execute += (func, args) =>
            {
                //it will be raised by js code "my.showCSharpMessageBox(`some text`)" executed.
                //get the first string argument in Arguments, it pass by js function.
                var stringArgument = args.Arguments.FirstOrDefault(p => p.IsString);

                if (stringArgument != null)
                {
                    string osVersionName = Environment.OSVersion.ToString();
                    MessageBox.Show(osVersionName, "Windows 内核版本", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            };


            var friends             = new string[] { "Mr.JSON", "Mr.Lee", "Mr.BONG" };
            var getObjectFormCSFunc = myObject.AddFunction("getObjectFromCSharp");

            getObjectFormCSFunc.Execute += (func, args) =>
            {
                //create the CfrV8Value object and the accssor of this Object.
                var jsObjectAccessor = new CfrV8Accessor();
                var jsObject         = CfrV8Value.CreateObject(jsObjectAccessor);

                //create a CfrV8Value array
                var jsArray = CfrV8Value.CreateArray(friends.Length);

                for (int i = 0; i < friends.Length; i++)
                {
                    jsArray.SetValue(i, CfrV8Value.CreateString(friends[i]));
                }

                jsObject.SetValue("libName", CfrV8Value.CreateString("NanUI"), CfxV8PropertyAttribute.ReadOnly);
                jsObject.SetValue("friends", jsArray, CfxV8PropertyAttribute.DontDelete);


                args.SetReturnValue(jsObject);

                //in js context, use code "my.getObjectFromCSharp()" will get an object like { friends:["Mr.JSON", "Mr.Lee", "Mr.BONG"], libName:"NanUI" }
            };
        }
示例#12
0
        public static CfrV8Value GetCfrObject(this JSObject _, object item)
        {
            var nameDict = new Dictionary <string, string>();

            var accessor = new CfrV8Accessor();

            var o = CfrV8Value.CreateObject(accessor);

            var t = item.GetType();

            foreach (var p in t.GetProperties())
            {
                var name = p.Name.Substring(0, 1).ToLower() + p.Name.Substring(1);

                nameDict[name] = p.Name;


                o.SetValue(name, CfxV8AccessControl.Default, CfxV8PropertyAttribute.DontDelete);
            }

            accessor.Get += (s, e) =>
            {
                var name = nameDict[e.Name];

                var p = t.GetProperty(name);

                var value     = p.GetValue(item, null);
                var valueType = value?.GetType();



                if (value == null)
                {
                    e.Retval = CfrV8Value.CreateNull();
                }
                else if (valueType == typeof(string) || valueType == typeof(Guid))
                {
                    e.Retval = CfrV8Value.CreateString((string)value);
                }
                else if (valueType == typeof(int) || valueType == typeof(short) || valueType == typeof(long))
                {
                    e.Retval = CfrV8Value.CreateInt((int)value);
                }
                else if (valueType == typeof(decimal))
                {
                    e.Retval = CfrV8Value.CreateDouble(Convert.ToDouble(value));
                }
                else if (valueType == typeof(float) || valueType == typeof(double))
                {
                    e.Retval = CfrV8Value.CreateDouble(Convert.ToDouble(value));
                }
                else if (valueType == typeof(bool))
                {
                    e.Retval = CfrV8Value.CreateBool(Convert.ToBoolean(value));
                }
                else if (valueType == typeof(DateTime))
                {
                    e.Retval = CfrV8Value.CreateDate(CfrTime.FromUniversalTime((DateTime)value));
                }
                else
                {
                    e.Retval = CfrV8Value.CreateNull();
                }



                e.SetReturnValue(true);
            };


            return(o);
        }