private static void StopSharedPrinterServerListener() { listeningForRemotePrinting = false; if (Configuration.OsVersion.XP == Configuration.GetOs()) { ProcessControl.ExecuteCommandAsync(WinXPIECPFirewallDisable, "Firewall"); } else { ProcessControl.ExecuteCommandAsync(Win7IECPFirewallDisable, "Firewall"); } }
private static void StartSharedPrinterServerListener() { if (listeningForRemotePrinting == true) { return; } if (Configuration.OsVersion.XP == Configuration.GetOs()) { ProcessControl.ExecuteCommandAsync(WinXPIECPFirewallEnable, "Firewall"); } else { ProcessControl.ExecuteCommandAsync(Win7IECPFirewallEnable, "Firewall"); } listeningForRemotePrinting = true; remotePrintingListenerThread = new Thread(SharedPrinterListenerWorker); remotePrintingListenerThread.Start(); }