public static PrefDuration[] GetList(bool allowDefault) { List <PrefDuration> list = new List <PrefDuration>(); if (allowDefault) { list.Add(Default); } // read available choices from options list for (int i = 0; i < options.Length; i++) { int s = options[i]; PrefDuration pd = new PrefDuration(s); list.Add(pd); } PrefDuration[] arr = list.ToArray(); list.Clear(); list = null; return(arr); }
public override bool Equals(object obj) { PrefDuration d = obj as PrefDuration; if (d != null) { return(this.Duration == d.Duration); } else { return(base.Equals(obj)); } }
public static PrefDuration[] GetList(bool allowDefault) { List<PrefDuration> list = new List<PrefDuration>(); if (allowDefault) list.Add(Default); // read available choices from options list for(int i=0;i<options.Length;i++) { int s = options[i]; PrefDuration pd = new PrefDuration(s); list.Add(pd); } PrefDuration[] arr = list.ToArray(); list.Clear(); list = null; return arr; }