private void OpenSibFileOK(object sender, CancelEventArgs e)
 {
     try
     {
         _model = null;
         _model = InstallModel.Deserialize(openSibFileDialog.FileName);
         _currentOpenedFilePath = openSibFileDialog.FileName;
         this.packagesListControl1.SetModel(_model);
     }
     catch (Exception ex)
     {
         MessageBox.Show("There was an error when restoring the configuration.  " + ex);
     }
 }
        /// <summary>
        /// event when File New is accessed
        /// </summary>
        private void NewProject_click(object sender, EventArgs e)
        {
            openSibFileDialog.FileName = UserSettings.Default.LastSavedProjectFilePath;

            var message = "Changes that you have not saved will be lost if you create another project file, do you want to continue?";
            var caption = "Create a new project?";

            if (_model != null && _model.Items.Count > 0)

            {
                if (MessageBox.Show(message, caption, MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    _model = new InstallModel();
                }
            }
            else
            {
                _model = new InstallModel();
            }

            this.packagesListControl1.SetModel(_model);
        }
Esempio n. 3
0
 public frmNewPackage(InstallModel model)
 {
     _model = model;
     InitializeComponent();
     ConfigureEvents();
 }