Beispiel #1
0
 private void EditSortFormulas()
 {
     if (File.Exists(mSortStringFileName))
     {
         MessageForm ef = new MessageForm(SystemIcons.Question);
         ef.Text            = "Edit the sort formulas";
         ef.MessageText     = ef.MessageText = File.ReadAllText(mSortStringFileName);
         ef.MessageEditable = true;
         ef.AuxButtonText   = "&Restore Default";
         DialogResult result = ef.ShowDialog(this);
         if (result == DialogResult.OK)
         {
             string res = ef.MessageText.Replace("\r\n", "\n");
             res = res.Replace("\n", Environment.NewLine); // make the text file nice for text editors
             File.WriteAllText(mSortStringFileName, res);
         }
         else if (result == DialogResult.Abort)
         {
             // restore the default sort data
             string res = PlayerSorter.sFormulasString.Replace("\r\n", "\n");
             res = res.Replace("\n", Environment.NewLine); // make the text file nice for text editors
             File.WriteAllText(mSortStringFileName, res);
         }
         ef.Dispose();
     }
     else
     {
         MessageBox.Show(this, "File: " + mSortStringFileName + " does not exist.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #2
0
        private void aboutNFL2K5ToolToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string version =
                System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();

            string content = String.Format(
                @"About NFL2K5Tool
Version {0}

YouTube Tutorial: https://youtu.be/NCqsq_2GqYs 
GitHub: https://github.com/BAD-AL/NFL2K5Tool 
Forum: https://forums.operationsports.com/forums/espn-nfl-2k5-football/881901-nfl2k5tool.html

====== NFL2K5 Related Sites ====== 
NFL2K5 Rosters site: http://nfl2k5rosters.com/
Operation Sports NFL2K5 forum: https://forums.operationsports.com/forums/espn-nfl-2k5-football/
NFL 2K5 Discord Community: https://discord.gg/sBVXzYb

", version);

            ;
            MessageForm form = new MessageForm(System.Drawing.SystemIcons.Information);

            form.Text             = "NFL2K5Tool Version " + version;
            form.MessageText      = content;
            form.ShowCancelButton = false;
            form.ShowDialog();
            form.Dispose();
        }
Beispiel #3
0
        private void listDepthChartsToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            //MessageForm.ShowMessage("Results", Tool.GetDepthCharts(), SystemIcons.Information, false, false);
            Regex       reg = new Regex("(QB),|(RB),|(FB),|(WR),|(TE),|(C),|(G),|(T),|(DE),|(DT),|(OLB),|(ILB),|(CB),|(FS),|(SS),|(K),|(P),|(KR1),|(KR2),|(PR),|(LS),");
            MessageForm mf  = new MessageForm(SystemIcons.Information);

            mf.MessageEditable = false;
            mf.Text            = "Results";
            mf.MessageText     = Tool.GetDepthCharts();
            mf.Colorize(reg, Color.Blue);
            mf.Colorize(new Regex("(#.*)\\n"), Color.Green);
            mf.Colorize(new Regex("(,)"), Color.Fuchsia);
            mf.ShowCancelButton = false;
            mf.ShowDialog();

            mf.Dispose();
        }
Beispiel #4
0
        /// <summary>
        /// Returns the MessageText of the Form
        /// </summary>
        /// <param name="title">The title bar text</param>
        /// <param name="message">The initial message text to display</param>
        /// <param name="icon">the Icon to use</param>
        /// <param name="editable">true to allow the user to edit the MessageText</param>
        /// <returns>The resulting MessageText</returns>
        public static string ShowMessage(string title, string message, Icon icon, bool editable, bool showCancelButton)
        {
            string      retVal = null;
            MessageForm mf     = new MessageForm(icon);

            mf.MessageEditable  = editable;
            mf.Text             = title;
            mf.MessageText      = message;
            mf.ShowCancelButton = showCancelButton;

            if (mf.ShowDialog() == DialogResult.OK)
            {
                retVal = mf.MessageText;
            }
            mf.Dispose();
            return(retVal);
        }