Beispiel #1
0
        public void OnBind(ImageInfo stat)
        {
            var context     = EmotionLabel.Context;
            var emotionName = stat.emotions.Max().Name;

            TimeLabel.Text    = stat.ImageDate.Hour.ToString() + ":" + stat.ImageDate.Minute.ToString();
            EmotionLabel.Text = emotionName;
            EmotionLabel.SetTextColor(new Color(ContextCompat.GetColor(context, emotionName.EmotionColor())));
            UsernameLabel.Text = SignInViewModel.userList.Find(user => user.Id == stat.UserId).Username;
        }
Beispiel #2
0
        protected void ReadEmotionLabelsConfig()
        {
            var fileName = Path.GetFullPath("../../../../bin/config/emotions.csv");

            if (!File.Exists(fileName))
            {
                return;
            }

            var sr   = new StreamReader(fileName);
            var line = sr.ReadLine();

            if (line == null)
            {
                return;
            }

            var dimensionIds = line.Split(';');

            if (dimensionIds.Length < 2)
            {
                return;
            }

            while ((line = sr.ReadLine()) != null)
            {
                if (line.StartsWith("//"))
                {
                    continue;
                }

                var parameters = line.Split(';');
                if (parameters.Length != dimensionIds.Length)
                {
                    continue;
                }

                var name         = parameters[0];
                var emotionLabel = new EmotionLabel(name);
                for (var i = 1; i < dimensionIds.Length; i++)
                {
                    var dimensionId    = dimensionIds[i];
                    var dimensionValue = Convert.ToSingle(parameters[i], CultureInfo.InvariantCulture);
                    emotionLabel.Dimensions[dimensionId].Value = dimensionValue;
                }
                this.EmotionLabels.Add(name, emotionLabel);
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (AgeLabel != null)
            {
                AgeLabel.Dispose();
                AgeLabel = null;
            }

            if (FaceImageView != null)
            {
                FaceImageView.Dispose();
                FaceImageView = null;
            }

            if (FacialHairLabel != null)
            {
                FacialHairLabel.Dispose();
                FacialHairLabel = null;
            }

            if (GenderLabel != null)
            {
                GenderLabel.Dispose();
                GenderLabel = null;
            }

            if (HeadPoseLabel != null)
            {
                HeadPoseLabel.Dispose();
                HeadPoseLabel = null;
            }

            if (SizeLabel != null)
            {
                SizeLabel.Dispose();
                SizeLabel = null;
            }

            if (SmileLabel != null)
            {
                SmileLabel.Dispose();
                SmileLabel = null;
            }

            if (TitleLabel != null)
            {
                TitleLabel.Dispose();
                TitleLabel = null;
            }

            if (HairLabel != null)
            {
                HairLabel.Dispose();
                HairLabel = null;
            }

            if (GlassesLabel != null)
            {
                GlassesLabel.Dispose();
                GlassesLabel = null;
            }

            if (EmotionLabel != null)
            {
                EmotionLabel.Dispose();
                EmotionLabel = null;
            }

            if (MakeupLabel != null)
            {
                MakeupLabel.Dispose();
                MakeupLabel = null;
            }

            if (AccessoriesLabel != null)
            {
                AccessoriesLabel.Dispose();
                AccessoriesLabel = null;
            }

            if (OcclusionLabel != null)
            {
                OcclusionLabel.Dispose();
                OcclusionLabel = null;
            }

            if (BlurLabel != null)
            {
                BlurLabel.Dispose();
                BlurLabel = null;
            }

            if (NoiseLabel != null)
            {
                NoiseLabel.Dispose();
                NoiseLabel = null;
            }

            if (ExposureLabel != null)
            {
                ExposureLabel.Dispose();
                ExposureLabel = null;
            }
        }