コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
ファイル: frmMain.cs プロジェクト: un1xpwner/downtify
        private void frmMain_Shown(object sender, EventArgs e)
        {
            System.Threading.Thread.Sleep(200);
            this.Activate();

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

            foreach (var line in File.ReadAllLines("config.txt"))
            {
                if (line.Contains("#"))
                {
                    continue;
                }

                if (line.Contains("username"))
                {
                    username = line.Split('"')[1].Split('"')[0];
                }
                else if (line.Contains("password"))
                {
                    password = line.Split('"')[1].Split('"')[0];
                }
            }

            downloader.Login(username, password);
        }
コード例 #3
0
ファイル: frmMain.cs プロジェクト: lordsill/downtify
        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);
                }
            }
        }
コード例 #4
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);
        }