|
|
@ -38,8 +38,6 @@ namespace formula_manage.Windows |
|
|
cbxPrinter.ItemsSource = this.GetLocalPrinters(); //打印机搜索
|
|
|
cbxPrinter.ItemsSource = this.GetLocalPrinters(); //打印机搜索
|
|
|
cbxPrinter2.ItemsSource = this.GetLocalPrinters(); |
|
|
cbxPrinter2.ItemsSource = this.GetLocalPrinters(); |
|
|
cbxPrinter3.ItemsSource = this.GetLocalPrinters(); |
|
|
cbxPrinter3.ItemsSource = this.GetLocalPrinters(); |
|
|
cbxPrinter4.ItemsSource = this.GetLocalPrinters(); |
|
|
|
|
|
cbxPrinter5.ItemsSource = this.GetLocalPrinters(); |
|
|
|
|
|
this.Closing += Window_Closing; //添加窗口关闭事件
|
|
|
this.Closing += Window_Closing; //添加窗口关闭事件
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -63,12 +61,8 @@ namespace formula_manage.Windows |
|
|
Print_path.Text = Configini.IniReadvalue("PRINTER", "P3"); |
|
|
Print_path.Text = Configini.IniReadvalue("PRINTER", "P3"); |
|
|
Printer2 = Boolean.Parse(Configini.IniReadvalue("PRINTER", "P4")); |
|
|
Printer2 = Boolean.Parse(Configini.IniReadvalue("PRINTER", "P4")); |
|
|
Printer3 = Boolean.Parse(Configini.IniReadvalue("PRINTER", "P5")); |
|
|
Printer3 = Boolean.Parse(Configini.IniReadvalue("PRINTER", "P5")); |
|
|
Printer4 = Boolean.Parse(Configini.IniReadvalue("PRINTER", "P6")); |
|
|
|
|
|
Printer5 = Boolean.Parse(Configini.IniReadvalue("PRINTER", "P7")); |
|
|
|
|
|
cbxPrinter2.SelectedValue = Configini.IniReadvalue("PRINTER", "P8"); //读配置文件
|
|
|
cbxPrinter2.SelectedValue = Configini.IniReadvalue("PRINTER", "P8"); //读配置文件
|
|
|
cbxPrinter3.SelectedValue = Configini.IniReadvalue("PRINTER", "P9"); //读配置文件
|
|
|
cbxPrinter3.SelectedValue = Configini.IniReadvalue("PRINTER", "P9"); //读配置文件
|
|
|
cbxPrinter4.SelectedValue = Configini.IniReadvalue("PRINTER", "P10"); //读配置文件
|
|
|
|
|
|
cbxPrinter5.SelectedValue = Configini.IniReadvalue("PRINTER", "P11"); //读配置文件
|
|
|
|
|
|
Print_path2.Text = Configini.IniReadvalue("PRINTER", "P12"); |
|
|
Print_path2.Text = Configini.IniReadvalue("PRINTER", "P12"); |
|
|
|
|
|
|
|
|
TEXT_Print.IsChecked = Printer; |
|
|
TEXT_Print.IsChecked = Printer; |
|
|
@ -79,12 +73,6 @@ namespace formula_manage.Windows |
|
|
|
|
|
|
|
|
TEXT_Print3.IsChecked = Printer3; |
|
|
TEXT_Print3.IsChecked = Printer3; |
|
|
cbxPrinter3.IsEnabled = Printer3; |
|
|
cbxPrinter3.IsEnabled = Printer3; |
|
|
|
|
|
|
|
|
TEXT_Print4.IsChecked = Printer4; |
|
|
|
|
|
cbxPrinter4.IsEnabled = Printer4; |
|
|
|
|
|
|
|
|
|
|
|
TEXT_Print5.IsChecked = Printer5; |
|
|
|
|
|
cbxPrinter5.IsEnabled = Printer5; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) //窗口关闭事件
|
|
|
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) //窗口关闭事件
|
|
|
@ -97,12 +85,8 @@ namespace formula_manage.Windows |
|
|
Configini.IniWritevalue("PRINTER", " P3", Print_path.Text.ToString()); |
|
|
Configini.IniWritevalue("PRINTER", " P3", Print_path.Text.ToString()); |
|
|
Configini.IniWritevalue("PRINTER", " P4", Printer2.ToString()); |
|
|
Configini.IniWritevalue("PRINTER", " P4", Printer2.ToString()); |
|
|
Configini.IniWritevalue("PRINTER", " P5", Printer3.ToString()); |
|
|
Configini.IniWritevalue("PRINTER", " P5", Printer3.ToString()); |
|
|
Configini.IniWritevalue("PRINTER", " P6", Printer4.ToString()); |
|
|
|
|
|
Configini.IniWritevalue("PRINTER", " P7", Printer5.ToString()); |
|
|
|
|
|
Configini.IniWritevalue("PRINTER", " P8", cbxPrinter2.SelectedValue.ToString()); |
|
|
Configini.IniWritevalue("PRINTER", " P8", cbxPrinter2.SelectedValue.ToString()); |
|
|
Configini.IniWritevalue("PRINTER", " P9", cbxPrinter3.SelectedValue.ToString()); |
|
|
Configini.IniWritevalue("PRINTER", " P9", cbxPrinter3.SelectedValue.ToString()); |
|
|
Configini.IniWritevalue("PRINTER", " P10", cbxPrinter4.SelectedValue.ToString()); |
|
|
|
|
|
Configini.IniWritevalue("PRINTER", " P11", cbxPrinter5.SelectedValue.ToString()); |
|
|
|
|
|
Configini.IniWritevalue("PRINTER", " P12", Print_path2.Text.ToString()); |
|
|
Configini.IniWritevalue("PRINTER", " P12", Print_path2.Text.ToString()); |
|
|
|
|
|
|
|
|
System.IO.DirectoryInfo log = new System.IO.DirectoryInfo(@logpath);//生成日志文件目录
|
|
|
System.IO.DirectoryInfo log = new System.IO.DirectoryInfo(@logpath);//生成日志文件目录
|
|
|
@ -230,16 +214,6 @@ namespace formula_manage.Windows |
|
|
Printer3 = TEXT_Print3.IsChecked.GetValueOrDefault(); //打印机是否生效
|
|
|
Printer3 = TEXT_Print3.IsChecked.GetValueOrDefault(); //打印机是否生效
|
|
|
cbxPrinter3.IsEnabled = Printer3; //
|
|
|
cbxPrinter3.IsEnabled = Printer3; //
|
|
|
} |
|
|
} |
|
|
private void Print_Checked4(object sender, RoutedEventArgs e) //打印机是否生效
|
|
|
|
|
|
{ |
|
|
|
|
|
Printer4 = TEXT_Print4.IsChecked.GetValueOrDefault(); //打印机是否生效
|
|
|
|
|
|
cbxPrinter4.IsEnabled = Printer4; //
|
|
|
|
|
|
} |
|
|
|
|
|
private void Print_Checked5(object sender, RoutedEventArgs e) //打印机是否生效
|
|
|
|
|
|
{ |
|
|
|
|
|
Printer5 = TEXT_Print5.IsChecked.GetValueOrDefault(); //打印机是否生效
|
|
|
|
|
|
cbxPrinter5.IsEnabled = Printer5; //
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private List<XElement> GetLocalPrinters() //查找打印机
|
|
|
private List<XElement> GetLocalPrinters() //查找打印机
|
|
|
{ |
|
|
{ |
|
|
|