Beispiel #1
0
        public void saveFigures(object sender, EventArgs e)
        {
            SaveFileDialog dlgSave = new SaveFileDialog();

            string[] ext = { "JSON (*.json)|*.json", "XML (*.xml) | *.xml", "YAML (*.yaml)|*.yaml", "BIN (*.bin)|*.bin", "CSV (*.csv)|*.csv" };
            dlgSave.Filter = String.Join("|", ext);
            if (dlgSave.ShowDialog() == DialogResult.OK)
            {
                SOFactory.GetInstance(dlgSave.FileName).Save(pdraw.Figures);
            }
        }
Beispiel #2
0
        public void openFigures(object sender, EventArgs e)
        {
            OpenFileDialog dlgOpen = new OpenFileDialog();
            string         ext     = "SO (*.json; *.xml; *.yaml; *.bin; *.csv)| *.json; *.xml; *.yaml; *.bin; *.csv";

            dlgOpen.Filter = ext;
            if (dlgOpen.ShowDialog() == DialogResult.OK)
            {
                pdraw.Figures = SOFactory.GetInstance(dlgOpen.FileName).Open();
                pdraw.Redraw();
            }
        }
        public void openFigures(object sender, EventArgs e)
        {
            OpenFileDialog dlgOpen = new OpenFileDialog();
            string         ext     = "SO (*.json; *.xml; *.yaml; *.bin; *.csv)| *.json; *.xml; *.yaml; *.bin; *.csv";

            dlgOpen.Filter = ext;
            if (dlgOpen.ShowDialog() == DialogResult.OK)
            {
                PTabPage activeTab = tabControl.SelectedTab as PTabPage;
                activeTab.pdraw.Figures = SOFactory.GetInstance(dlgOpen.FileName).Open();
                activeTab.pdraw.Redraw();
                activeTab.Name = Path.GetFileName(dlgOpen.FileName);
                activeTab.Text = Path.GetFileName(dlgOpen.FileName);
            }
        }
        public void saveFigures(object sender, EventArgs e)
        {
            SaveFileDialog dlgSave = new SaveFileDialog();

            string[] ext = { "JSON (*.json)|*.json", "XML (*.xml) | *.xml", "YAML (*.yaml)|*.yaml", "BIN (*.bin)|*.bin", "CSV (*.csv)|*.csv" };
            dlgSave.Filter = String.Join("|", ext);
            if (dlgSave.ShowDialog() == DialogResult.OK)
            {
                PTabPage activeTab = tabControl.SelectedTab as PTabPage;
                SOFactory.GetInstance(dlgSave.FileName).Save(activeTab.pdraw.Figures);
                activeTab.path = dlgSave.FileName;
                activeTab.Name = Path.GetFileName(activeTab.path);
                activeTab.Text = Path.GetFileName(activeTab.path);
            }
        }