public void OnCompleted() { IsCompleted = true; // Force another update to ensure DisconnectData is called. // CONSIDER: Do we need to UpdateNotify here? // Not necessarily. Next recalc will call the function, not call RTD and that will trigger DisconnectData. // However, this ensures a more deterministic call to DisconnectData _topic.UpdateNotify(); }
public void OnNext(object value) { Value = value; // Not actually setting the topic value, just poking it // TODO: Using the 'fake' RTD value should be optional - to give us a way to deal with 'newValues' one day. // But then we'd need to be really careful with error values (which prevent restart). // BUGBUG: The ToOADate truncates, things might happy in the same millisecond etc. // See https://exceldna.codeplex.com/workitem/9472 //_topic.UpdateValue(DateTime.UtcNow.ToOADate()); // 2016-03-25: Further bug here - We can't leave the Topic value as #N/A (which is what happens if we don't update it) // since that prevents restart when a book is re-opened. (See details in ExcelObserverRtdServer.ConnectData) // So we now initialize the Topic with a new value. // 2016-11-04: ExcelRtdServer.ConnectData was changed so that this call, // if it happens during the ConnectData, will have no effect (saving an extra function call). _topic.UpdateNotify(); }