public virtual int AddOption(OptionDescriptor o) { int last_index = options.Count; int current_value = last_index; options[last_index++] = o; return(current_value); }
public virtual bool RemoveOption(OptionDescriptor o) { bool result = false; foreach (KeyValuePair <int, OptionDescriptor> entry in options) { if (entry.Value.Equals(o)) { options.Remove(entry.Key); result = true; } } return(result); }