private void frmMain_Shown(object sender, EventArgs e)
        {
            Thread.Sleep(200);
            this.Activate();

            ClearTrackInfo();

            // very ugly, use config parser (json for example) would be nicer
            string username = "", password = "";

            configuration.LoadConfigurationFile();
            TransferConfig();
            username = configuration.GetConfiguration("username");
            password = configuration.GetConfiguration("password");
            lang     = new LanguageXML(configuration.GetConfiguration("language"));

            textBoxLink.Placeholder = lang.GetString("download/paste_uri");

            downloader.Login(username, password);

            if (Clipboard.GetText().Contains("spotify"))
            {
                string CLIPBOARD_DIALOG = "Clipboard may contain one or more Spotify URLs. Use these?";
                if (MessageBox.Show(CLIPBOARD_DIALOG, "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    textBoxLink.Text = Clipboard.GetText();
                    FetchSongsFromUrl(textBoxLink.Text);
                }
            }
        }
Exemple #2
0
        private async void frmMain_Shown(object sender, EventArgs e)
        {
            System.Threading.Thread.Sleep(200);
            this.Activate();

            string username = "", password = "";

            TransferConfig();
            username = configuration.GetConfiguration("username");
            password = configuration.GetConfiguration("password");
            lang     = new LanguageXML(configuration.GetConfiguration("language", "en"));

            textBoxLink.Placeholder = lang.GetString("download/paste_uri");
            progressBar1.Text       = lang.GetString("download/progression");

            downloader.Login(username, password);

            if (configuration.GetConfiguration("continue_dl", "false").ToLower() == "true" && File.Exists("download.xml"))
            {
                XmlDocument doc = new XmlDocument();
                doc.Load("download.xml");
                foreach (XmlNode node in doc.SelectNodes("tracks/track"))
                {
                    await AddDownload(node.InnerText);
                }
            }
        }
Exemple #3
0
        private void frmMain_Shown(object sender, EventArgs e)
        {
            System.Threading.Thread.Sleep(200);
            this.Activate();

            // very ugly, use config parser (json for example) would be nicer
            string username = "", password = "";

            configuration.LoadConfigurationFile();
            TransferConfig();
            username = configuration.GetConfiguration("username");
            password = configuration.GetConfiguration("password");
            lang     = new LanguageXML(configuration.GetConfiguration("language"));

            textBoxLink.Placeholder = lang.GetString("download/paste_uri");

            downloader.Login(username, password);
        }
Exemple #4
0
        public bool AddHostingUnit(HostingUnit hostingUnit)
        {
            HostingUnit hostingUnitCopy = (HostingUnit)hostingUnit.Clone();

            hostingUnitCopy.HostingUnitKey = XC.GetConfiguration <int>("HostUnitKey");
            List <HostingUnit> unitList = Lunit();

            unitList.Add(hostingUnitCopy);
            XmlDataSource.SaveToXML <List <HostingUnit> >(unitList, HostingUnitPath);
            XC.UpdateConfiguration <int>("HostUnitKey", (hostingUnitCopy.HostingUnitKey + 1));
            return(true);
        }
Exemple #5
0
        public long AddUnit(HostingUnit hostingUnit)
        {
            HostingUnit hostingUnitCopy = (HostingUnit)hostingUnit.Clone();

            hostingUnitCopy.HostingUnitKey = XC.GetConfiguration <long>("HostUnitKey");
            DataSource.HostingUnitsCollection.Add(hostingUnitCopy);
            XmlDataSource.SaveToXML <List <HostingUnit> >(DataSource.HostingUnitsCollection, HostingUnitPath);
            XC.UpdateConfiguration <long>("HostUnitKey", (hostingUnitCopy.HostingUnitKey + 1));
            return(hostingUnitCopy.HostingUnitKey);
            //XH.AddUnit(hostingUnit);
        }
        public void AddOrder(Order order)
        {
            long key = XC.GetConfiguration <long>("OrderKey");

            OrderRoot.Add(new XElement("Order",
                                       new XElement("OrderKey", key),
                                       new XElement("HostingUnitKey", order.HostingUnitKey),
                                       new XElement("GuestRequestKey", order.GuestRequestKey),
                                       new XElement("Status", order.Status),
                                       new XElement("CreateDate", order.CreateDate),
                                       new XElement("OrderDate", order.OrderDate),
                                       new XElement("CommissionValue", order.CommissionValue)));
            OrderRoot.Save(OrderPath);
            XC.UpdateConfiguration <long>("OrderKey", ++key);
        }
Exemple #7
0
        public void AddOrder(Order order)
        {
            order.OrderKey = (int)XC.GetConfiguration <long>("OrderKey");

            OrderRoot.Add(new XElement("Order",
                                       new XElement("OrderKey", order.OrderKey),
                                       new XElement("HostingUnitKey", order.HostingUnitKey),
                                       new XElement("GuestRequestKey", order.GuestRequestKey),
                                       new XElement("Status", order.StatusOrder),
                                       new XElement("CreateDate", order.CreateDate.ToShortDateString()),
                                       new XElement("OrderDate", order.OrderDate.ToShortDateString())
                                       /*new XElement("CommissionValue", order.CommissionValue)*/));
            OrderRoot.Save(OrderPath);
            XC.UpdateConfiguration <long>("OrderKey", order.OrderKey + 1);//run
        }