Exemplo n.º 1
0
        public ECCAProject(string pathName)
        {
            if (File.Exists(pathName))
            {
                ECCAProject bufferProject = DeSerializeProject(pathName);

                ProjectInfo       = bufferProject.ProjectInfo;
                ElementCollection = bufferProject.ElementCollection;
                BeamCollection    = bufferProject.BeamCollection;
                FileLocation      = bufferProject.FileLocation;
            }
            else
            {
                ProjectInfo       = new ECCAPojectInfo();
                ElementCollection = new ECCAElementCollection();
                BeamCollection    = new ECCABeamCollection();
                FileLocation      = "";
                //A new File will be saved to requested path:

                DialogResult var = MessageBox.Show("A projectfile could not be found, Shall I attempt to create one ?", "Warning", MessageBoxButtons.YesNo);
                if (var == DialogResult.Yes)
                {
                    bool saveallok = SerializeProject(pathName);
                    if (saveallok == true)
                    {
                        MessageBox.Show("A new project file was created");
                    }
                }
            }
        }
Exemplo n.º 2
0
 public ECCAProject()
 {
     ProjectInfo       = new ECCAPojectInfo();
     ElementCollection = new ECCAElementCollection();
     BeamCollection    = new ECCABeamCollection();
     FileLocation      = "";
 }