Exemplo n.º 1
0
        private void GenerateButton_Click(object sender, RoutedEventArgs e)
        {
            switch (Language.SelectedItem)
            {
            case Languages.HTML:
                HTMLComponentFactory f = new HTMLComponentFactory();
                f.Run(comps);
                break;

            case Languages.WPF:
                WPFComponentFactory w = new WPFComponentFactory();
                w.Run(comps);
                break;

            default:
                break;
            }
        }
Exemplo n.º 2
0
        private void AddButton_Click(object sender, RoutedEventArgs e)
        {
            int    height  = Int32.Parse(Height.Text);
            int    width   = Int32.Parse(Width.Text);
            int    left    = Int32.Parse(Left.Text);
            int    top     = Int32.Parse(Top.Text);
            string content = Content.Text;

            if (Language.SelectedItem.Equals(Languages.HTML))
            {
                HTMLComponentFactory f = new HTMLComponentFactory();
                comps.Add(f.CreateComponent((Components)Component.SelectedItem, height, width, left, top, content));
            }
            else if (Language.SelectedItem.Equals(Languages.WPF))
            {
                WPFComponentFactory f  = new WPFComponentFactory();
                Components          ec = (Components)Enum.Parse(typeof(Components), Component.SelectedItem.ToString());
                comps.Add(f.CreateComponent(ec, height, width, left, top, content));
            }
            ComponentList.ItemsSource = comps;
        }