Esempio n. 1
0
        public bool ReadMoviesCameras(Location location)
        {
            if (_root == null)
            {
                return(false);
            }

            XmlElement node = _root["MovieCameras"];

            if (node == null)
            {
                return(false);
            }

            if (!node.GetBoolean("IsExists"))
            {
                return(true);
            }

            MovieCameras movieCameras = new MovieCameras(node.ChildNodes.Count);

            foreach (XmlElement child in node.ChildNodes)
            {
                movieCameras.Add(ReadMovieCamera(child));
            }
            location.MovieCameras = movieCameras;

            location.SaveRequest &= ~LocationProperty.MoviesCameras;
            location.Importable  |= LocationProperty.MoviesCameras;
            return(true);
        }
Esempio n. 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);
        }
Esempio n. 3
0
        public void WriteMoviesCameras(MovieCameras movieCameras)
        {
            XmlElement node = _root.EnsureChildElement("MovieCameras");

            node.RemoveAll();

            bool isExists = movieCameras != null;

            node.SetBoolean("IsExists", isExists);

            if (!isExists)
            {
                return;
            }

            foreach (MovieCamera camera in movieCameras)
            {
                Write(camera, node.CreateChildElement("MovieCamera"));
            }
        }
Esempio n. 4
0
 public void WriteMoviesCameras(MovieCameras movieCameras)
 {
     throw new NotImplementedException();
 }