コード例 #1
0
ファイル: HeroListForm.cs プロジェクト: cmdrmander/Manderplan
 private void Import_iPlay4e_Party_Click(object sender, EventArgs e)
 {
     try
     {
         HeroIPlay4eForm heroIPlay4eForm = new HeroIPlay4eForm("", false);
         if (heroIPlay4eForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
             List <Hero> heros = AppImport.ImportParty(heroIPlay4eForm.Key);
             System.Windows.Forms.Cursor.Current = Cursors.Default;
             foreach (Hero hero in heros)
             {
                 this.add_hero(hero);
             }
             this.update_view();
             if (heros.Count == 0)
             {
                 MessageBox.Show("No characters were found (make sure they are public).", "Masterplan", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
             }
         }
     }
     catch (Exception exception)
     {
         LogSystem.Trace(exception);
     }
 }
コード例 #2
0
ファイル: HeroListForm.cs プロジェクト: cmdrmander/Manderplan
        private void edit_iplay4e()
        {
            List <Hero>     heros           = (Session.Project.Heroes.Contains(this.SelectedHero) ? Session.Project.Heroes : Session.Project.InactiveHeroes);
            int             num             = heros.IndexOf(this.SelectedHero);
            HeroIPlay4eForm heroIPlay4eForm = new HeroIPlay4eForm(this.SelectedHero.Key, true);

            if (heroIPlay4eForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Hero hero = new Hero()
                {
                    Key = heroIPlay4eForm.Key
                };
                System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
                bool flag = AppImport.ImportIPlay4e(hero);
                System.Windows.Forms.Cursor.Current = Cursors.Default;
                if (flag)
                {
                    heros[num]       = hero;
                    Session.Modified = true;
                    this.update_view();
                }
            }
        }
コード例 #3
0
ファイル: HeroListForm.cs プロジェクト: cmdrmander/Manderplan
 private void Import_iPlay4e_Click(object sender, EventArgs e)
 {
     try
     {
         HeroIPlay4eForm heroIPlay4eForm = new HeroIPlay4eForm("", true);
         if (heroIPlay4eForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             Hero hero = new Hero()
             {
                 Key = heroIPlay4eForm.Key
             };
             System.Windows.Forms.Cursor.Current = Cursors.WaitCursor;
             bool flag = AppImport.ImportIPlay4e(hero);
             System.Windows.Forms.Cursor.Current = Cursors.Default;
             if (!flag)
             {
                 string str = string.Concat("The character could not be found.", Environment.NewLine);
                 str = string.Concat(str, Environment.NewLine);
                 str = string.Concat(str, "Make sure:");
                 str = string.Concat(str, Environment.NewLine);
                 str = string.Concat(str, "* The key is correct");
                 str = string.Concat(str, Environment.NewLine);
                 str = string.Concat(str, "* The character is public");
                 MessageBox.Show(str, "Masterplan", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
             }
             else
             {
                 this.add_hero(hero);
                 this.update_view();
             }
         }
     }
     catch (Exception exception)
     {
         LogSystem.Trace(exception);
     }
 }