private void PopulateComboBox() { var demos = Assembly.GetExecutingAssembly().GetTypes().Where(type => type.BaseType == typeof(DemoBase)) .ToList(); foreach (var demo in demos) { Demos.Add(Activator.CreateInstance(demo) as DemoBase); } AllDemos = new ListCollectionView(Demos); AllDemos.GroupDescriptions.Add(new PropertyGroupDescription(nameof(DemoBase.Category))); }
private void MergeDemo(string filename) { QDemo dem = QDemo.Load(filename); ParsedDemo demo = new ParsedDemo(); if (Demos.Count == 0) { MinTime = 100; MaxTime = 0; } demo.Parse(dem); Demos.Add(demo); MinTime = Math.Min(MinTime, demo.Start); MaxTime = Math.Max(MaxTime, demo.End); }
private void OverlayDemo(string filename) { QDemo dem = QDemo.Load(filename); ParsedDemo demo; if (Demos.Count > 0) { demo = Demos[0]; } else { demo = new ParsedDemo(); Demos.Add(demo); MinTime = 100; MaxTime = 0; } demo.Parse(dem); MinTime = Math.Min(MinTime, demo.Start); MaxTime = Math.Max(MaxTime, demo.End); }
public async Task LoadDemosHeader() { NotificationMessage = "Loading..."; IsBusy = true; HasNotification = true; try { List <string> folders = new List <string>(); if (SelectedFolder != null) { folders.Add(SelectedFolder); } else { folders = Folders.ToList(); } Demos.Clear(); var demos = await _demosService.GetDemosHeader(folders); foreach (var demo in demos) { Demos.Add(demo); } DataGridDemosCollection.Refresh(); } catch (Exception e) { Logger.Instance.Log(e); } finally { IsBusy = false; HasNotification = false; } }
public void LoadDemoData(StorageFile dataFile) { var document = new XmlDocument(); document.Load(dataFile.LocalPath); var node = document.SelectSingleNode(@"./Age"); if (node == null) { return; } foreach (XmlNode childNode in node.ChildNodes) { switch (childNode.Name) { case "Age": Demos.Add(ListDataItem.FromXml(childNode)); break; } } }
public void LoadCombinedData(StorageFile dataFile) { var document = new XmlDocument(); document.Load(dataFile.LocalPath); var node = document.SelectSingleNode(@"/TargetCustomers"); if (node == null) { return; } foreach (XmlNode childNode in node.ChildNodes) { switch (childNode.Name) { case "SlideHeader": Headers.Add(ListDataItem.FromXml(childNode)); break; case "Demo": Demos.Add(ListDataItem.FromXml(childNode)); break; case "HHI": HHIs.Add(ListDataItem.FromXml(childNode)); break; case "Geography": Geographies.Add(ListDataItem.FromXml(childNode)); break; } } CombinedList.AddRange(Demos); CombinedList.AddRange(HHIs); CombinedList.AddRange(Geographies); }
private void Load() { var document = new XmlDocument(); document.Load(ResourceManager.Instance.DataTargetCustomersFile.LocalPath); var node = document.SelectSingleNode(@"/TargetCustomers"); if (node == null) { return; } foreach (XmlNode childNode in node.ChildNodes) { switch (childNode.Name) { case "SlideHeader": foreach (XmlAttribute attribute in childNode.Attributes) { switch (attribute.Name) { case "Value": if (!string.IsNullOrEmpty(attribute.Value)) { Headers.Add(attribute.Value); } break; } } break; case "Demo": foreach (XmlAttribute attribute in childNode.Attributes) { switch (attribute.Name) { case "Value": if (!string.IsNullOrEmpty(attribute.Value)) { Demos.Add(attribute.Value); } break; } } break; case "HHI": foreach (XmlAttribute attribute in childNode.Attributes) { switch (attribute.Name) { case "Value": if (!string.IsNullOrEmpty(attribute.Value)) { HHIs.Add(attribute.Value); } break; } } break; case "Geography": foreach (XmlAttribute attribute in childNode.Attributes) { switch (attribute.Name) { case "Value": if (!string.IsNullOrEmpty(attribute.Value)) { Geographies.Add(attribute.Value); } break; } } break; } } }