Ejemplo n.º 1
0
        internal static object MessageClassDisplayNameGetter(IPropertyBag propertyBag)
        {
            string text = (string)propertyBag[ElcContentSettingsSchema.MessageClass];

            if (string.IsNullOrEmpty(text))
            {
                return(null);
            }
            return(ElcMessageClass.GetDisplayName(text));
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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;
        }
Ejemplo n.º 6
0
 public static ElcMessageClass Parse(string expression)
 {
     return(ElcMessageClass.GetMessageClass(expression));
 }
Ejemplo n.º 7
0
 public ElcMessageClass(string messageClass) : this(messageClass, ElcMessageClass.GetDisplayName(messageClass))
 {
 }