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 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()); }
protected override void InitValue() { m_enumItems = (EveryItemEnum)Convert.ToInt32(Value); }