Exemple #1
0
        private void AddModelPanel(ModelInfo model)
        {
            var designPanel = new DesignPanel();

            designPanel.SetModel(model);

            AddModelPanel(designPanel);
        }
Exemple #2
0
        private void AddModelPanel(DesignPanel designPanel)
        {
            var page = new TabPage(designPanel.Text);

            page.Controls.Add(designPanel);
            designPanel.Dock         = DockStyle.Fill;
            designPanel.DataUpdated += (sender, args) => SetChangedState();

            modelsTabSwitch.TabPages.Add(page);

            designPanel.Initialize();
        }
Exemple #3
0
        private void LoadFile(string fname)
        {
            if (!File.Exists(fname))
            {
                return;
            }

            XDocument file;

            using (var reader = File.OpenText(fname))
            {
                file = XDocument.Load(reader);
            }

            modelsTabSwitch.TabPages.Clear();
            FRAMMapper.Clear();
            __JoyInfos.Clear();

            __JoyInfos.AddRange(JoystickConfig.LoadFromXML(file));
            __Settings = ProjectSettings.LoadFromXML(file) ?? new ProjectSettings();

            if (file.Root != null)
            {
                var xmodels = file.Root.Element("Models");

                if (xmodels != null)
                {
                    foreach (var xElement in xmodels.Elements())
                    {
                        var panel = new DesignPanel();
                        panel.Deserialize(xElement);
                        AddModelPanel(panel);
                    }

                    foreach (var panel in Panels)
                    {
                        panel.Link();
                    }
                }
            }

            CurrentFileName = fname;

            AddFileToLastFiles(fname);
            SaveLastList();
            SetFileState();
            SetSavedState();
            UpdateJoystics();
        }
Exemple #4
0
        public void ActivateTab(DesignPanel panel)
        {
            var tab = (TabPage)panel.Parent;

            modelsTabSwitch.SelectTab(tab);
        }