Ejemplo n.º 1
0
        internal override void Entry()
        {
            //   ITheme theme = new GenericTheme();
            //   ITheme theme = new HalloweenTheme();
            ITheme theme = new CoolBlueTheme();

            foreach (Canvas c in m.canvases)
            {
                //Load theme

                DrawingThread temp = new DrawingThread(c);
                m.AddObserver(temp);
                m.theme.loadTheme(temp);
                //   theme.loadTheme(temp);
                Thread.Sleep(1000);


                //// create new DrawingThread
                //DrawingThread temp = new DrawingThread(c);
                //// register it
                //m.AddObserver(temp);
                //// Thread it
                //Thread t = new Thread(new ThreadStart(temp.DrawShapes));
                //// start Thread
                //t.Start();
            }
        }
Ejemplo n.º 2
0
        public void loadTheme(DrawingThread temp)
        {
            // create new DrawingThread
            // DrawingThread temp = new DrawingThread(c);
            //set thread's available shapes
            string[] shapes = { "Rectangle", "Ellipse" };
            temp.shapes = shapes;
            //set thread's available colors
            Color[] colors = { Color.FromArgb(255, 0, 0), Color.FromArgb(0, 255, 0), Color.FromArgb(0, 0, 255) }; //temporarily red for testing
            temp.colors = colors;

            // register it
            //    m.AddObserver(temp);
            // Thread it
            Thread t = new Thread(new ThreadStart(temp.DrawShapes));

            // start Thread
            t.Start();
        }