Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="hWndOwner"></param>
        /// <returns></returns>
        protected override bool RunDialog(IntPtr hWndOwner)
        {
            AuthorEditorDialogBox dialogInstance = null;
            bool okTriggered = false;

            try
            {
                dialogInstance       = new AuthorEditorDialogBox();
                dialogInstance.Owner = (Form.FromHandle(hWndOwner) as Form);
                dialogInstance.Entry = this.entry;
                if (dialogInstance.ShowDialog() == DialogResult.OK)
                {
                    okTriggered = true;
                    this.entry  = dialogInstance.Entry;
                    this.Save(this, new AuthorEditorDialogBoxSaveEventArgs(entry));
                }
            }

            finally
            {
                if (dialogInstance != null)
                {
                    dialogInstance.Dispose();
                }
            }
            return(okTriggered);
        }
Ejemplo n.º 2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (ModId != null ? ModId.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ModName != null ? ModName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ModAuthor != null ? ModAuthor.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ModVersion != null ? ModVersion.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ModDescription != null ? ModDescription.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ModDll != null ? ModDll.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ModDependencies != null ? ModDependencies.GetHashCode() : 0);
         return(hashCode);
     }
 }
Ejemplo n.º 3
0
 public void TestToString()
 {
     string[] inputArray = { "smithy_dll < n/a > (David Smith) http://phpbbstuff.ddblog.org",
                             "smithy_dll < n/a > (David Smith) http://david.smigit.com",
                             "wGEric < *****@*****.** > (Eric Faerber) http://mods.best-dev.com",
                             "wGEric < n/a > (Eric Faerber) http://mods.best-dev.com",
                             "wGEric < *****@*****.** > (n/a) http://mods.best-dev.com",
                             "wGEric < n/a > (Eric Faerber) n/a",
                             "wGEric < n/a > (n/a) n/a",
                             "ycl6 < n/a > (Y C Lin) http://macphpbbmod.sourceforge.net/",
                             "jwacalex < *****@*****.** > (Alexander Böhm) http://www.s8d.de",
                             "damnian < damnian-no-spam at damnian dot com > (Dmitry Shechtman) http://damnian.com/dev",
                             "I'm Only 16 < n/a > (n/a) n/a",
                             "Evil<3 < n/a > (n/a) n/a",
                             "Afterlife(69) < n/a > (n/a) n/a" };
     foreach (string input in inputArray)
     {
         ModAuthor ma     = ModAuthor.Parse("## MOD Author: " + input);
         string    output = ma.ToString();
         Assert.AreEqual(input, output);
     }
     foreach (string input in inputArray)
     {
         ModAuthor ma     = ModAuthor.Parse("## MOD Author:		"+ input);
         string    output = ma.ToString();
         Assert.AreEqual(input, output);
     }
     foreach (string input in inputArray)
     {
         ModAuthor ma     = ModAuthor.Parse("## MOD Author, Secondary: " + input);
         string    output = ma.ToString();
         Assert.AreEqual(input, output);
     }
     foreach (string input in inputArray)
     {
         ModAuthor ma     = ModAuthor.Parse(input);
         string    output = ma.ToString();
         Assert.AreEqual(input, output);
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="entry"></param>
 public AuthorEditorDialogBoxSaveEventArgs(ModAuthor entry)
 {
     Entry = entry;
 }
Ejemplo n.º 5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="username"></param>
 /// <param name="realname"></param>
 /// <param name="email"></param>
 /// <param name="website"></param>
 public AuthorEditorDialogBoxSaveEventArgs(string username, string realname, string email, string website)
 {
     Entry = new ModAuthor(username, realname, email, website);
 }
Ejemplo n.º 6
0
 /// <summary>
 ///
 /// </summary>
 public override void Reset()
 {
     this.index = -1;
     this.entry = new ModAuthor();
 }