Example #1
0
        internal static object GetAssociatedSection(ContextInformation evalContext, string sectionPath)
        {
            object section = null;

            if (evalContext == null)
            {
                section = (!(bool)InvokeHelper.InvokeStaticGet(typeof(ServiceHostingEnvironment), "IsHosted") ? ConfigurationManager.GetSection(sectionPath) : Microsoft.ServiceBus.Configuration.ConfigurationHelpers.GetSectionFromWebConfigurationManager(sectionPath));
                if (Microsoft.ServiceBus.Diagnostics.DiagnosticUtility.ShouldTraceVerbose)
                {
                    TraceUtility.TraceEvent(TraceEventType.Verbose, TraceCode.GetConfigurationSection, new StringTraceRecord("ConfigurationSection", sectionPath), null, null);
                }
            }
            else
            {
                section = evalContext.GetSection(sectionPath);
            }
            if (section == null)
            {
                ExceptionUtility exceptionUtility      = Microsoft.ServiceBus.Diagnostics.DiagnosticUtility.ExceptionUtility;
                string           configSectionNotFound = Resources.ConfigSectionNotFound;
                object[]         objArray = new object[] { sectionPath };
                throw exceptionUtility.ThrowHelperError(new ConfigurationErrorsException(Microsoft.ServiceBus.SR.GetString(configSectionNotFound, objArray)));
            }
            return(section);
        }
Example #2
0
        private static object GetSectionFromWebConfigurationManager(string sectionPath)
        {
            string str = (string)InvokeHelper.InvokeStaticGet(typeof(ServiceHostingEnvironment), "CurrentVirtualPath");

            if (str == null)
            {
                return(WebConfigurationManager.GetSection(sectionPath));
            }
            return(WebConfigurationManager.GetSection(sectionPath, str));
        }
Example #3
0
 internal static object GetAlternativeIssuerEndpoints(System.ServiceModel.Security.Tokens.IssuedSecurityTokenParameters issuedTokenParameters)
 {
     return(InvokeHelper.InvokeStaticGet(typeof(System.ServiceModel.Security.Tokens.IssuedSecurityTokenParameters), "AlternativeIssuerEndpoints"));
 }