Example #1
0
        public override Grid Load(dynamic b)
        {
            Grid g = base.Load((Historical)b);

            Grid grg = FormCreator.CreateGrid(new Thickness(0, 0, 0, 0));

            grg.Children.Add(FormCreator.CreateLabel("Person", new Thickness(10, 10, 73, 0)));
            grg.Children.Add(FormCreator.CreateTextBox("InpHistBioPerson", b.Person, new Thickness(9, 38, 10, 0)));
            grg.Children.Add(FormCreator.CreateLabel("Years of life", new Thickness(10, 60, 63, 0)));
            grg.Children.Add(FormCreator.CreateTextBox("InpHistBioYears", b.Years, new Thickness(10, 88, 10, 0)));

            GroupBox gr = FormCreator.CreateGroupBox("HistBiographyGroup", "Biography", new Thickness(329, 0, 10, 10), 174, 384);

            gr.Content = grg;

            g.Children.Add(gr);

            GroupBox ftGroupBox           = g.Children.OfType <GroupBox>().First(x => x.Name == "HistoricalGroup");
            IEnumerable <ComboBox> cbList = ((Grid)ftGroupBox.Content).Children.OfType <ComboBox>();
            ComboBox genreComboBox        = cbList.First(x => x.Name == "ChooseHistType");

            genreComboBox.SelectedIndex = 1;

            return(g);
        }
Example #2
0
        public override Grid Load(dynamic f)
        {
            Grid g = base.Load((Fiction)f);

            Grid grg = FormCreator.CreateGrid(new Thickness(0, 0, 0, 0));

            grg.Children.Add(FormCreator.CreateLabel("coWorkers", new Thickness(10, 9, 0, 0)));
            grg.Children.Add(FormCreator.CreateTextBox("InpFictFantCoWorkers", f.CoAuthors, new Thickness(10, 37, 0, 0)));
            grg.Children.Add(FormCreator.CreateLabel("Type", new Thickness(10, 59, 0, 0)));

            ComboBox cb = FormCreator.CreateComboBox("ChooseFictFantType", new Thickness(10, 87, 0, 0), new string[] { "FairyTales", "ScienceFiction" });

            cb.SelectionChanged += new SelectionChangedEventHandler(SelectionChanged);
            grg.Children.Add(cb);

            GroupBox gr = FormCreator.CreateGroupBox("FictFantasticTalesGroup", "Fantastic Tales", new Thickness(329, 0, 0, 0), 171, 361);

            gr.Content = grg;

            g.Children.Add(gr);

            GroupBox fictionGroupBox      = g.Children.OfType <GroupBox>().First(x => x.Name == "FictionGroup");
            IEnumerable <ComboBox> cbList = ((Grid)fictionGroupBox.Content).Children.OfType <ComboBox>();
            ComboBox genreComboBox        = cbList.First(x => x.Name == "ChooseFictType");

            genreComboBox.SelectedIndex = 0;

            return(g);
        }
Example #3
0
        public override Grid Load(dynamic h)
        {
            Grid g = base.Load((Book)h);

            Grid grg = FormCreator.CreateGrid(new Thickness(0, 0, 0, 0));

            grg.Children.Add(FormCreator.CreateLabel("Period", new Thickness(10, 10, 0, 0)));
            grg.Children.Add(FormCreator.CreateTextBox("InpHistPeriod", h.Period, new Thickness(10, 38, 0, 0)));
            grg.Children.Add(FormCreator.CreateLabel("Type", new Thickness(10, 60, 0, 0)));

            ComboBox cb = FormCreator.CreateComboBox("ChooseHistType", new Thickness(10, 88, 0, 0), new string[] { "Art", "Biography" });

            cb.SelectionChanged += new SelectionChangedEventHandler(SelectionChanged);
            grg.Children.Add(cb);

            GroupBox gr = FormCreator.CreateGroupBox("HistoricalGroup", "Historical", new Thickness(155, 0, 0, 0), 174, 361);

            gr.Content = grg;

            g.Children.Add(gr);

            IEnumerable <ComboBox> cbList = g.Children.OfType <ComboBox>();
            ComboBox genreComboBox        = cbList.First(x => x.Name == "ChooseGenre");

            genreComboBox.SelectedIndex = 2;

            return(g);
        }
Example #4
0
        public override Grid Load(dynamic f)
        {
            Grid g = base.Load((Book)f);

            Grid grg = FormCreator.CreateGrid(new Thickness(0, 0, 0, 0));

            grg.Children.Add(FormCreator.CreateLabel("Type (original, fanfiction)", new Thickness(10, 9, 0, 0)));
            grg.Children.Add(FormCreator.CreateTextBox("InpFictType", f.Type, new Thickness(10, 37, 0, 0)));
            grg.Children.Add(FormCreator.CreateLabel("Age limit", new Thickness(10, 59, 0, 0)));
            grg.Children.Add(FormCreator.CreateTextBox("InpFictAge", f.Age, new Thickness(10, 87, 0, 0)));
            grg.Children.Add(FormCreator.CreateLabel("Type", new Thickness(10, 109, 0, 0)));

            ComboBox cb = FormCreator.CreateComboBox("ChooseFictType", new Thickness(10, 138, 0, 0), new string[] { "FantasticTales", "Travelling" });

            cb.SelectionChanged += new SelectionChangedEventHandler(SelectionChanged);
            grg.Children.Add(cb);

            GroupBox gr = FormCreator.CreateGroupBox("FictionGroup", "Fiction", new Thickness(155, 0, 0, 0), 174, 361);

            gr.Content = grg;

            g.Children.Add(gr);

            IEnumerable <ComboBox> cbList = g.Children.OfType <ComboBox>();
            ComboBox genreComboBox        = cbList.First(x => x.Name == "ChooseGenre");

            genreComboBox.SelectedIndex = 1;

            return(g);
        }
