Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
 public void SetDefault(PrintManagerBridge instance)
 {
     Log.Entry("Printer", "Setting default: " + Name);
     try
     {
         instance.Default(Name);
     }
     catch (Exception ex)
     {
         Log.Error("Printer", ex);
     }
 }
Esempio n. 3
0
 public void Remove(PrintManagerBridge instance)
 {
     try
     {
         instance.Remove(Name);
     }
     catch (Exception ex)
     {
         Log.Error(LogName, "Could not remove");
         Log.Error(LogName, ex);
     }
 }
Esempio n. 4
0
 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);
     }
 }
Esempio n. 5
0
        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;
        }
Esempio n. 6
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;
            }
        }
Esempio n. 9
0
        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;
            }
        }
Esempio n. 10
0
        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;
            }
        }
Esempio n. 11
0
        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);
            }
        }
Esempio n. 12
0
 public abstract void Add(PrintManagerBridge instance);
Esempio n. 13
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);
     }
 }
Esempio n. 14
0
 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);
     }
 }