public async Task ShowRotations()
        {
            var rotations = await _rotationsApi.Get <List <Model.Rotation> >(null);

            rotations.RemoveAll(r => !r.Available);
            var currentDate = DateTime.Now.Date;

            rotations.RemoveAll(r => !((currentDate > r.From) && (currentDate < r.To)));
            rotations.RemoveAll(r => (r.ForBirthday) && (currentDate.Date != APIService.User.BirthDate.Date));
            rotations = (from item in rotations orderby item.ForBirthday descending select item).ToList();

            Rotations.Clear();
            foreach (var rotation in rotations)
            {
                var movie = await _moviesApi.GetById <Model.Movie>(rotation.MovieId);

                var show = await _showsApi.GetById <Model.Show>(rotation.ShowId);

                var newItem = new Model.ObservableLists.RotationItem()
                {
                    Birthday    = rotation.ForBirthday,
                    From        = rotation.From.Date.ToString("dd. MMMM yy"),
                    To          = rotation.To.ToString("dd. MMMM yy"),
                    Description = rotation.Description,
                    MovieImage  = movie.ImageLink,
                    ShowImage   = show.ImageLink,
                    RotationId  = rotation.RotationId
                };

                Rotations.Add(newItem);
            }
        }
Example #2
0
        // Clear the class buffer for Positions/AvatarBoneLengths/HumanBoneVectors/HumanBoneLengths/Rotations/LocalRotations/FKPositions
        public void AllClear()
        {
            Positions.Clear();
            AvatarBoneLengths.Clear();

            HumanBoneVectors.Clear();
            HumanBoneLengths.Clear();
            Rotations.Clear();
            LocalRotations.Clear();

            FKPositions.Clear();
        }
Example #3
0
        // Clear the class buffer for Positions/HumanToAvatarTransformRotations/AvatarBoneLengths/HumanBoneVectors/HumanBoneLengths/Rotations/LocalRotations/FKPositions
        public void Clear()
        {
            Positions.Clear();
            HumanToAvatarTransformRotations.Clear();
            AvatarBoneLengths.Clear();

            HumanBoneVectors.Clear();
            HumanBoneLengths.Clear();
            Rotations.Clear();
            LocalRotations.Clear();

            FKPositions.Clear();
        }
Example #4
0
        // AllClear is called for clearing the class buffer for Positions/AvatarBoneLengths/Rotations/LocalRotations/HumanBoneVectors/HumanBoneLengths/FKPositions and Frame/UseAbsoluteCoordinate/UseLocalRotation/UseForwardKinematics/SetFootOnGround
        public void AllClear()
        {
            Frame = 0;
            Positions.Clear();
            AvatarBoneLengths.Clear();
            UseAbsoluteCoordinate = false;
            UseLocalRotation      = false;
            UseForwardKinematics  = false;
            SetFootOnGround       = false;

            Rotations.Clear();
            LocalRotations.Clear();
            HumanBoneVectors.Clear();
            HumanBoneLengths.Clear();
            FKPositions.Clear();
        }
Example #5
0
        private void LoadDotVision(Picture picture)
        {
            string fileName = picture.Directorio + @"\.vision";

            Rotations.Clear();
            const Int32 BufferSize = 128;

            using (var fileStream = File.OpenRead(fileName))
                using (var streamReader = new StreamReader(fileStream, System.Text.Encoding.UTF8, true, BufferSize))
                {
                    string line;
                    while ((line = streamReader.ReadLine()) != null)
                    {
                        string[] valores = line.Split('|');
                        double   angulo  = 0;
                        double.TryParse(valores[1], out angulo);
                        Rotations.Add(new Rotation(valores[0], angulo));
                    }
                }
        }