Exemplo n.º 1
0
        public formLoadModpack(Modpack m)
            : this()
        {
            var mega = new MegaApiClient();
            mega.LoginAnonymous();

            foreach (ModDL d in m.Mods)
            {
                ListViewItem lv = new ListViewItem();
                lv.Text = d.Name;
                lv.Tag = d;

                var node = mega.GetNodeFromLink(d.URL);

                lv.SubItems.Add(BytesToString(node.Size));

                lsvModDLs.Items.Add(lv);
            }

            Font temp = rtbDescription.SelectionFont;
            rtbDescription.SelectionFont = new Font(temp, FontStyle.Bold);

            rtbDescription.AppendText(m.Name + "\r\n");
            rtbDescription.AppendText("by " + m.Authors + "\r\n\r\n");

            rtbDescription.SelectionFont = temp;

            rtbDescription.AppendText(m.Description);
        }
        public formLoadModpack(Modpack m) : this()
        {
            var mega = new MegaApiClient();

            mega.LoginAnonymous();

            foreach (ModDL d in m.Mods)
            {
                ListViewItem lv = new ListViewItem();
                lv.Text = d.Name;
                lv.Tag  = d;

                var node = mega.GetNodeFromLink(d.URL);

                lv.SubItems.Add(BytesToString(node.Size));

                lsvModDLs.Items.Add(lv);
            }

            Font temp = rtbDescription.SelectionFont;

            rtbDescription.SelectionFont = new Font(temp, FontStyle.Bold);

            rtbDescription.AppendText(m.Name + "\r\n");
            rtbDescription.AppendText("by " + m.Authors + "\r\n\r\n");

            rtbDescription.SelectionFont = temp;

            rtbDescription.AppendText(m.Description);
        }
Exemplo n.º 3
0
        private void btnLoadModpack_Click(object sender, EventArgs e)
        {
            string path;
            using (OpenFileDialog file = new OpenFileDialog())
            {
                file.Filter = "AA2 Modpack file (*.a2m)|*.a2m|All Files (*.*)|*.*";
                if (file.ShowDialog() != DialogResult.OK)
                    return;
                path = file.FileName;
            }

            Modpack pack = new Modpack(path);

            using (formLoadModpack f = new formLoadModpack(pack))
                f.ShowDialog();
        }