public override void ParseValue(string value)
        {
            string[] vals = value.Split(',');

            if (vals.Length == 3)
            {
                EveryItems = (EveryItemEnum)Convert.ToInt32(vals[0]);
                CountWeek = Convert.ToInt32(vals[1]);
                CountMonth = Convert.ToInt32(vals[2]);
            }
        }
        public override void ParseValue(string value)
        {
            string[] vals = value.Split(',');

            if (vals.Length == 3)
            {
                EveryItems = (EveryItemEnum)Convert.ToInt32(vals[0]);
                CountWeek  = Convert.ToInt32(vals[1]);
                CountMonth = Convert.ToInt32(vals[2]);
            }
        }
Exemplo n.º 3
0
        public static string EveryItemToString(EveryItemEnum EveryItems, int week, int month)
        {
            StringBuilder sb = new StringBuilder(100);

            if ((EveryItems & EveryItemEnum.EveryWeek) != EveryItemEnum.Empty)
            {
                string val = Localizer.GetLocalized("EveryWeek");
                if (String.IsNullOrEmpty(val))
                {
                    val = "Every week";
                }

                if (week > 1)
                {
                    val = String.Format("{0}({1})", val, week);
                }
                sb.Append(val);
            }
            if ((EveryItems & EveryItemEnum.EveryMonth) != EveryItemEnum.Empty)
            {
                string val = Localizer.GetLocalized("EveryMonth");
                if (String.IsNullOrEmpty(val))
                {
                    val = "Every month";
                }
                if (sb.Length > 0)
                {
                    sb.Append(", ");
                }
                if (week > 1)
                {
                    val = String.Format("{0}({1})", val, month);
                }
                sb.Append(val);
            }
            if ((EveryItems & EveryItemEnum.EveryYear) != EveryItemEnum.Empty)
            {
                string val = Localizer.GetLocalized("EveryYear");
                if (String.IsNullOrEmpty(val))
                {
                    val = "Every year";
                }
                if (sb.Length > 0)
                {
                    sb.Append(", ");
                }
                sb.Append(val);
            }
            return(sb.ToString());
        }
Exemplo n.º 4
0
 protected override void InitValue()
 {
     m_enumItems = (EveryItemEnum)Convert.ToInt32(Value);
 }