Example #1
0
        private static bool InitializeClient(MainApplicationServiceClient mainAppClient)
        {
            if (mainAppClient == null)
            {
                throw new ArgumentNullException("mainAppClient");
            }

            try
            {
                mainAppClient.Start();
            }
            catch (Exception e)
            {
                Log.ErrorException("Failed to establish connection with main app", e);

                MessageBox.Show(String.Format(Resources.Communications_can_t_be_established_error_message, e.Message));
                return false;
            }

            var hadException = true;
            while (hadException)
            {
                try
                {
                    mainAppClient.Initialized();
                    hadException = false;
                }
                catch (Exception e)
                {
                    Log.ErrorException("Failed to establish connection with main app", e);
                }
            }

            return true;
        }
Example #2
0
        private static bool InitializeClient(MainApplicationServiceClient mainAppClient)
        {
            if (mainAppClient == null)
            {
                throw new ArgumentNullException("mainAppClient");
            }

            try
            {
                mainAppClient.Start();
            }
            catch (Exception e)
            {
                Log.ErrorException("Failed to establish connection with main app", e);

                MessageBox.Show(String.Format(Resources.Communications_can_t_be_established_error_message, e.Message));
                return(false);
            }

            var hadException = true;

            while (hadException)
            {
                try
                {
                    mainAppClient.Initialized();
                    hadException = false;
                }
                catch (Exception e)
                {
                    Log.ErrorException("Failed to establish connection with main app", e);
                }
            }

            return(true);
        }