private void buttonClicked(object sender, EventArgs e) { SimpleButton sb = sender as SimpleButton; if (System.IO.File.Exists(sb.ToolTip)) { Chapters ch = new Chapters(sb.ToolTip); ch.MdiParent = Globals.mainForm; ch.Show(); } }
private void barEditItemTxtColor_EditValueChanged(object sender, EventArgs e) { Color c = (Color)this.barEditItemTxtColor.EditValue; foreach (Form f in this.MdiChildren) { if (f.GetType() == typeof(Chapters)) { Chapters ch = f as Chapters; ch.SetTxtColor(c); } } }
private void bbiOpenBook_ItemClick(object sender, ItemClickEventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.AddExtension = true; ofd.DefaultExt = "ecb"; ofd.Filter = "ECB文件(*.ECB)|*.ECB"; if (ofd.ShowDialog() == DialogResult.OK) { Chapters ch = new Chapters(ofd.FileName); ch.MdiParent = this; ch.Show(); } }
private void barEditItemFontSize_EditValueChanged(object sender, EventArgs e) { int i = int.Parse(this.barEditItemFontSize.EditValue.ToString()); Properties.Settings.Default.TxtFont = new Font(Properties.Settings.Default.TxtFont.FontFamily, (float)i); Properties.Settings.Default.Save(); foreach (Form f in this.MdiChildren) { if (f.GetType() == typeof(Chapters)) { Chapters ch = f as Chapters; ch.SetTxtSize(i); } } }
private void barEditItemFont_EditValueChanged(object sender, EventArgs e) { string fontString = (string)(this.barEditItemFont.EditValue); Properties.Settings.Default.TxtFont = new Font(fontString, Properties.Settings.Default.TxtFont.Size); Properties.Settings.Default.Save(); foreach (Form f in this.MdiChildren) { if (f.GetType() == typeof(Chapters)) { Chapters ch = f as Chapters; ch.SetTxtFont(fontString); } } }
private void barEditItemBgColor_EditValueChanged(object sender, EventArgs e) { Color c = (Color)(this.barEditItemBgColor.EditValue); Properties.Settings.Default.BgColor = c; Properties.Settings.Default.Save(); foreach (Form f in this.MdiChildren) { if (f.GetType() == typeof(Chapters)) { Chapters ch = f as Chapters; ch.SetBgColor(c); } } }
//输入地址 private void barButtonItemInputUri_ItemClick(object sender, ItemClickEventArgs e) { InputIndex ii = new InputIndex(); if (ii.ShowDialog() == DialogResult.OK) { Chapters ch = new Chapters(); ch.Address = ii.BookCatalogUrl; ch.LocalSavedFolder = ii.SelectedFolder; ch.MdiParent = this; ch.Show(); //this.bbiDownloadChapters.Enabled = true; //Globals.SaveSettingToXml(); } else { this.bbiDownloadChapters.Enabled = false; } }
private void barButtonItem5_ItemClick(object sender, ItemClickEventArgs e) { if (this.ActiveMdiChild.GetType() == typeof(Chapters)) { Chapters ch = this.ActiveMdiChild as Chapters; ch.StartSaveToSql(); } //if (System.IO.Directory.Exists(@"C:\Downloads")) //{ // MessageBox.Show(System.IO.Directory.GetParent(@"C:\Downloads\").FullName); // MessageBox.Show(Environment.CurrentDirectory); // MessageBox.Show("存在"); //} //else //{ // MessageBox.Show(Environment.CurrentDirectory); // MessageBox.Show("不存在"); //} }