Example #1
0
        public static ComplusEndpointConfigContainer Get(string appIdOrName, bool rethrow)
        {
            ComAdminAppInfo appInfo = ComAdminWrapper.GetAppInfo(appIdOrName);

            if (appInfo == null)
            {
                return(null);
            }
            try
            {
                ComplusEndpointConfigContainer container = new ComplusEndpointConfigContainer(appInfo);
                return(container);
            }
            catch (Exception ex)
            {
                if (ex is NullReferenceException || ex is SEHException)
                {
                    throw;
                }

                if (rethrow)
                {
                    throw;
                }
                else
                {
                    ToolConsole.WriteWarning(SR.GetString(SR.FailedToLoadConfigForApplicationIgnoring, appInfo.Name, ex.Message));
                }
            }
            return(null);
        }
Example #2
0
        public static List <ComplusEndpointConfigContainer> Get()
        {
            List <ComplusEndpointConfigContainer> containers = new List <ComplusEndpointConfigContainer>();

            Guid[] ids = ComAdminWrapper.GetApplicationIds();
            foreach (Guid id in ids)
            {
                ComplusEndpointConfigContainer container = ComplusEndpointConfigContainer.Get(id.ToString("B"));
                if (container != null)
                {
                    containers.Add(container);
                }
            }
            return(containers);
        }
        public static ComplusEndpointConfigContainer Get(string appIdOrName, bool rethrow)
        {
            ComAdminAppInfo appInfo = ComAdminWrapper.GetAppInfo(appIdOrName);
            if (appInfo == null)
            {
                return null;
            }
            try
            {
                ComplusEndpointConfigContainer container = new ComplusEndpointConfigContainer(appInfo);
                return container;
            }
            catch (Exception ex)
            {
                if (ex is NullReferenceException || ex is SEHException)
                {
                    throw;
                }

                if (rethrow)
                    throw;
                else
                    ToolConsole.WriteWarning(SR.GetString(SR.FailedToLoadConfigForApplicationIgnoring, appInfo.Name, ex.Message));
            }
            return null;
        }