Ejemplo n.º 1
0
        public void Remove(CameraLayout cameraLayout, string id)
        {
            if (this.cameraDictionary.ContainsKey(cameraLayout))
            {
                List<Camera3D> list = this.cameraDictionary[cameraLayout];

                foreach (Camera3D camera in list)
                {
                    if(camera.ID.Equals(id))
                        list.Remove(camera);
                }
            }
        }
Ejemplo n.º 2
0
 public bool SetCameraLayout(CameraLayout cameraLayout)
 {
     //if first time and NULL or not the same as current
     if ((this.activeCameraList == null) || (!this.currentCameraLayout.Equals(cameraLayout)))
     {
         //if layout exists in the dictionary
         if (this.cameraDictionary.ContainsKey(cameraLayout))
         {
             this.activeCameraList    = this.cameraDictionary[cameraLayout];
             this.currentCameraLayout = cameraLayout;
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 3
0
        public void Remove(CameraLayout cameraLayout, string id)
        {
            if (this.cameraDictionary.ContainsKey(cameraLayout))
            {
                List <Camera3D> list = this.cameraDictionary[cameraLayout];

                foreach (Camera3D camera in list)
                {
                    if (camera.ID.Equals(id))
                    {
                        list.Remove(camera);
                    }
                }
            }
        }
Ejemplo n.º 4
0
        public void Add(CameraLayout cameraLayout, Camera3D camera)
        {
            if (this.cameraDictionary.ContainsKey(cameraLayout))
            {
                List<Camera3D> list = this.cameraDictionary[cameraLayout];

                if(!list.Contains(camera))
                    list.Add(camera);
            }
            else
            {
                List<Camera3D> list = new List<Camera3D>();
                list.Add(camera);
                this.cameraDictionary.Add(cameraLayout, list);
            }
        }
Ejemplo n.º 5
0
        public void Add(CameraLayout cameraLayout, Camera3D camera)
        {
            if (this.cameraDictionary.ContainsKey(cameraLayout))
            {
                List <Camera3D> list = this.cameraDictionary[cameraLayout];

                if (!list.Contains(camera))
                {
                    list.Add(camera);
                }
            }
            else
            {
                List <Camera3D> list = new List <Camera3D>();
                list.Add(camera);
                this.cameraDictionary.Add(cameraLayout, list);
            }
        }
Ejemplo n.º 6
0
        public IActionResult CreateNewLayout([FromForm] NewLayoutViewModel input)
        {
            if (string.IsNullOrEmpty(input.Name))
            {
                return(BadRequest("Name cannot be empty."));
            }

            var layout = new CameraLayout
            {
                Name = input.Name
            };

            _context.Add(layout);
            _context.SaveChanges();

            layout.CameraTiles = new List <CameraTile>();
            var model = new LayoutViewModel
            {
                CameraLayout = layout
            };

            return(PartialView("DashboardLayout", model));
        }
Ejemplo n.º 7
0
 public bool SetCameraLayout(CameraLayout cameraLayout)
 {
     //if first time and NULL or not the same as current
     if((this.activeCameraList == null) || (!this.currentCameraLayout.Equals(cameraLayout)))
     {
         //if layout exists in the dictionary
         if(this.cameraDictionary.ContainsKey(cameraLayout))
         {
             this.activeCameraList = this.cameraDictionary[cameraLayout];
             this.currentCameraLayout = cameraLayout;
             return true;
         }
     }
     return false;
 }