Beispiel #1
0
        private void Browser_Navigating(object sender, WebBrowserNavigatingEventArgs e)
        {
            if (e.Url.Scheme == "build")
            {
                if (e.Url.LocalPath == "profile")
                {
                    e.Cancel = true;

                    MagicItemProfileForm dlg = new MagicItemProfileForm(fMagicItem);
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        fMagicItem.Name   = dlg.MagicItem.Name;
                        fMagicItem.Level  = dlg.MagicItem.Level;
                        fMagicItem.Type   = dlg.MagicItem.Type;
                        fMagicItem.Rarity = dlg.MagicItem.Rarity;

                        update_statblock();
                    }
                }

                if (e.Url.LocalPath == "desc")
                {
                    e.Cancel = true;

                    DetailsForm dlg = new DetailsForm(fMagicItem.Description, "Description", null);
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        fMagicItem.Description = dlg.Details;
                        update_statblock();
                    }
                }
            }

            if (e.Url.Scheme == "section")
            {
                e.Cancel = true;

                if (e.Url.LocalPath == "new")
                {
                    MagicItemSection section = new MagicItemSection();
                    section.Header = "New Section";

                    MagicItemSectionForm dlg = new MagicItemSectionForm(section);
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        fMagicItem.Sections.Add(dlg.Section);
                        update_statblock();
                    }
                }
            }

            if (e.Url.Scheme == "edit")
            {
                e.Cancel = true;

                int index = int.Parse(e.Url.LocalPath);

                MagicItemSectionForm dlg = new MagicItemSectionForm(fMagicItem.Sections[index]);
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    fMagicItem.Sections[index] = dlg.Section;
                    update_statblock();
                }
            }

            if (e.Url.Scheme == "remove")
            {
                e.Cancel = true;

                int index = int.Parse(e.Url.LocalPath);

                fMagicItem.Sections.RemoveAt(index);
                update_statblock();
            }

            if (e.Url.Scheme == "moveup")
            {
                e.Cancel = true;

                int index = int.Parse(e.Url.LocalPath);

                MagicItemSection tmp = fMagicItem.Sections[index - 1];
                fMagicItem.Sections[index - 1] = fMagicItem.Sections[index];
                fMagicItem.Sections[index]     = tmp;

                update_statblock();
            }

            if (e.Url.Scheme == "movedown")
            {
                e.Cancel = true;

                int index = int.Parse(e.Url.LocalPath);

                MagicItemSection tmp = fMagicItem.Sections[index + 1];
                fMagicItem.Sections[index + 1] = fMagicItem.Sections[index];
                fMagicItem.Sections[index]     = tmp;

                update_statblock();
            }
        }
 private void Browser_Navigating(object sender, WebBrowserNavigatingEventArgs e)
 {
     if (e.Url.Scheme == "build")
     {
         if (e.Url.LocalPath == "profile")
         {
             e.Cancel = true;
             ArtifactProfileForm artifactProfileForm = new ArtifactProfileForm(this.fArtifact);
             if (artifactProfileForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 this.fArtifact.Name = artifactProfileForm.Artifact.Name;
                 this.fArtifact.Tier = artifactProfileForm.Artifact.Tier;
                 this.update_statblock();
             }
         }
         if (e.Url.LocalPath == "description")
         {
             e.Cancel = true;
             DetailsForm detailsForm = new DetailsForm(this.fArtifact.Description, "Description", null);
             if (detailsForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 this.fArtifact.Description = detailsForm.Details;
                 this.update_statblock();
             }
         }
         if (e.Url.LocalPath == "details")
         {
             e.Cancel = true;
             DetailsForm detailsForm1 = new DetailsForm(this.fArtifact.Details, "Details", null);
             if (detailsForm1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 this.fArtifact.Details = detailsForm1.Details;
                 this.update_statblock();
             }
         }
         if (e.Url.LocalPath == "goals")
         {
             e.Cancel = true;
             DetailsForm detailsForm2 = new DetailsForm(this.fArtifact.Goals, "Goals", null);
             if (detailsForm2.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 this.fArtifact.Goals = detailsForm2.Details;
                 this.update_statblock();
             }
         }
         if (e.Url.LocalPath == "rp")
         {
             e.Cancel = true;
             DetailsForm detailsForm3 = new DetailsForm(this.fArtifact.RoleplayingTips, "Roleplaying", null);
             if (detailsForm3.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 this.fArtifact.RoleplayingTips = detailsForm3.Details;
                 this.update_statblock();
             }
         }
     }
     if (e.Url.Scheme == "section")
     {
         if (e.Url.LocalPath == "new")
         {
             e.Cancel = true;
             MagicItemSectionForm magicItemSectionForm = new MagicItemSectionForm(new MagicItemSection());
             if (magicItemSectionForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 this.fArtifact.Sections.Add(magicItemSectionForm.Section);
                 this.update_statblock();
             }
         }
         if (e.Url.LocalPath.Contains(",new"))
         {
             e.Cancel = true;
             try
             {
                 string str = e.Url.LocalPath.Substring(0, e.Url.LocalPath.IndexOf(","));
                 int    num = int.Parse(str);
                 ArtifactConcordance  item = this.fArtifact.ConcordanceLevels[num];
                 MagicItemSectionForm magicItemSectionForm1 = new MagicItemSectionForm(new MagicItemSection());
                 if (magicItemSectionForm1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                 {
                     item.Sections.Add(magicItemSectionForm1.Section);
                     this.update_statblock();
                 }
             }
             catch
             {
             }
         }
     }
     if (e.Url.Scheme == "sectionedit")
     {
         if (!e.Url.LocalPath.Contains(","))
         {
             e.Cancel = true;
             try
             {
                 int section = int.Parse(e.Url.LocalPath);
                 MagicItemSectionForm magicItemSectionForm2 = new MagicItemSectionForm(this.fArtifact.Sections[section]);
                 if (magicItemSectionForm2.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                 {
                     this.fArtifact.Sections[section] = magicItemSectionForm2.Section;
                     this.update_statblock();
                 }
             }
             catch
             {
             }
         }
         else
         {
             e.Cancel = true;
             int    num1 = e.Url.LocalPath.IndexOf(",");
             string str1 = e.Url.LocalPath.Substring(0, num1);
             string str2 = e.Url.LocalPath.Substring(num1);
             try
             {
                 int num2     = int.Parse(str1);
                 int section1 = int.Parse(str2);
                 ArtifactConcordance  artifactConcordance   = this.fArtifact.ConcordanceLevels[num2];
                 MagicItemSectionForm magicItemSectionForm3 = new MagicItemSectionForm(artifactConcordance.Sections[section1]);
                 if (magicItemSectionForm3.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                 {
                     artifactConcordance.Sections[section1] = magicItemSectionForm3.Section;
                     this.update_statblock();
                 }
             }
             catch
             {
             }
         }
     }
     if (e.Url.Scheme == "sectionremove")
     {
         if (!e.Url.LocalPath.Contains(","))
         {
             e.Cancel = true;
             try
             {
                 int num3 = int.Parse(e.Url.LocalPath);
                 this.fArtifact.Sections.RemoveAt(num3);
                 this.update_statblock();
             }
             catch
             {
             }
         }
         else
         {
             e.Cancel = true;
             int    num4 = e.Url.LocalPath.IndexOf(",");
             string str3 = e.Url.LocalPath.Substring(0, num4);
             string str4 = e.Url.LocalPath.Substring(num4);
             try
             {
                 int num5 = int.Parse(str3);
                 int num6 = int.Parse(str4);
                 this.fArtifact.ConcordanceLevels[num5].Sections.RemoveAt(num6);
                 this.update_statblock();
             }
             catch
             {
             }
         }
     }
     if (e.Url.Scheme == "rule")
     {
         e.Cancel = true;
         if (e.Url.LocalPath == "new")
         {
             ArtifactConcordanceForm artifactConcordanceForm = new ArtifactConcordanceForm(new Pair <string, string>("", ""));
             if (artifactConcordanceForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 this.fArtifact.ConcordanceRules.Add(artifactConcordanceForm.Concordance);
                 this.update_statblock();
             }
         }
     }
     if (e.Url.Scheme == "ruleedit")
     {
         e.Cancel = true;
         try
         {
             int concordance = int.Parse(e.Url.LocalPath);
             ArtifactConcordanceForm artifactConcordanceForm1 = new ArtifactConcordanceForm(this.fArtifact.ConcordanceRules[concordance]);
             if (artifactConcordanceForm1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 this.fArtifact.ConcordanceRules[concordance] = artifactConcordanceForm1.Concordance;
                 this.update_statblock();
             }
         }
         catch
         {
         }
     }
     if (e.Url.Scheme == "ruleremove")
     {
         e.Cancel = true;
         try
         {
             int num7 = int.Parse(e.Url.LocalPath);
             this.fArtifact.ConcordanceRules.RemoveAt(num7);
             this.update_statblock();
         }
         catch
         {
         }
     }
     if (e.Url.Scheme == "quote")
     {
         e.Cancel = true;
         try
         {
             int num8 = int.Parse(e.Url.LocalPath);
             ArtifactConcordance details      = this.fArtifact.ConcordanceLevels[num8];
             DetailsForm         detailsForm4 = new DetailsForm(details.Quote, "Concordance Quote", null);
             if (detailsForm4.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 details.Quote = detailsForm4.Details;
                 this.update_statblock();
             }
         }
         catch
         {
         }
     }
     if (e.Url.Scheme == "desc")
     {
         e.Cancel = true;
         try
         {
             int num9 = int.Parse(e.Url.LocalPath);
             ArtifactConcordance item1        = this.fArtifact.ConcordanceLevels[num9];
             DetailsForm         detailsForm5 = new DetailsForm(item1.Description, "Concordance Description", null);
             if (detailsForm5.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 item1.Description = detailsForm5.Details;
                 this.update_statblock();
             }
         }
         catch
         {
         }
     }
 }
Beispiel #3
0
        private void Browser_Navigating(object sender, WebBrowserNavigatingEventArgs e)
        {
            if (e.Url.Scheme == "build")
            {
                if (e.Url.LocalPath == "profile")
                {
                    e.Cancel = true;

                    ArtifactProfileForm dlg = new ArtifactProfileForm(fArtifact);
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        fArtifact.Name = dlg.Artifact.Name;
                        fArtifact.Tier = dlg.Artifact.Tier;
                        update_statblock();
                    }
                }

                if (e.Url.LocalPath == "description")
                {
                    e.Cancel = true;

                    DetailsForm dlg = new DetailsForm(fArtifact.Description, "Description", null);
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        fArtifact.Description = dlg.Details;
                        update_statblock();
                    }
                }

                if (e.Url.LocalPath == "details")
                {
                    e.Cancel = true;

                    DetailsForm dlg = new DetailsForm(fArtifact.Details, "Details", null);
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        fArtifact.Details = dlg.Details;
                        update_statblock();
                    }
                }

                if (e.Url.LocalPath == "goals")
                {
                    e.Cancel = true;

                    DetailsForm dlg = new DetailsForm(fArtifact.Goals, "Goals", null);
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        fArtifact.Goals = dlg.Details;
                        update_statblock();
                    }
                }

                if (e.Url.LocalPath == "rp")
                {
                    e.Cancel = true;

                    DetailsForm dlg = new DetailsForm(fArtifact.RoleplayingTips, "Roleplaying", null);
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        fArtifact.RoleplayingTips = dlg.Details;
                        update_statblock();
                    }
                }
            }

            if (e.Url.Scheme == "section")
            {
                if (e.Url.LocalPath == "new")
                {
                    e.Cancel = true;

                    MagicItemSection     mis = new MagicItemSection();
                    MagicItemSectionForm dlg = new MagicItemSectionForm(mis);
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        fArtifact.Sections.Add(dlg.Section);
                        update_statblock();
                    }
                }

                if (e.Url.LocalPath.Contains(",new"))
                {
                    e.Cancel = true;

                    try
                    {
                        string str             = e.Url.LocalPath.Substring(0, e.Url.LocalPath.IndexOf(","));
                        int    n               = int.Parse(str);
                        ArtifactConcordance ac = fArtifact.ConcordanceLevels[n];

                        MagicItemSection     mis = new MagicItemSection();
                        MagicItemSectionForm dlg = new MagicItemSectionForm(mis);
                        if (dlg.ShowDialog() == DialogResult.OK)
                        {
                            ac.Sections.Add(dlg.Section);
                            update_statblock();
                        }
                    }
                    catch
                    {
                        // Not a number
                    }
                }
            }

            if (e.Url.Scheme == "sectionedit")
            {
                if (e.Url.LocalPath.Contains(","))
                {
                    e.Cancel = true;

                    int    comma = e.Url.LocalPath.IndexOf(",");
                    string pre   = e.Url.LocalPath.Substring(0, comma);
                    string post  = e.Url.LocalPath.Substring(comma);

                    try
                    {
                        int ac_index      = int.Parse(pre);
                        int section_index = int.Parse(post);

                        ArtifactConcordance  ac  = fArtifact.ConcordanceLevels[ac_index];
                        MagicItemSection     mis = ac.Sections[section_index];
                        MagicItemSectionForm dlg = new MagicItemSectionForm(mis);
                        if (dlg.ShowDialog() == DialogResult.OK)
                        {
                            ac.Sections[section_index] = dlg.Section;
                            update_statblock();
                        }
                    }
                    catch
                    {
                        // Not a number
                    }
                }
                else
                {
                    e.Cancel = true;

                    try
                    {
                        int n = int.Parse(e.Url.LocalPath);
                        MagicItemSection mis = fArtifact.Sections[n];

                        MagicItemSectionForm dlg = new MagicItemSectionForm(mis);
                        if (dlg.ShowDialog() == DialogResult.OK)
                        {
                            fArtifact.Sections[n] = dlg.Section;
                            update_statblock();
                        }
                    }
                    catch
                    {
                        // Not a number
                    }
                }
            }

            if (e.Url.Scheme == "sectionremove")
            {
                if (e.Url.LocalPath.Contains(","))
                {
                    e.Cancel = true;

                    int    comma = e.Url.LocalPath.IndexOf(",");
                    string pre   = e.Url.LocalPath.Substring(0, comma);
                    string post  = e.Url.LocalPath.Substring(comma);

                    try
                    {
                        int ac_index      = int.Parse(pre);
                        int section_index = int.Parse(post);

                        ArtifactConcordance ac = fArtifact.ConcordanceLevels[ac_index];
                        ac.Sections.RemoveAt(section_index);
                        update_statblock();
                    }
                    catch
                    {
                        // Not a number
                    }
                }
                else
                {
                    e.Cancel = true;

                    try
                    {
                        int n = int.Parse(e.Url.LocalPath);

                        fArtifact.Sections.RemoveAt(n);
                        update_statblock();
                    }
                    catch
                    {
                        // Not a number
                    }
                }
            }

            if (e.Url.Scheme == "rule")
            {
                e.Cancel = true;

                if (e.Url.LocalPath == "new")
                {
                    Pair <string, string>   rule = new Pair <string, string>("", "");
                    ArtifactConcordanceForm dlg  = new ArtifactConcordanceForm(rule);
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        fArtifact.ConcordanceRules.Add(dlg.Concordance);
                        update_statblock();
                    }
                }
            }

            if (e.Url.Scheme == "ruleedit")
            {
                e.Cancel = true;

                try
                {
                    int n = int.Parse(e.Url.LocalPath);
                    Pair <string, string> rule = fArtifact.ConcordanceRules[n];

                    ArtifactConcordanceForm dlg = new ArtifactConcordanceForm(rule);
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        fArtifact.ConcordanceRules[n] = dlg.Concordance;
                        update_statblock();
                    }
                }
                catch
                {
                    // Not a number
                }
            }

            if (e.Url.Scheme == "ruleremove")
            {
                e.Cancel = true;

                try
                {
                    int n = int.Parse(e.Url.LocalPath);

                    fArtifact.ConcordanceRules.RemoveAt(n);
                    update_statblock();
                }
                catch
                {
                    // Not a number
                }
            }

            if (e.Url.Scheme == "quote")
            {
                e.Cancel = true;

                try
                {
                    int n = int.Parse(e.Url.LocalPath);
                    ArtifactConcordance ac = fArtifact.ConcordanceLevels[n];

                    DetailsForm dlg = new DetailsForm(ac.Quote, "Concordance Quote", null);
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        ac.Quote = dlg.Details;
                        update_statblock();
                    }
                }
                catch
                {
                    // Not a number
                }
            }

            if (e.Url.Scheme == "desc")
            {
                e.Cancel = true;

                try
                {
                    int n = int.Parse(e.Url.LocalPath);
                    ArtifactConcordance ac = fArtifact.ConcordanceLevels[n];

                    DetailsForm dlg = new DetailsForm(ac.Description, "Concordance Description", null);
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        ac.Description = dlg.Details;
                        update_statblock();
                    }
                }
                catch
                {
                    // Not a number
                }
            }
        }
 private void Browser_Navigating(object sender, WebBrowserNavigatingEventArgs e)
 {
     if (e.Url.Scheme == "build")
     {
         if (e.Url.LocalPath == "profile")
         {
             e.Cancel = true;
             MagicItemProfileForm magicItemProfileForm = new MagicItemProfileForm(this.fMagicItem);
             if (magicItemProfileForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 this.fMagicItem.Name   = magicItemProfileForm.MagicItem.Name;
                 this.fMagicItem.Level  = magicItemProfileForm.MagicItem.Level;
                 this.fMagicItem.Type   = magicItemProfileForm.MagicItem.Type;
                 this.fMagicItem.Rarity = magicItemProfileForm.MagicItem.Rarity;
                 this.update_statblock();
             }
         }
         if (e.Url.LocalPath == "desc")
         {
             e.Cancel = true;
             DetailsForm detailsForm = new DetailsForm(this.fMagicItem.Description, "Description", null);
             if (detailsForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 this.fMagicItem.Description = detailsForm.Details;
                 this.update_statblock();
             }
         }
     }
     if (e.Url.Scheme == "section")
     {
         e.Cancel = true;
         if (e.Url.LocalPath == "new")
         {
             MagicItemSectionForm magicItemSectionForm = new MagicItemSectionForm(new MagicItemSection()
             {
                 Header = "New Section"
             });
             if (magicItemSectionForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 this.fMagicItem.Sections.Add(magicItemSectionForm.Section);
                 this.update_statblock();
             }
         }
     }
     if (e.Url.Scheme == "edit")
     {
         e.Cancel = true;
         int section = int.Parse(e.Url.LocalPath);
         MagicItemSectionForm magicItemSectionForm1 = new MagicItemSectionForm(this.fMagicItem.Sections[section]);
         if (magicItemSectionForm1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             this.fMagicItem.Sections[section] = magicItemSectionForm1.Section;
             this.update_statblock();
         }
     }
     if (e.Url.Scheme == "remove")
     {
         e.Cancel = true;
         int num = int.Parse(e.Url.LocalPath);
         this.fMagicItem.Sections.RemoveAt(num);
         this.update_statblock();
     }
     if (e.Url.Scheme == "moveup")
     {
         e.Cancel = true;
         int item = int.Parse(e.Url.LocalPath);
         MagicItemSection magicItemSection = this.fMagicItem.Sections[item - 1];
         this.fMagicItem.Sections[item - 1] = this.fMagicItem.Sections[item];
         this.fMagicItem.Sections[item]     = magicItemSection;
         this.update_statblock();
     }
     if (e.Url.Scheme == "movedown")
     {
         e.Cancel = true;
         int item1 = int.Parse(e.Url.LocalPath);
         MagicItemSection magicItemSection1 = this.fMagicItem.Sections[item1 + 1];
         this.fMagicItem.Sections[item1 + 1] = this.fMagicItem.Sections[item1];
         this.fMagicItem.Sections[item1]     = magicItemSection1;
         this.update_statblock();
     }
 }