Ejemplo n.º 1
0
        private void AddModelPanel(ModelInfo model)
        {
            var designPanel = new DesignPanel();

            designPanel.SetModel(model);

            AddModelPanel(designPanel);
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 4
0
        public void ActivateTab(DesignPanel panel)
        {
            var tab = (TabPage)panel.Parent;

            modelsTabSwitch.SelectTab(tab);
        }