aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Utilities/Tango.CatalogGenerator/Program.cs
blob: 83650b2d32d873dbf126d6ba7db07fd3eebd58fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.BL;
using Tango.BL.Entities;
using Tango.BL.Enumerations;

namespace Tango.CatalogGenerator
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Generating Demo Twine Catalog!");

            using (var db = ObservablesContext.CreateDefault())
            {
                var space = db.ColorSpaces.Single(x => x.Code == (int)ColorSpaces.Twine);

                int code = 0;
                int value = 0;

                //Reds
                value = 125;
                while (value < 255)
                {
                    ColorCatalog catalog = new ColorCatalog();
                    catalog.ColorSpace = space;
                    catalog.ColorCode = code++;
                    catalog.Name = "R" + value;
                    catalog.ColorGroup = "Reds";
                    catalog.Red = value;
                    db.ColorCatalogs.Add(catalog);
                    value += 5;
                }

                //Yellows
                value = 125;
                while (value < 255)
                {
                    ColorCatalog catalog = new ColorCatalog();
                    catalog.ColorSpace = space;
                    catalog.ColorCode = code++;
                    catalog.Name = "Y" + value;
                    catalog.ColorGroup = "Yellows";
                    catalog.Red = value;
                    catalog.Green = value;
                    db.ColorCatalogs.Add(catalog);
                    value += 5;
                }

                //Greens
                value = 125;
                while (value < 255)
                {
                    ColorCatalog catalog = new ColorCatalog();
                    catalog.ColorSpace = space;
                    catalog.ColorCode = code++;
                    catalog.Name = "G" + value;
                    catalog.ColorGroup = "Greens";
                    catalog.Green = value;
                    db.ColorCatalogs.Add(catalog);
                    value += 5;
                }

                //Purples
                value = 125;
                while (value < 255)
                {
                    ColorCatalog catalog = new ColorCatalog();
                    catalog.ColorSpace = space;
                    catalog.ColorCode = code++;
                    catalog.Name = "P" + value;
                    catalog.ColorGroup = "Purples";
                    catalog.Red = value;
                    catalog.Blue = value;
                    db.ColorCatalogs.Add(catalog);
                    value += 5;
                }

                //Blues
                value = 125;
                while (value < 255)
                {
                    ColorCatalog catalog = new ColorCatalog();
                    catalog.ColorSpace = space;
                    catalog.ColorCode = code++;
                    catalog.Name = "B" + value;
                    catalog.ColorGroup = "Blues";
                    catalog.Blue = value;
                    db.ColorCatalogs.Add(catalog);
                    value += 5;
                }

                db.SaveChanges();

                Console.WriteLine("Twine Catalog Generated!");
                Console.ReadLine();
            }
        }
    }
}