Пример #1
0
        private async void subreview_Click(object sender, EventArgs e)
        {
            subreview.Enabled = false;

            try {
                Reviewer nfo  = new Reviewer();
                Core     rep  = new Core();
                var      dbxz = new DropboxClient(rep._key);
                string   JSON;
                if (nickFIELD.Enabled == false)
                {
                    string   DeciKey = titlerec.Text;
                    string[] extPAR  = DeciKey.Split(new string[] { "<+>AOE2BUILDS" }, StringSplitOptions.None);
                    nfo.Nickname    = nickFIELD.Text;
                    nfo.Description = subody.Text;
                    nfo.Video       = vidFIELD.Text;
                    nfo.isVerified  = true;
                    JSON            = JsonConvert.SerializeObject(nfo);
                }
                else
                {
                    nfo.Nickname    = nickFIELD.Text;
                    nfo.Description = subody.Text;
                    nfo.Video       = "";
                    nfo.isVerified  = false;
                    JSON            = JsonConvert.SerializeObject(nfo);
                }

                progressBarX1.Value = 10;
                //Grab new affix for rev file
                afx = await IterateReviewsCount() + 1;

                //new name for rev file
                string REVname = Path.GetFileName(GrabRECNAME).Replace(".derm", "") + "-" + afx.ToString() + ".rev";

                //upload new .rev file
                await Core.UploadLic(dbxz, "/derm", REVname, JSON);

                //close window
                MessageBox.Show("Thank you! \n Your Review has been submitted <3");
                this.Close();
            }
            catch (System.Net.Http.HttpRequestException) { pgsbar.Visible = false; MessageBox.Show("No Internet!"); }
        }
Пример #2
0
        private async void titlerec_TextChanged(object sender, EventArgs e)
        {
            await Task.Delay(1000);

            nickFIELD.Enabled = String.IsNullOrEmpty(titlerec.Text);

            Core     rep     = new Core();
            Reviewer nfo     = new Reviewer();
            string   DeciKey = "";

            if (titlerec.Text != "")
            {
                rep.trimKEY = EnSerial(titlerec.Text);
                DeciKey     = DecryptTicket(rep.trimKEY, "DERM8Z70");
                if (DeciKey == "")
                {
                    picVER.Image = Properties.Resources.bullet_valid_icon;
                    MessageBox.Show("Wrong ticket Key! Enter valid key!");
                    subreview.Enabled = true;
                    return;
                }

                picVER.Image = Properties.Resources.no_icon;
                string[] extPAR = DeciKey.Split(new string[] { "<+>AOE2BUILDS" }, StringSplitOptions.None);
                nfo.Nickname    = extPAR[0].Split('>').FirstOrDefault();
                nfo.Description = subody.Text;
                nickFIELD.Text  = nfo.Nickname;
                string JSON = JsonConvert.SerializeObject(nfo);
                //Check and store available rev files


                nickFIELD.Enabled = false;
                vidLBL.Visible    = true;
                vidFIELD.Visible  = true;
                vidFIELD.Enabled  = true;
                picVER.Image      = Properties.Resources.bullet_valid_icon;
            }
        }