Example #5
0
        public virtual Grid Load(dynamic b)
        {
            Grid g = new Grid();

            g.Children.Add(FormCreator.CreateLabel("Author", new Thickness(10, 27, 0, 0)));
            g.Children.Add(FormCreator.CreateTextBox("InpAuthor", b.Author, new Thickness(10, 55, 0, 0)));
            g.Children.Add(FormCreator.CreateLabel("Name", new Thickness(10, 77, 0, 0)));
            g.Children.Add(FormCreator.CreateTextBox("InpName", b.Name, new Thickness(10, 105, 0, 0)));
            g.Children.Add(FormCreator.CreateLabel("Publishing office", new Thickness(10, 128, 0, 0)));
            g.Children.Add(FormCreator.CreateTextBox("InpPublishing", b.PublishingOffice, new Thickness(10, 156, 0, 0)));
            g.Children.Add(FormCreator.CreateLabel("Book genre", new Thickness(10, 183, 0, 0)));

            ComboBox cb = FormCreator.CreateComboBox("ChooseGenre", new Thickness(10, 211, 0, 0), new string[] { "Encyclopedia", "Fiction", "Historical" });

            cb.SelectionChanged += new SelectionChangedEventHandler(SelectionChanged);
            g.Children.Add(cb);

            return(g);
        }
Example #6
0
        public override Grid Load(dynamic e)
        {
            Grid g = base.Load((Book)e);

            Grid grg = FormCreator.CreateGrid(new Thickness(0, 0, 0, 0));

            grg.Children.Add(FormCreator.CreateLabel("Subject", new Thickness(10, 10, 0, 0)));
            grg.Children.Add(FormCreator.CreateTextBox("InpEnSubject", e.Subject, new Thickness(10, 38, 0, 0)));

            GroupBox gr = FormCreator.CreateGroupBox("EncycloGroup", "Encyclopedia", new Thickness(155, 0, 0, 0), 174, 361);

            gr.Content = grg;

            g.Children.Add(gr);

            IEnumerable <ComboBox> cbList = g.Children.OfType <ComboBox>();
            ComboBox genreComboBox        = cbList.First(x => x.Name == "ChooseGenre");

            genreComboBox.SelectedIndex = 0;

            return(g);
        }
Example #7
0
        public override Grid Load(dynamic a)
        {
            Grid g = base.Load((Historical)a);

            Grid grg = FormCreator.CreateGrid(new Thickness(0, 0, 0, 0));

            grg.Children.Add(FormCreator.CreateLabel("Form of art", new Thickness(10, 10, 73, 0)));
            grg.Children.Add(FormCreator.CreateTextBox("InpHistArtForm", a.ArtForm, new Thickness(9, 38, 10, 0)));

            GroupBox gr = FormCreator.CreateGroupBox("HistArtGroup", "Art", new Thickness(329, 0, 10, 10), 174, 384);

            gr.Content = grg;

            g.Children.Add(gr);

            GroupBox ftGroupBox           = g.Children.OfType <GroupBox>().First(x => x.Name == "HistoricalGroup");
            IEnumerable <ComboBox> cbList = ((Grid)ftGroupBox.Content).Children.OfType <ComboBox>();
            ComboBox genreComboBox        = cbList.First(x => x.Name == "ChooseHistType");

            genreComboBox.SelectedIndex = 0;

            return(g);
        }
Example #8
0
        public override Grid Load(dynamic t)
        {
            Grid g = base.Load((Fiction)t);

            Grid grg = FormCreator.CreateGrid(new Thickness(0, 0, 0, 0));

            grg.Children.Add(FormCreator.CreateLabel("Countries", new Thickness(10, 10, 45, 0)));
            grg.Children.Add(FormCreator.CreateTextBox("InpFictTravCountries", t.Countries, new Thickness(10, 38, 9, 10)));

            GroupBox gr = FormCreator.CreateGroupBox("FictTravellingGroup", "Travelling", new Thickness(329, 0, 10, 10), 174, 384);

            gr.Content = grg;

            g.Children.Add(gr);

            GroupBox fictionGroupBox      = g.Children.OfType <GroupBox>().First(x => x.Name == "FictionGroup");
            IEnumerable <ComboBox> cbList = ((Grid)fictionGroupBox.Content).Children.OfType <ComboBox>();
            ComboBox genreComboBox        = cbList.First(x => x.Name == "ChooseFictType");

            genreComboBox.SelectedIndex = 1;

            return(g);
        }