コード例 #1
0
ファイル: Session.cs プロジェクト: cmdrmander/Manderplan
        public static Masterplan.Data.Project LoadBackup(string filename)
        {
            Masterplan.Data.Project project = null;
            try
            {
                Assembly entryAssembly = Assembly.GetEntryAssembly();
                string   str           = string.Concat(Utils.FileName.Directory(entryAssembly.Location), "Backup\\");
                if (!Directory.Exists(str))
                {
                    Directory.CreateDirectory(str);
                }
                string str1 = string.Concat(str, Utils.FileName.Name(filename));
                if (File.Exists(str1))
                {
                    project = Serialisation <Masterplan.Data.Project> .Load(str1, SerialisationMode.Binary);

                    if (project != null)
                    {
                        MessageBox.Show("There was a problem opening this project; it has been recovered from its most recent backup version.", "Masterplan", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    }
                }
            }
            catch (Exception exception)
            {
                LogSystem.Trace(exception);
            }
            return(project);
        }
コード例 #2
0
ファイル: Session.cs プロジェクト: cmdrmander/Manderplan
        public static bool CheckPassword(Masterplan.Data.Project p)
        {
            if (p.Password == null || p.Password == "")
            {
                return(true);
            }
            PasswordCheckForm passwordCheckForm = new PasswordCheckForm(p.Password, p.PasswordHint);

            return(passwordCheckForm.ShowDialog() == DialogResult.OK);
        }
コード例 #3
0
 public ProjectForm(Masterplan.Data.Project p)
 {
     this.InitializeComponent();
     this.fProject       = p;
     this.NameBox.Text   = this.fProject.Name;
     this.AuthorBox.Text = this.fProject.Author;
     this.SizeBox.Value  = this.fProject.Party.Size;
     this.LevelBox.Value = this.fProject.Party.Level;
     this.LevelBox_ValueChanged(null, null);
     this.XPBox.Value = this.fProject.Party.XP;
 }
コード例 #4
0
ファイル: Session.cs プロジェクト: cmdrmander/Manderplan
 static Session()
 {
     Session.fProject           = null;
     Session.fPreferences       = new Masterplan.Preferences();
     Session.fPlayerView        = null;
     Session.fModified          = false;
     Session.fFileName          = "";
     Session.fRandom            = new System.Random();
     Session.fAddIns            = new List <IAddIn>();
     Session.Libraries          = new List <Library>();
     Session.fMainForm          = null;
     Session.fCurrentEncounter  = null;
     Session.fDisabledLibraries = new List <string>();
 }