예제 #1
0
 private void openToolStripMenuItem_Click(object sender, EventArgs e)
 {
     currentHandler = null;
     openDeserializeFileDialog.Title  = "Open UML File";
     openDeserializeFileDialog.Filter = "UML files(*.uml)|*.uml";
     if (openDeserializeFileDialog.ShowDialog() == DialogResult.OK)
     {
         string fileData = SaveOrLoad.OpenFile(openDeserializeFileDialog.FileName);
         JsonDeserialized(fileData);
         canvas.RedrawElementsFromElementsList();
         pictureBox1.Invalidate();
         colorButton.BackColor = Color.White;
     }
 }
예제 #2
0
        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            DialogResult result = MessageBox.Show("Save the changes?", "Mesage", MessageBoxButtons.YesNo);

            if (result == DialogResult.Yes)
            {
                saveSerializeFileDialog.Title  = "Save UML File";
                saveSerializeFileDialog.Filter = "UML files(*.uml)|*.uml";
                if (saveSerializeFileDialog.ShowDialog() == DialogResult.OK)
                {
                    string fileData = JsonSerialized();
                    SaveOrLoad.SaveFile(saveSerializeFileDialog.FileName, fileData);
                }
            }
        }
예제 #3
0
        private void uMLToolStripMenuItem_Click(object sender, EventArgs e)
        {
            saveSerializeFileDialog.Title  = "Save UML File";
            saveSerializeFileDialog.Filter = "UML files(*.uml)|*.uml";
            if (saveSerializeFileDialog.ShowDialog() == DialogResult.OK)
            {
                if (saveSerializeFileDialog.FileName != string.Empty)
                {
                    string fileData = JsonSerialized();
                    SaveOrLoad.SaveFile(saveSerializeFileDialog.FileName, fileData);
                }
            }

            currentHandler = null;
        }