Example #1
0
        public bool AutoALMProjectConnect(eALMConnectType almConnectStyle = eALMConnectType.Silence, bool showConnWin = true, bool asConnWin = false)
        {
            if (AlmCore == null)//added because when running from CLI the AlmCore is Null on connection
            {
                UpdateALMType(ALMCore.GetDefaultAlmConfig().AlmType);
            }

            int  retryConnect = 0;
            bool isConnected  = false;

            while (!isConnected && retryConnect < 2)
            {
                try { isConnected = ConnectALMProject(); }
                catch (Exception e) { Reporter.ToLog(eLogLevel.ERROR, $"Method - {MethodBase.GetCurrentMethod().Name}, Error - {e.Message}", e); }
                retryConnect++;
            }
            if (!isConnected && almConnectStyle != eALMConnectType.Silence)
            {
                if (showConnWin)
                {
                    App.MainWindow.Dispatcher.Invoke(() =>
                    {
                        ALMConnectionPage almConnPage = new ALMConnectionPage(almConnectStyle, asConnWin);
                        almConnPage.ShowAsWindow();
                    });
                    try { isConnected = ConnectALMProject(); }
                    catch (Exception e) { Reporter.ToLog(eLogLevel.ERROR, $"Method - {MethodBase.GetCurrentMethod().Name}, Error - {e.Message}", e); }
                }
            }

            return(isConnected);
        }
Example #2
0
        public bool AutoALMProjectConnect(eALMConnectType almConnectStyle = eALMConnectType.Silence, bool showConnWin = true, bool asConnWin = false)
        {
            int  retryConnect = 0;
            bool isConnected  = false;

            while (!isConnected && retryConnect < 2)
            {
                try { isConnected = ConnectALMProject(); }
                catch (Exception e) { Reporter.ToLog(eLogLevel.ERROR, $"Method - {MethodBase.GetCurrentMethod().Name}, Error - {e.Message}", e); }
                retryConnect++;
            }
            if (!isConnected && almConnectStyle != eALMConnectType.Silence)
            {
                if (showConnWin)
                {
                    ALMConnectionPage almConnPage = new ALMConnectionPage(almConnectStyle, asConnWin);
                    almConnPage.ShowAsWindow();
                    try { isConnected = ConnectALMProject(); }
                    catch (Exception e) { Reporter.ToLog(eLogLevel.ERROR, $"Method - {MethodBase.GetCurrentMethod().Name}, Error - {e.Message}", e); }
                }
            }

            return(isConnected);
        }