示例#1
0
        public static ZoneOverlayEntryJsModel CreateFromDomainModel(ZoneOverlayEntry zoneDomain)
        {
            var model = new ZoneOverlayEntryJsModel
            {
                Alias = zoneDomain.Alias,
                FixedCameraEnhancementId = zoneDomain.FixedCameraEnhancementId.HasValue ? zoneDomain.FixedCameraEnhancementId.Value.Id : null,
                Points        = zoneDomain.Points,
                MetadataSetId = zoneDomain.MetadataSetId.HasValue ? zoneDomain.MetadataSetId.Value.Id : null,
                View          = zoneDomain.View
            };

            BaseOverlayEntryJsModel.MapBasePropertiesFromDomainModel(zoneDomain, model);

            return(model);
        }
        public static MapOverlayJsModel CreateFromDomainModel(MapOverlay domainModel)
        {
            var model = new MapOverlayJsModel();

            model.Id      = domainModel.Id;
            model.Name    = domainModel.Name;
            model.Zones   = domainModel.Entries.Where(e => e is ZoneOverlayEntry).Cast <ZoneOverlayEntry>().Select(z => ZoneOverlayEntryJsModel.CreateFromDomainModel(z)).ToList();
            model.Circles = domainModel.Entries.Where(e => e is CircleOverlayEntry).Cast <CircleOverlayEntry>().Select(z => CircleOverlayEntryJsModel.CreateFromDomainModel(z)).ToList();
            model.Cameras = domainModel.Entries.Where(e => e is CameraOverlayEntry).Cast <CameraOverlayEntry>().Select(z => CameraOverlayEntryJsModel.CreateFromDomainModel(z)).ToList();

            return(model);
        }
示例#3
0
 public async Task RemoveTagCirclesForZone(JsModel.ZoneOverlayEntryJsModel zone, SvgComponentEvent e)
 {
     await Vm.RemoveTagCirclesForZone(zone.Id);
 }
示例#4
0
 public async Task UpdateZone(JsModel.ZoneOverlayEntryJsModel zone, SvgComponentEvent e)
 {
     await Vm.UpdateZone(zone);
 }
示例#5
0
 public async Task OpenSvgControlProps(JsModel.ZoneOverlayEntryJsModel zone, SvgComponentEvent e)
 {
     this.Vm.OpenSvgControlProps(zone.Id);
 }
示例#6
0
        public async Task <JsModel.ZoneOverlayEntryJsModel> AddNewZoneToVm(JsModel.ZoneOverlayEntryJsModel zone)
        {
            zone = Vm.AddNewZoneToVm(zone);

            return(zone);
        }
示例#7
0
 public async Task UnselectZone(JsModel.ZoneOverlayEntryJsModel zone, SvgComponentEvent e)
 {
     Vm.UnselectZone(zone);
 }
示例#8
0
        public async Task SelectZone(JsModel.ZoneOverlayEntryJsModel zone, SvgComponentEvent e)
        {
            Vm.SelectZone(zone);

            this.StateHasChanged();
        }
示例#9
0
 public async Task DeleteZone(JsModel.ZoneOverlayEntryJsModel zone, SvgComponentEvent e)
 {
     await this.Vm.DeleteZone(zone);
 }