private void RenderDisplayData() { if (string.IsNullOrEmpty(layoutSourceField.DisplayData)) { NoDisplayDataMessage(); return; } try { var displayData = XDocument.Parse(layoutSourceField.DisplayData); var devices = from d in displayData.Descendants(LayoutStruct.Node.Device).OrderBy(element => element.GetAttributeValue("dn")) select d; if (devices.Any()) { Devices.Children.Add(DrawPanel(devices, deviceStackSettings)); } else { NoDisplayDataMessage(); } } catch (Exception e) { MainBorder.IsEnabled = false; DataNotSpecifiedNotification.Hide(); ParseErrorNotification.Initialize(e); ParseErrorNotification.Show(); } }
public void SetField(Field sourceField) { Assert.ArgumentNotNull(sourceField, nameof(sourceField)); Resizer.FieldId = sourceField.FieldUris.First().FieldId; stkMain.Children.Clear(); fieldValue = sourceField.Value; souceFieldValue = sourceField; try { var data = XDocument.Parse(sourceField.DisplayData); DrawAccounts(data); justSetField = true; } catch (Exception e) { MainBorder.IsEnabled = false; DataNotSpecifiedNotification.Hide(); ParseErrorNotification.Initialize(e); ParseErrorNotification.Show(); } }
public void SetValue(string value) { Assert.ArgumentNotNull(value, nameof(value)); TreeView.Items.Clear(); if (!value.Equals(string.Empty)) { DataNotSpecifiedNotification.Hide(); } var changed = myvalue != value; myvalue = value; if (!string.IsNullOrEmpty(value)) { try { var tracking = XElement.Parse(value); DrawProfiles(from p in tracking.Descendants(@"profile") select p); DrawEvents(from e in tracking.Descendants(@"event") select e); } catch (Exception e) { MainBorder.IsEnabled = false; DataNotSpecifiedNotification.Hide(); ParseErrorNotification.Initialize(e); ParseErrorNotification.Show(); } } if (!changed) { return; } var modified = ValueModified; if (modified != null) { modified(); } }