コード例 #1
0
        private void GetNoteContentFormCSFunc_Execute(object sender, Chromium.Remote.Event.CfrV8HandlerExecuteEventArgs e)
        {
            var noteID           = e.Arguments.FirstOrDefault(p => p.IsString).ToString();
            var noteContent      = noteUtils.GetNoteContent(Convert.ToInt32(noteID));
            var jsObjectAccessor = new CfrV8Accessor();
            var jsObject         = CfrV8Value.CreateObject(jsObjectAccessor);

            if (noteContent == null)
            {
                return;
            }
            jsObject.SetValue("id", noteContent.id, CfxV8PropertyAttribute.DontDelete);
            jsObject.SetValue("n_content", noteContent.n_content, CfxV8PropertyAttribute.DontDelete);
            e.SetReturnValue(jsObject);
        }