Exemplo n.º 1
0
 public void AddOption(OPTIONS_ENUM optionEnum, OWLTROption newOption)
 {
     if (options.ContainsKey(optionEnum))
     {
         OWLTROption current = options[optionEnum];
         OWLTROption updated = new OWLTROption(newOption.Name, newOption.Description, current.Setting);
         options[optionEnum] = updated;
     }
     else
     {
         options.Add(optionEnum, newOption);
     }
 }
Exemplo n.º 2
0
        public void Deserialize(GenericReader reader)
        {
            int version = reader.ReadInt();

            int count = reader.ReadInt();

            Options = new Dictionary <OPTIONS_ENUM, OWLTROption>(count);
            while (count-- > 0)
            {
                OPTIONS_ENUM id = OPTIONS_ENUM.UNKNOWN;
                try
                {
                    id = (OPTIONS_ENUM)reader.ReadInt();
                }
                catch { }
                OWLTROption option = new OWLTROption(reader);
                if (id != OPTIONS_ENUM.UNKNOWN && !Options.ContainsKey(id))
                {
                    AddOption(id, option);
                }
            }
        }