private void btnStopService_Click(object sender, RoutedEventArgs e)
        {
            client.Close();

            LogMessage("Stopping PasswordCracker service...");
            this.wcfhost.Stop();
            this.wcfhost = null;
            LogMessage("PasswordCracker service stopped!");

            btnStopService.IsEnabled = false;
            btnBack.IsEnabled        = true;
        }
        public ApplicationConsole(string passwordsFile, string bruteForceAlphabet, Dictionary <int, int> genPasswordsLength) : this()
        {
            LogMessage("Starting PasswordCracker service...");
            LogMessage("Selected work mode => Brute Force");
            wcfhost = new WCFHost(passwordsFile, bruteForceAlphabet, genPasswordsLength);
            LogMessage("PasswordCracker service started!");

            callbackHandler = new CallbackHandler();
            callbackHandler.PingReplyReceived += (sender, message) =>
            {
                Dispatcher.Invoke(() => LogMessage(message), DispatcherPriority.ContextIdle);
            };
            client = new CrackerClient(new InstanceContext(callbackHandler));
            client.Open();
            client.Connect();
        }
        public ApplicationConsole(string passwordsFile, string dictionaryFile, int packageSize) : this()
        {
            LogMessage("Starting PasswordCracker service...");
            LogMessage("Selected work mode => DICTIONARY");
            wcfhost = new WCFHost(passwordsFile, dictionaryFile, packageSize);
            LogMessage("PasswordCracker service started!");

            callbackHandler = new CallbackHandler();
            callbackHandler.PingReplyReceived += (sender, message) =>
            {
                Dispatcher.Invoke(() => LogMessage(message), DispatcherPriority.ContextIdle);
            };
            client = new CrackerClient(new InstanceContext(callbackHandler));
            client.Open();
            client.Connect();
        }