コード例 #1
0
        public virtual int AddOption(OptionDescriptor o)
        {
            int last_index    = options.Count;
            int current_value = last_index;

            options[last_index++] = o;
            return(current_value);
        }
コード例 #2
0
        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);
        }