public void Add(PrintManagerBridge instance, bool verbose = false) { Log.Entry("Printer", "Adding: " + Name); if (IP != null) { Log.Debug(LogName, $"--> IP = {IP}"); } if (Port != null) { Log.Debug(LogName, $"--> Port = {Port}"); } if (File != null) { Log.Debug(LogName, $"--> File = {File}"); } if (ConfigFile != null) { Log.Debug(LogName, $"--> Config = {ConfigFile}"); } if (Model != null) { Log.Debug(LogName, $"--> Model = {Model}"); } try { instance.Add(this, verbose); } catch (Exception ex) { Log.Error(LogName, "Could not add"); Log.Error(LogName, ex); } }
public void SetDefault(PrintManagerBridge instance) { Log.Entry("Printer", "Setting default: " + Name); try { instance.Default(Name); } catch (Exception ex) { Log.Error("Printer", ex); } }
public void Remove(PrintManagerBridge instance) { try { instance.Remove(Name); } catch (Exception ex) { Log.Error(LogName, "Could not remove"); Log.Error(LogName, ex); } }
public void SetDefault(PrintManagerBridge instance, bool verbose = false) { Log.Entry("Printer", "Setting " + Name + " as default"); try { instance.Default(Name, verbose); } catch (Exception ex) { Log.Error("Printer", ex); } }
public Form1() { InitializeComponent(); _instance = new WindowsPrinterManager(); _printers = GetPrinters(); foreach (var printerName in GetPrinterNames()) printerComboBox.Items.Add(printerName); if (printerComboBox.Items.Count > 0) printerComboBox.SelectedIndex = 0; }
public void Remove(PrintManagerBridge instance, bool verbose = false) { Log.Entry("Printer", "Removing: " + Name); try { instance.Remove(Name, verbose); } catch (Exception ex) { Log.Error(LogName, "Could not remove"); Log.Error(LogName, ex); } }
public DefaultPrinterManager() { Name = "PrinterManager"; switch (Settings.OS) { case Settings.OSType.Windows: _instance = new WindowsPrinterManager(); break; default: _instance = new UnixPrinterManager(); break; } }
public DefaultPrinterManager() { Name = "DefaultPrinterManager"; switch (Settings.OS) { case Settings.OSType.Windows: _instance = new WindowsPrinterManager(); break; default: _instance = new UnixPrinterManager(); break; } }
public PrinterManager() { Compatiblity = Settings.OSType.Windows; Name = "PrinterManager"; LogName = Name; switch (Settings.OS) { case Settings.OSType.Windows: _instance = new WindowsPrinterManager(); break; default: _instance = new UnixPrinterManager(); break; } }
public PrinterManager() { Compatiblity = Settings.OSType.Windows; Name = "PrinterManager"; LogName = Name; _configuredPrinters = new List <string>(); switch (Settings.OS) { case Settings.OSType.Windows: _instance = new WindowsPrinterManager(); break; default: _instance = new UnixPrinterManager(); break; } }
public void Add(PrintManagerBridge instance, bool verbose = false) { Log.Entry("Printer", "Adding: " + Name); if (IP != null) Log.Entry(LogName, $"--> IP = {IP}"); if (Port != null) Log.Entry(LogName, $"--> Port = {Port}"); if (File != null) Log.Entry(LogName, $"--> File = {File}"); if (ConfigFile != null) Log.Entry(LogName, $"--> Config = {ConfigFile}"); if (Model != null) Log.Entry(LogName, $"--> Model = {Model}"); try { instance.Add(this, verbose); } catch (Exception ex) { Log.Error(LogName, "Could not add"); Log.Error(LogName, ex); } }
public abstract void Add(PrintManagerBridge instance);
public void Remove(PrintManagerBridge instance, bool verbose = false) { Log.Entry("Printer", "Removing: " + Name); try { instance.Remove(Name, verbose); } catch (Exception ex) { Log.Error(LogName, "Could not remove"); Log.Error(LogName, ex); } }
public void SetDefault(PrintManagerBridge instance, bool verbose = false) { Log.Entry("Printer", "Setting " + Name + " as default"); try { instance.Default(Name, verbose); } catch (Exception ex) { Log.Error("Printer", ex); } }