Пример #1
0
        public void Open(object caller, string who)
        {
            switch (who)
            {
            case "lecture":
                var calling = new LecturesPanel(Connector.connections[0].GetCourse(courses[panel1.Controls.IndexOf((CourseDataPanel)caller)].ID).ID, "course", this)
                {
                    Anchor = AnchorStyles.Top | AnchorStyles.Bottom
                };
                calling.Size = this.Size;
                this.Controls.Add(calling);
                calling.BringToFront();
                break;

            case "section":
                var calling1 = new SectionsPanel(Connector.connections[0].GetCourse(courses[panel1.Controls.IndexOf((CourseDataPanel)caller)].ID).ID, "course", this)
                {
                    Anchor = AnchorStyles.Top | AnchorStyles.Bottom
                };
                calling1.Size = this.Size;
                this.Controls.Add(calling1);
                calling1.BringToFront();
                break;

            case "book":
                var calling2 = new BooksPanel(Connector.connections[0].GetCourse(courses[panel1.Controls.IndexOf((CourseDataPanel)caller)].ID).ID, "course", this)
                {
                    Anchor = AnchorStyles.Top | AnchorStyles.Bottom
                };
                calling2.Size = this.Size;
                this.Controls.Add(calling2);
                calling2.BringToFront();
                break;

            case "instructor":
                var calling3 = new InstructorPanel(Connector.connections[0].GetCourse(courses[panel1.Controls.IndexOf((CourseDataPanel)caller)].ID).ID, "course", this)
                {
                    Anchor = AnchorStyles.Top | AnchorStyles.Bottom
                };
                calling3.Size = this.Size;
                this.Controls.Add(calling3);
                calling3.BringToFront();
                break;

            case "material":
                var calling4 = new MaterialPanel(Connector.connections[0].GetCourse(courses[panel1.Controls.IndexOf((CourseDataPanel)caller)].ID).ID, "course", this)
                {
                    Anchor = AnchorStyles.Top | AnchorStyles.Bottom
                };
                calling4.Size = this.Size;
                this.Controls.Add(calling4);
                calling4.BringToFront();
                break;
            }
        }
Пример #2
0
 void Initialize()
 {
     newcoursepanel = new CoursePanel()
     {
         Size = mainpl.Size, Dock = DockStyle.Fill
     };
     mainpl.Controls.Add(newcoursepanel);
     newinstructorpanel = new InstructorPanel()
     {
         Size = mainpl.Size, Dock = DockStyle.Fill
     };
     mainpl.Controls.Add(newinstructorpanel);
     newmaterialpanel = new MaterialPanel()
     {
         Size = mainpl.Size, Dock = DockStyle.Fill
     };
     mainpl.Controls.Add(newmaterialpanel);
     newlecturepanel = new LecturesPanel()
     {
         Size = mainpl.Size, Dock = DockStyle.Fill
     };
     mainpl.Controls.Add(newlecturepanel);
     newsectionpanel = new SectionsPanel()
     {
         Size = mainpl.Size, Dock = DockStyle.Fill
     };
     mainpl.Controls.Add(newsectionpanel);
     newbookpanel = new BooksPanel()
     {
         Size = mainpl.Size, Dock = DockStyle.Fill
     };
     mainpl.Controls.Add(newbookpanel);
     newabout = new About()
     {
         Size = mainpl.Size, Dock = DockStyle.Fill
     };
     mainpl.Controls.Add(newabout);
 }
    protected override void InitPanels()
    {
        base.InitPanels();

        #region Auto_Generated_Code_Placement_Init
        MenuPanel     = new MenuPanel(dataPanelDict["MenuPanel"], dataMenuPanel, PanelTypes.Main);
        ChildrenPanel = new ChildrenPanel(dataPanelDict["ChildrenPanel"], dataChildrenPanel, PanelTypes.Main);
        AddChildPanel = new AddChildPanel(dataPanelDict["AddChildPanel"], dataAddChildPanel, PanelTypes.Secondary);
        InfoPanel     = new InfoPanel(dataPanelDict["InfoPanel"], DataInfoPanel, PanelTypes.Secondary);

        Panel statsPanel    = new StatsPanel(dataPanelDict["StatsPanel"], dataStatsPanel, PanelTypes.Main);
        Panel levelsPanel   = new LevelsPanel(dataPanelDict["LevelsPanel"], dataSetLevelsPanel, PanelTypes.Main);
        Panel sectionsPanel = new SectionsPanel(dataPanelDict["SectionsPanel"], dataSectionsPanel, PanelTypes.Main);
        Panel missionsPanel = new MissionsPanel(dataPanelDict["MissionsPanel"], dataSetMissionsPanel, PanelTypes.Main);
        Panel settingsPanel = new SettingsPanel(dataPanelDict["SettingsPanel"], dataSettingsPanel, PanelTypes.Secondary);
        Panel exitPanel     = new ExitPanel(dataPanelDict["ExitPanel"], dataExitPanel, PanelTypes.Secondary);

        UiTransitionDict = new Dictionary <Panel, Dictionary <Panel, TransitionTypes> >
        {
            {
                MenuPanel,
                new Dictionary <Panel, TransitionTypes>
                {
                    { statsPanel, TransitionTypes.Hard },
                    { ChildrenPanel, TransitionTypes.Hard },
                    { sectionsPanel, TransitionTypes.Hard },
                    { exitPanel, TransitionTypes.Soft },
                    { settingsPanel, TransitionTypes.Soft }
                }
            },
            {
                statsPanel,
                new Dictionary <Panel, TransitionTypes>
                {
                    { MenuPanel, TransitionTypes.Hard },
                }
            },
            {
                ChildrenPanel,
                new Dictionary <Panel, TransitionTypes>
                {
                    { MenuPanel, TransitionTypes.Hard },
                    { AddChildPanel, TransitionTypes.Soft }
                }
            },
            {
                AddChildPanel,
                new Dictionary <Panel, TransitionTypes>
                {
                }
            },
            {
                settingsPanel,
                new Dictionary <Panel, TransitionTypes>
                {
                    { MenuPanel, TransitionTypes.Normal },
                }
            },
            {
                InfoPanel,
                new Dictionary <Panel, TransitionTypes>
                {
                    { missionsPanel, TransitionTypes.Normal },
                    { levelsPanel, TransitionTypes.Normal }
                }
            },
            {
                exitPanel,
                new Dictionary <Panel, TransitionTypes>
                {
                    { MenuPanel, TransitionTypes.Hard },
                }
            },
            {
                sectionsPanel,
                new Dictionary <Panel, TransitionTypes>
                {
                    { MenuPanel, TransitionTypes.Hard },
                    { missionsPanel, TransitionTypes.Hard }
                }
            },
            {
                missionsPanel,
                new Dictionary <Panel, TransitionTypes>
                {
                    { sectionsPanel, TransitionTypes.Hard },
                    { levelsPanel, TransitionTypes.Hard },
                    { InfoPanel, TransitionTypes.Soft }
                }
            },
            {
                levelsPanel,
                new Dictionary <Panel, TransitionTypes>
                {
                    { missionsPanel, TransitionTypes.Hard },
                    { InfoPanel, TransitionTypes.Soft }
                }
            },
        };

        #endregion
    }