/// <summary> /// Processes full_state and change messages, receiving a complete spreadsheet's data and /// loading it into the spreadsheet. /// </summary> /// <param name="data"></param> /// <param name="command"></param> private void ChangeDocument(string data) { var cellValue = data.Replace(CHANGE_PREFIX, "").Replace(END_OF_TEXT, "").Split(':').ToArray(); if (cellValue.Length >= 2) { SpreadsheetEditCallback?.Invoke(cellValue[0], cellValue[1]); } }
/// <summary> /// Processes full_state message, receiving a complete spreadsheet's data and /// loading it into the spreadsheet. /// </summary> /// <param name="data"></param> /// <param name="command"></param> private void FullStateDocumentDocument(string data) { var cellContents = data.Replace(END_OF_TEXT, "").Replace(FULL_STATE_PREFIX, "").Split('\n').Where(x => !string.IsNullOrEmpty(x)).ToArray(); CreateSpreadsheet?.Invoke(); if (cellContents.Length > 0) { foreach (var content in cellContents) { var cellValue = content.Split(':').Where(x => !string.IsNullOrEmpty(x)).ToArray(); SpreadsheetEditCallback?.Invoke(cellValue[0], cellValue[1]); } } }