internal static object MessageClassDisplayNameGetter(IPropertyBag propertyBag)
        {
            string text = (string)propertyBag[ElcContentSettingsSchema.MessageClass];

            if (string.IsNullOrEmpty(text))
            {
                return(null);
            }
            return(ElcMessageClass.GetDisplayName(text));
        }
        public static ElcMessageClass[] GetStandardMessageClasses()
        {
            ElcMessageClass[] array = new ElcMessageClass[ElcMessageClass.standardList.Count];
            int num = 0;

            foreach (KeyValuePair <string, string> keyValuePair in ElcMessageClass.standardList)
            {
                array[num] = new ElcMessageClass(keyValuePair.Key, keyValuePair.Value);
                num++;
            }
            return(array);
        }
        public static ElcMessageClass GetMessageClass(string messageClass)
        {
            if (messageClass == null)
            {
                throw new ArgumentNullException("messageClass");
            }
            string          text;
            ElcMessageClass result;

            if (!ElcMessageClass.standardList.TryGetValue(messageClass, out text))
            {
                result = new ElcMessageClass(messageClass, null);
            }
            else
            {
                result = new ElcMessageClass(messageClass, text);
            }
            return(result);
        }
        internal static object ELCMessageClassGetter(IPropertyBag propertyBag)
        {
            string text = (string)propertyBag[ElcContentSettingsSchema.MessageClassString];

            if (ElcMessageClass.IsMultiMessageClassDeputy(text))
            {
                StringBuilder stringBuilder = new StringBuilder(128);
                MultiValuedProperty <string> multiValuedProperty = (MultiValuedProperty <string>)propertyBag[ElcContentSettingsSchema.MessageClassArray];
                multiValuedProperty.Sort();
                foreach (string value in multiValuedProperty)
                {
                    stringBuilder.Append(value);
                    stringBuilder.Append(ElcMessageClass.MessageClassDelims[0]);
                }
                stringBuilder.Length--;
                text = stringBuilder.ToString();
            }
            return(text);
        }
        internal static void ELCMessageClassSetter(object value, IPropertyBag propertyBag)
        {
            string text = (string)value;

            if (ElcMessageClass.IsMultiMessageClass(text))
            {
                string[] array = ((string)value).Split(ElcMessageClass.MessageClassDelims, StringSplitOptions.RemoveEmptyEntries);
                if (array.Length == 0)
                {
                    text = string.Empty;
                }
                else if (array.Length == 1)
                {
                    text = array[0];
                }
                else
                {
                    MultiValuedProperty <string> value2 = new MultiValuedProperty <string>(array);
                    propertyBag[ElcContentSettingsSchema.MessageClassArray] = value2;
                    text = ElcMessageClass.MultiMessageClassDeputy;
                }
            }
            propertyBag[ElcContentSettingsSchema.MessageClassString] = text;
        }
 public static ElcMessageClass Parse(string expression)
 {
     return(ElcMessageClass.GetMessageClass(expression));
 }
 public ElcMessageClass(string messageClass) : this(messageClass, ElcMessageClass.GetDisplayName(messageClass))
 {
 }