Esempio n. 1
0
        public TileEdView()
            : base()
        {
            CurrentPalette = new Constants.Colour[NumColours];
            switch (NumColours)
            {
            case 4:
                CurrentPalette[0] = Constants.defaultPalette[3];
                CurrentPalette[1] = Constants.defaultPalette[1];
                CurrentPalette[2] = Constants.defaultPalette[2];
                CurrentPalette[3] = Constants.defaultPalette[0];
                break;
            }

            pixels = new byte[Constants.CELLS_X * Constants.CELLS_Y];

            this.AddVisualChild(this.dvGrid);
            this.AddLogicalChild(this.dvGrid);

            this.AddVisualChild(this.dvPixels);
            this.AddLogicalChild(this.dvPixels);

            this.visuals = new DrawingVisual[] { this.dvGrid, this.dvPixels };

            this.DrawGrid();
            this.DrawTile();
        }
Esempio n. 2
0
 public static string GetRgbaColour(Constants.Colour colour)
 {
     switch (colour)
     {
     case Constants.Colour.Red:
     {
         return(Constants.RgbaColour.Red);
     }
     }
     return(null);
 }
        public SelectedColourModel(Constants.Colour[] defaultpalette)
        {
            Current = new Constants.Colour[NumColours];
            switch (NumColours)
            {
            case 2:
                Current[0] = defaultpalette[3];
                Current[1] = defaultpalette[0];

                break;
            }
        }
Esempio n. 4
0
 public PaletteModel(Constants.Colour[] defaultpalette)
 {
     CurrentPalette = new Constants.Colour[NumColours];
     switch (NumColours)
     {
     case 4:
         CurrentPalette[0] = defaultpalette[pal[3]];
         CurrentPalette[1] = defaultpalette[pal[1]];
         CurrentPalette[2] = defaultpalette[pal[2]];
         CurrentPalette[3] = defaultpalette[pal[0]];
         break;
     }
 }
        public void ThenTheFollowingFieldsShouldBeHiglightedIn(Constants.Colour colour, Table expectedFields)
        {
            var expectedRgbaColour = Utilities.GetRgbaColour(colour);

            var expectedFieldList = expectedFields.CreateDynamicSet();

            foreach (var fieldItem in expectedFieldList)
            {
                var convertedEnumField =
                    (Constants.LoginFields)Enum.Parse(typeof(Constants.LoginFields), fieldItem.Field, true);
                var actualColour = LoginPage.GetValidationFieldColour(convertedEnumField);
                Assert.AreEqual(expectedRgbaColour, actualColour);
            }
        }
        public SelectedColourView()
            : base()
        {
            Current = new Constants.Colour[NumColours];

            switch (NumColours)
            {
            case 2:
                Current[0] = Constants.defaultPalette[3];
                Current[1] = Constants.defaultPalette[0];

                break;
            }


            this.AddVisualChild(this.grid);
            this.AddLogicalChild(this.grid);
            this.visuals = new DrawingVisual[] { this.grid };
            this.DrawGrid();
        }
Esempio n. 7
0
        public LevelEdView()
            : base()
        {
            int NumColours = 4;

            DefaultPalette = new Constants.Colour[NumColours];

            switch (NumColours)
            {
            case 4:
                DefaultPalette[0] = Constants.Colour.Yellow;
                DefaultPalette[1] = Constants.Colour.Red;
                DefaultPalette[2] = Constants.Colour.Green;
                DefaultPalette[3] = Constants.Colour.Black;
                break;
            }



            this.AddVisualChild(this.cells);
            this.AddLogicalChild(this.cells);

            this.visuals = new DrawingVisual[] { this.cells };
        }
        public void ThenTheFieldShouldBeHiglightedIn(Constants.LoginFields fieldName, Constants.Colour colour)
        {
            var expectedRgbaColour = Utilities.GetRgbaColour(colour);

            Assert.NotNull(expectedRgbaColour);

            string actualColour;

            switch (fieldName)
            {
            case Constants.LoginFields.Email:
            {
                actualColour = LoginPage.EmailValidationColor;
            }
            break;

            case Constants.LoginFields.Password:
            {
                actualColour = LoginPage.PasswordValidationColor;
            }
            break;

            default:
            {
                throw new AssertionException("No field name defined in test framework");
            }
            }
            Assert.NotNull(expectedRgbaColour);

            Assert.AreEqual(expectedRgbaColour, actualColour);
        }