Пример #1
0
 private void Write(MovieCamera camera, XmlElement node)
 {
     Write(camera.TopLeft, node.CreateChildElement("TopLeft"));
     Write(camera.TopRight, node.CreateChildElement("TopRight"));
     Write(camera.BottomRight, node.CreateChildElement("BottomRight"));
     Write(camera.BottomLeft, node.CreateChildElement("BottomLeft"));
 }
Пример #2
0
        public bool ReadMoviesCameras(Location location)
        {
            ArchiveFileEntry mskEntry = (ArchiveFileEntry)_locationDirectory.Childs.TryGetValue(_name + ".msk");

            if (mskEntry == null)
            {
                return(true);
            }

            using (MskFileReader mskReader = new MskFileReader(mskEntry.OpenReadableContentStream()))
            {
                MovieCameras cameras = new MovieCameras(mskReader.Rects.Length);
                foreach (MskRect rect in mskReader.Rects)
                {
                    MovieCamera camera = new MovieCamera
                    {
                        TopLeft     = rect.Top,
                        TopRight    = rect.Bottom,
                        BottomRight = rect.Right,
                        BottomLeft  = rect.Left
                    };
                    cameras.Add(camera);
                }
                location.MovieCameras = cameras;
            }

            location.SaveRequest &= ~LocationProperty.MoviesCameras;
            location.Importable  &= ~LocationProperty.MoviesCameras;
            return(true);
        }