private void init() { cancel = false; organizeButton = new MaterialRaisedButton(); tagButton = new MaterialRaisedButton(); outputLabel = new MaterialLabel(); currentMusicFolder = new MaterialLabel(); // // organizeButton // organizeButton.BackColor = Color.FromArgb(96, 94, 92); organizeButton.Font = new Font("Product Sans", 15F); organizeButton.ForeColor = Color.White; organizeButton.Location = new Point(0, 0); organizeButton.Cursor = Cursors.Hand; organizeButton.Name = "organizeButton"; organizeButton.Size = new Size(325, 63); organizeButton.Text = "Format Music Files"; organizeButton.UseVisualStyleBackColor = true; organizeButton.MouseClick += new MouseEventHandler(organizeClick); // // tagButton // tagButton.BackColor = Color.FromArgb(96, 94, 92); tagButton.Dock = DockStyle.Bottom; tagButton.Font = new Font("Product Sans", 15F); tagButton.ForeColor = Color.White; tagButton.Location = new Point(0, 201); tagButton.Name = "tagButton"; tagButton.Size = new Size(325, 63); tagButton.Cursor = Cursors.Hand; tagButton.Text = "Tag Music File"; tagButton.UseVisualStyleBackColor = true; tagButton.MouseClick += new MouseEventHandler(tagClick); // // outputLabel // outputLabel.Font = new Font("Product Sans", 12F); outputLabel.ForeColor = Color.White; outputLabel.Location = new Point(0, 63); outputLabel.Name = "outputLabel"; outputLabel.Size = new Size(325, 138); outputLabel.TextAlign = ContentAlignment.TopCenter; outputLabel.MouseClick += delegate(object o, MouseEventArgs args) { if (args.Button == MouseButtons.Left) { cancel = true; } }; // // currentMusicFolder // currentMusicFolder.AutoSize = true; currentMusicFolder.ForeColor = Color.White; currentMusicFolder.Location = new Point(4, 160); currentMusicFolder.Cursor = Cursors.Hand; currentMusicFolder.Name = "currentMusicFolder"; currentMusicFolder.AutoSize = true; currentMusicFolder.Size = new Size(279, 13); currentMusicFolder.Font = new Font("Product Sans", 12f); currentMusicFolder.TabIndex = 3; currentMusicFolder.MouseEnter += delegate { currentMusicFolder.runOnUiThread(() => { currentMusicFolder.Font = new Font(currentMusicFolder.Font, FontStyle.Underline); }); }; currentMusicFolder.MouseLeave += delegate { currentMusicFolder.runOnUiThread(() => { currentMusicFolder.Font = new Font(currentMusicFolder.Font, FontStyle.Regular); }); }; currentMusicFolder.MouseClick += delegate(object o, MouseEventArgs args) { if (args.Button == MouseButtons.Left) { //FolderBrowserDialog dialog = new FolderBrowserDialog(); //dialog.Description = "Select Main Music Folder"; //dialog.ShowNewFolderButton = true; //dialog.RootFolder = Environment.SpecialFolder.MyComputer; //if (dialog.ShowDialog() == DialogResult.OK) { // Properties.Settings.Default.MusicFilePath = dialog.SelectedPath; // Properties.Settings.Default.Save(); // currentMusicFolder.Text = "Current Music Folder: \n" + dialog.SelectedPath; //} string newFolder = Tools.selectFolder(); if (newFolder != null) { Properties.Settings.Default.MusicFilePath = newFolder; Properties.Settings.Default.Save(); currentMusicFolder.Text = "Current Music Folder: \n" + newFolder; } } }; currentMusicFolder.Text = "Current Music Folder:"; StartPosition = FormStartPosition.CenterScreen; AutoScaleDimensions = new SizeF(6F, 13F); AutoScaleMode = AutoScaleMode.Font; Size = new Size(325, 350); FormClosing += delegate { StudioContext.getCurrentInstance().formClosed(this); }; Controls.Add(currentMusicFolder); Controls.Add(outputLabel); Controls.Add(organizeButton); Controls.Add(tagButton); Name = "OptionsForm"; Icon = Properties.Resources.electrum; Text = "Electrum Music Options"; }
public StudioContext(string[] args) { currentInstance = this; init(args); openForm(args); }
protected void init() { FormClosing += delegate { StudioContext.getCurrentInstance().formClosed(this); }; }