internal static void Dump(AssistantDumper assistant, ColourTypes value, bool withSeparator = false)
        {
            assistant.IncrementDepth();
            if (assistant.MaximumDepthExceeded())
                return;

            assistant.AddStartObject();
            assistant.AddType("Dogen.TestModels.CSharpModel.ColourTypes", true/*withSeparator*/);
            string valueAsString = "Unsupported Value";
            switch (value)
            {
                case ColourTypes.Invalid:
                    valueAsString = "Invalid";
                    break;
                case ColourTypes.Red:
                    valueAsString = "Red";
                    break;
                case ColourTypes.Blue:
                    valueAsString = "Blue";
                    break;
                case ColourTypes.Green:
                    valueAsString = "Green";
                    break;
                case ColourTypes.Gray:
                    valueAsString = "Gray";
                    break;
            }

            assistant.Add("value", valueAsString);
            assistant.AddEndObject();

            assistant.DecrementDepth();
        }
        public static string Dump(ColourTypes value)
        {
            var assistant = new AssistantDumper();

            Dump(assistant, value);
            return(assistant.ToString());
        }
        int Sizez;// the overall size of the Viewbox for precent calcs

        /***********************************
         * Author: Angelo M Sanches
         * inish the form
         *************************************/
        public PatternModel(int nSize)
        {
            InitializeComponent();
            Fill    = FillTypes.Value;
            Colours = ColourTypes.red;
            Sizez   = nSize;
        }
 /***********************************
  * Author: Angelo M Sanches
  * disables ui for percents and sets the colour return state
  *************************************/
 private void RaBu_Red_CheckedChanged(object sender, EventArgs e)
 {
     if (RaBu_Red.Checked)
     {
         TrBa_BluePercent.Enabled  = false;
         TrBa_RedPercent.Enabled   = false;
         TrBa_GreenPercent.Enabled = false;
         Colours = ColourTypes.red;
     }
 }
 /***********************************
  * Author: Angelo M Sanches
  * enables ui for percents and sets the colour return state
  *************************************/
 private void RaBu_Custom_CheckedChanged(object sender, EventArgs e)
 {
     if (RaBu_Custom.Checked)
     {
         TrBa_BluePercent.Enabled  = true;
         TrBa_RedPercent.Enabled   = true;
         TrBa_GreenPercent.Enabled = true;
         Colours = ColourTypes.custom;
     }
 }
Exemple #6
0
        public void Insert(ColourTypes entity)
        {
            var sql = $@"Insert Into ColourTypes(@Name)";

            _connection.Execute(sql,
                                new
            {
                entity.Name
            });
        }
Exemple #7
0
    private static void setPlanetColours(Planet p, ColourTypes ct, Colours col)
    {
        switch (ct.Name)
        {
        case "Land": p.landColors.Add(PlanetColours[col.Name]); break;

        case "Water": p.waterColors.Add(PlanetColours[col.Name]); break;

        case "Mountain": p.mountainColors.Add(PlanetColours[col.Name]); break;
        }
    }
Exemple #8
0
        public List <Colours> getPlanetColours(PlanetTypes pt, ColourTypes ct)
        {
            var planetColoursRepo = new PlanetColoursRepository(_connection);
            var coloursRepo       = new ColourRepository(_connection);
            var planetColours     = planetColoursRepo.GetByPlanetTypeColourType(pt, ct);
            var listColours       = new List <Colours>();

            foreach (var pc in planetColours)
            {
                var col = coloursRepo.GetById(pc.ColourId);
                listColours.Add(col);
            }

            return(listColours);
        }
        static internal void Dump(AssistantDumper assistant, ColourTypes value, bool withSeparator = false)
        {
            assistant.IncrementDepth();
            if (assistant.MaximumDepthExceeded())
            {
                return;
            }

            assistant.AddStartObject();
            assistant.AddType("CSharpRefImpl.CSharpModel.ColourTypes", true /*withSeparator*/);
            string valueAsString = "Unsupported Value";

            switch (value)
            {
            case ColourTypes.Invalid:
                valueAsString = "Invalid";
                break;

            case ColourTypes.Red:
                valueAsString = "Red";
                break;

            case ColourTypes.Blue:
                valueAsString = "Blue";
                break;

            case ColourTypes.Green:
                valueAsString = "Green";
                break;

            case ColourTypes.Gray:
                valueAsString = "Gray";
                break;
            }

            assistant.Add("value", valueAsString);
            assistant.AddEndObject();

            assistant.DecrementDepth();
        }
 public static string Dump(ColourTypes value)
 {
     var assistant = new AssistantDumper();
     Dump(assistant, value);
     return assistant.ToString();
 }
Exemple #11
0
        public List <PlanetColours> GetByPlanetTypeColourType(PlanetTypes pt, ColourTypes ct)
        {
            var sql = $@"Select * from PlanetColours where PlanetColours.PlanetTypeId = {pt.Id} and PlanetColours.ColourTypeId = {ct.Id}";

            return(_connection.Query <PlanetColours>(sql).ToList());
        }
Exemple #12
0
        public void Delete(ColourTypes entity)
        {
            var sql = $@"Delete From ColourTypes where ColourTypes.Id = {entity.Id}";

            _connection.Execute(sql);
        }