Beispiel #1
0
        private void GetNoteContentHistoryFormCSFunc_Execute(object sender, CfrV8HandlerExecuteEventArgs e)
        {
            var noteID = e.Arguments.FirstOrDefault(p => p.IsString).ToString();

            noteContentHistoryList = noteUtils.GetHistoryNoteContent(Convert.ToInt32(noteID));
            if (noteContentHistoryList != null && noteContentHistoryList.Count > 0)
            {
                var jsObjectAccessor = new CfrV8Accessor();
                var jsObject         = CfrV8Value.CreateObject(jsObjectAccessor);
                var noteListArray    = CfrV8Value.CreateArray(noteContentHistoryList.Count);
                int i = 0;
                foreach (var note in noteContentHistoryList)
                {
                    noteListArray.SetValue(i, note.create_time);
                    i++;
                }
                jsObject.SetValue("historyArray", noteListArray, CfxV8PropertyAttribute.DontDelete);
                e.SetReturnValue(jsObject);
            }
        }