Exemple #1
0
        protected override void PopulatePluginTypesLists(object[] attributeList, Type type)
        {
            // REVIEW: Taking first friendly name only if multiple friendly name attributes were specified on the phase.  Is this OK or should I raise and error/warning?
            if (attributeList != null && attributeList.Length > 0)
            {
                if (attributeList.Length > MaxAttributeCount || attributeList.Length < MinAttributeCount)
                {
                    MessageEngine.Trace(Severity.Warning, Resources.WarningMultiplePhaseFriendlyNames, type.AssemblyQualifiedName);
                }

                foreach (TPluginAttribute attribute in attributeList)
                {
                    string attributeString = attribute.ToString();

                    if (PluginTypesByAttribute.ContainsKey(attribute))
                    {
                        MessageEngine.Trace(Severity.Error, Resources.ErrorDuplicatePhaseFriendlyNameFound, attributeString);
                    }

                    PluginTypesByAttribute.Add(attribute, type);

                    if (PluginTypesByAttributeString.ContainsKey(attributeString))
                    {
                        //// Notice that this check is not a strict duplicate of the one above, since the string conversion could create dupes depending on attribute
                        MessageEngine.Trace(Severity.Error, Resources.ErrorDuplicatePhaseFriendlyNameFound, attributeString);
                    }

                    PluginTypesByAttributeString.Add(attributeString, type);
                }
            }
        }
Exemple #2
0
 protected virtual void PopulatePluginTypesLists(object[] attributeList, Type type)
 {
     // REVIEW: Taking first friendly name only if multiple friendly name attributes were specified on the phase.  Is this OK or should I raise and error/warning?
     if (attributeList != null && attributeList.Length > 0)
     {
         foreach (TPluginAttribute attribute in attributeList)
         {
             PluginTypesByAttribute.Add(attribute, type);
         }
     }
 }