コード例 #1
0
        // Token: 0x0600001D RID: 29 RVA: 0x000028C4 File Offset: 0x00000AC4
        static ProvidersTable()
        {
            StringBuilder stringBuilder = new StringBuilder();

            foreach (Type type in ProvidersTable.availableProviderTypes.Member.Keys)
            {
                if (ProvidersTable.TryAddProviderType(type, ProvidersTable.availableProviderTypes.Member[type]))
                {
                    stringBuilder.Append(string.Format("[{0}]", type.AssemblyQualifiedName));
                }
                else
                {
                    ExTraceGlobals.FrameworkTracer.TraceError <string>(0L, "[ProvidersTable] 'Could not load provider \"{0}\"", type.AssemblyQualifiedName);
                }
            }
            ProvidersTable.CompileRequestSchemaSet();
            if (ProvidersTable.providersList.Count == 0)
            {
                ExTraceGlobals.FrameworkTracer.TraceError(0L, "[ProvidersTable] No providers loaded.");
                Common.EventLog.LogEvent(AutodiscoverEventLogConstants.Tuple_ErrCoreNoProvidersFound, Common.PeriodicKey, new object[0]);
                return;
            }
            ExTraceGlobals.FrameworkTracer.TraceDebug <StringBuilder>(0L, "[ProvidersTable] {0} providers found", stringBuilder);
            Common.EventLog.LogEvent(AutodiscoverEventLogConstants.Tuple_InfoCoreProvidersLoaded, Common.PeriodicKey, new object[]
            {
                stringBuilder.ToString()
            });
        }
コード例 #2
0
        // Token: 0x06000021 RID: 33 RVA: 0x00002BE8 File Offset: 0x00000DE8
        public static Provider LoadProvider(RequestData requestData)
        {
            Provider     result       = null;
            ProviderInfo providerInfo = ProvidersTable.FindProvider(requestData);

            if (providerInfo != null)
            {
                result = providerInfo.CreateProvider(requestData);
            }
            return(result);
        }
コード例 #3
0
 // Token: 0x0600001F RID: 31 RVA: 0x00002A58 File Offset: 0x00000C58
 private static bool TryAddProviderType(Type type, CreateProviderDelegate createProvider)
 {
     try
     {
         foreach (object obj in type.GetCustomAttributes(typeof(ProviderAttribute), false))
         {
             ProviderAttribute attributes   = obj as ProviderAttribute;
             ProviderInfo      providerInfo = new ProviderInfo(type, attributes, createProvider);
             ProvidersTable.providersList.Add(providerInfo);
             XmlSchema xmlSchema = ProvidersTable.LoadSchemaFromResource(type.Assembly, providerInfo.Attributes.RequestSchemaFile);
             if (!ProvidersTable.RequestSchemaSet.Contains(xmlSchema.TargetNamespace))
             {
                 ExTraceGlobals.FrameworkTracer.TraceDebug <string, string>(0L, "[ProvidersTable::TryAddProviderType] 'adding request schema to ProvidersTable' TargetNamespace=\"{0}\";SourceUri=\"{1}\"", xmlSchema.TargetNamespace, xmlSchema.SourceUri);
                 ProvidersTable.RequestSchemaSet.Add(xmlSchema);
                 return(true);
             }
         }
     }
     catch (FormatException ex)
     {
         ExTraceGlobals.FrameworkTracer.TraceError <string, string>(0L, "[ProvidersTable::TryAddProviderType] Message=\"{0}\";StackTrace=\"{1}\"", ex.Message, ex.StackTrace);
         Common.EventLog.LogEvent(AutodiscoverEventLogConstants.Tuple_WarnCoreProviderAttributeException, Common.PeriodicKey, new object[]
         {
             type.FullName,
             ex.Message
         });
     }
     catch (ArgumentNullException ex2)
     {
         ExTraceGlobals.FrameworkTracer.TraceError <string, string>(0L, "[ProvidersTable::TryAddProviderType] Message=\"{0}\";StackTrace=\"{1}\"", ex2.Message, ex2.StackTrace);
         Common.EventLog.LogEvent(AutodiscoverEventLogConstants.Tuple_WarnCoreProviderAttributeException, Common.PeriodicKey, new object[]
         {
             type.FullName,
             ex2.Message
         });
     }
     return(false);
 }