Example #1
0
        private void saveConfigurationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GlobalStatus = new FinalGlobalStatus();

            for(int IdxCtrl=0;IdxCtrl<ListFormForControl.Count;IdxCtrl++)
            {

                GlobalStatus.GlobalStatus.Add(ListFormForControl.ElementAt(ListFormForControl.Count - IdxCtrl-1).GenerateCurrentStatus());
            }

            SaveFileDialog CurrSaveFileDialog = new SaveFileDialog();
            CurrSaveFileDialog.Filter = "binary files (*.xml)|*.xml";
            System.Windows.Forms.DialogResult Res = CurrSaveFileDialog.ShowDialog();
            if (Res != System.Windows.Forms.DialogResult.OK) return;
            string PathName = CurrSaveFileDialog.FileName;

            GlobalStatus.Save(PathName);
        }
Example #2
0
        private void loadConfigurationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog CurrOpenFileDialog = new OpenFileDialog();
            CurrOpenFileDialog.Filter = "binary files (*.xml)|*.xml";
            System.Windows.Forms.DialogResult Res = CurrOpenFileDialog.ShowDialog();
            if (Res != System.Windows.Forms.DialogResult.OK) return;
            string fileName = CurrOpenFileDialog.FileName;

            GlobalStatus = new FinalGlobalStatus();
               GlobalStatus = GlobalStatus.Load(fileName);

            ListFormForControl.Clear();
            ListCtrl.Clear();
            panelFor3DControls.Controls.Clear();

            for (int IdxNewObj = 0; IdxNewObj < GlobalStatus.GlobalStatus.Count; IdxNewObj++)
            {
                FormForControl CurrentFormFor3DObject = new FormForControl(this, GlobalStatus.GlobalStatus[IdxNewObj]);

                CurrentFormFor3DObject.ImList = imageListForThumbnail;
                CurrentFormFor3DObject.panelGroup.Location = new Point(0, IdxNewObj * CurrentFormFor3DObject.panelGroup.Height /*- panelFor3DControls.VerticalScroll.Value*/);
                CurrentFormFor3DObject.panelGroup.Text = "Object " + IdxNewObj;
                CurrentFormFor3DObject.textBoxName.Text = "Object " + IdxNewObj;

               // CurrentFormFor3DObject.panelGroup.BackgroundImage = ImageToDisp;
                CurrentFormFor3DObject.panelGroup.BackgroundImageLayout = ImageLayout.None;
                CurrentFormFor3DObject.Parent = this;

                ListFormForControl.Push(CurrentFormFor3DObject);
                ListCtrl.Push(CurrentFormFor3DObject.panelGroup);
            }

            panelFor3DControls.Controls.AddRange(ListCtrl.ToArray());
            textBoxNumberOfObjects.Text = panelFor3DControls.Controls.Count.ToString();
            UpDateContainers();
            UpDateSpotList();
        }