void ButtonAdd_Click(object sender, RoutedEventArgs e) { if (m_measurementsToBeAdded.Count > 0) { App app = (App)Application.Current; //string[] format is {Name=PointID, Tooltip=SignalReference, Tag=HistorianID} foreach (KeyValuePair <string, string[]> measurement in m_measurementsToBeAdded) { OutputStreamMeasurement outputStreamMeasurement = new OutputStreamMeasurement(); outputStreamMeasurement.NodeID = app.NodeValue; outputStreamMeasurement.AdapterID = m_sourceOutputStreamID; outputStreamMeasurement.HistorianID = string.IsNullOrEmpty(measurement.Value[2]) ? (int?)null : Convert.ToInt32(measurement.Value[2]); outputStreamMeasurement.PointID = Convert.ToInt32(measurement.Value[0]); outputStreamMeasurement.SignalReference = measurement.Value[1].Replace(measurement.Value[1].Substring(0, measurement.Value[1].LastIndexOf("-")), "<UNASSIGNED>"); m_client.SaveOutputStreamMeasurementAsync(outputStreamMeasurement, true); } SystemMessages sm = new SystemMessages(new Message() { UserMessage = "Output Stream Measurements Added Successfully", SystemMessage = string.Empty, UserMessageType = MessageType.Success }, ButtonType.OkOnly); sm.ShowPopup(); m_client.GetMeasurementsForOutputStreamAsync(app.NodeValue, m_sourceOutputStreamID); } else { SystemMessages sm = new SystemMessages(new Message() { UserMessage = "Please Select Measurement(s) to Add", SystemMessage = string.Empty, UserMessageType = MessageType.Information }, ButtonType.OkOnly); sm.ShowPopup(); } }