Exemple #1
0
        private void loadJSONToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog loaddlg = new OpenFileDialog();

            loaddlg.FileName   = "Document";
            loaddlg.DefaultExt = ".json";
            loaddlg.Filter     = "JSON documents (.json)|*.json";
            DialogResult result = loaddlg.ShowDialog();

            if (result == DialogResult.OK)
            {
                string   file  = loaddlg.FileName;
                FileInfo optFI = new FileInfo(file);
                if (!optFI.Exists)
                {
                    DialogResult badFileResult = MessageBox.Show(String.Format("Unable to find file {0}", file), "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    if (badFileResult == DialogResult.OK)
                    {
                        loadJSONToolStripMenuItem_Click(sender, e);
                    }
                }
                swDC              = new SWDataController(file);
                cbxSlot.Enabled   = true;
                btnSearch.Enabled = true;
                //SetListColumn();
                LoadRunesToListView(swDC.GetRuneList());
                //swDC.
                //if (mainDC.MonsterList.Count > 0)
                //{
                //    cmbMonsterBox.Enabled = true;
                //    cmbMonsterBox.Items.AddRange(mainDC.MonsterList.ToArray());
                //}
            }
        }
Exemple #2
0
 public frmRuneSearch()
 {
     InitializeComponent();
     swDC = null;
     SetListColumn();
     cbxSlot.Enabled   = false;
     btnSearch.Enabled = false;
 }