public ScanAreaModel AddArea(string key) { if (this.Areas.Any(x => x.Key == key)) return null; var model = new ScanAreaModel() { Width = 64, Height = 64, Key = key, }; this.areas.Add(model); return model; }
public ScanAreaModel AddArea(string key) { if (Areas.Any(x => x.Key == key)) { return(null); } var model = new ScanAreaModel { Width = 64, Height = 64, Key = key }; areas.Add(model); return(model); }
public ScanAreaModel AddArea(string key) { if (Areas.Any(x => x.Key == key)) { return null; } var model = new ScanAreaModel { Width = 64, Height = 64, Key = key }; areas.Add(model); return model; }
private void RefreshAreas() { areas.Clear(); var models = new List <ScanAreaModel>(); var area = scanAreas.FirstOrDefault(x => x.BaseResolution == BaseResolution); if (area == null) { area = new ScanAreas { BaseResolution = BaseResolution, Areas = new List <ScanArea>() }; scanAreas.Add(area); return; } foreach (var scanArea in area.Areas) { var model = new ScanAreaModel(scanArea); models.Add(model); } areas.AddRange(models); }
private void RefreshAreas() { areas.Clear(); var models = new List<ScanAreaModel>(); var area = scanAreas.FirstOrDefault(x => x.BaseResolution == BaseResolution); if (area == null) { area = new ScanAreas { BaseResolution = BaseResolution, Areas = new List<ScanArea>() }; scanAreas.Add(area); return; } foreach (var scanArea in area.Areas) { var model = new ScanAreaModel(scanArea); models.Add(model); } areas.AddRange(models); }