Ejemplo n.º 1
0
        public override void ProcessInput(int inputID, PipelineBuffer buffer)
        {
            base.ProcessInput(inputID, buffer);

            while (buffer.NextRow())
            {
                var value = buffer.GetString(0);
                var upperCaseConverter = new UpperCaseConverter();

                buffer.SetString(0, upperCaseConverter.Convert(value));
            }
        }
        /// <summary>
        /// Initialize all Helper Tools that are needed for functionality of DrawingCanvas Class
        /// </summary>
        private void InitializeHelperTools()
        {
            _boundingBrush  = new SolidColorBrush(Colors.LightGray);
            _pointBrush     = new SolidColorBrush(Colors.Cornsilk);
            _emojiBrush     = new SolidColorBrush(Colors.Black);
            _pozMetricBrush = new SolidColorBrush(Colors.LimeGreen);
            _negMetricBrush = new SolidColorBrush(Colors.Red);
            _boundingPen    = new Pen(_boundingBrush, 1);

            NameToResourceConverter conv = new NameToResourceConverter();

            _upperConverter = new UpperCaseConverter();
            _metricTypeFace = Fonts.GetTypefaces((Uri)conv.Convert("Square", null, "ttf", null)).FirstOrDefault();

            Faces        = new Dictionary <int, Affdex.Face>();
            _emojiImages = new Dictionary <Affdex.Emoji, BitmapImage>();
            _appImgs     = new Dictionary <string, BitmapImage>();

            var emojis = Enum.GetValues(typeof(Affdex.Emoji));

            foreach (int emojiVal in emojis)
            {
                BitmapImage img = LoadImage(emojiVal.ToString());
                _emojiImages.Add((Affdex.Emoji)emojiVal, img);
            }

            var gender = Enum.GetValues(typeof(Affdex.Gender));

            foreach (int genderVal in gender)
            {
                for (int g = 0; g <= 1; g++)
                {
                    string      name = ConcatInt(genderVal, g);
                    BitmapImage img  = LoadImage(name);
                    _appImgs.Add(name, img);
                }
            }
        }
Ejemplo n.º 3
0
 public void UpperCaseConverterShouldWork()
 {
     var s = "hsDkjdsa8dask";
     var converter = new UpperCaseConverter();
     Assert.AreEqual(s.ToUpper(), (string)converter.Convert(s, typeof(bool), null, CultureInfo.CurrentCulture));
 }
Ejemplo n.º 4
0
        public void Test_Convert_Ok(object str, string expected)
        {
            UpperCaseConverter converter = new UpperCaseConverter();

            Assert.Equal(expected, converter.Convert(str, typeof(string), null, CultureInfo.InvariantCulture));
        }