Exemplo n.º 1
0
		/// <remarks>
		/// Adds a new builder to this factory. After the builder is added
		/// codons from the builder type can be created by the factory
		/// </remarks>
		/// <exception cref="DuplicateCodonException">
		/// Is thrown when a codon builder with the same <code>CodonName</code>
		/// was already inserted
		/// </exception>
		public void AddCodonBuilder(CodonBuilder builder)
		{
			if (codonBuilderHashtable[builder.CodonName] != null) {
				throw new Exception("已经存在一个名为 : " + builder.CodonName + " 的代码子");
			}
			codonBuilderHashtable[builder.CodonName] = builder;
		}
Exemplo n.º 2
0
		/// <remarks>
		/// Adds a new builder to this factory. After the builder is added
		/// codons from the builder type can be created by the factory
		/// </remarks>
		/// <exception cref="DuplicateCodonException">
		/// Is thrown when a codon builder with the same <code>CodonName</code>
		/// was already inserted
		/// </exception>
		public void AddCodonBuilder(CodonBuilder builder)
		{
			if (codonBuilderHashtable[builder.CodonType] != null) {
				throw new DuplicateCodonException(builder.CodonType);
			}
			codonBuilderHashtable[builder.CodonType] = builder;
		}
Exemplo n.º 3
0
 /// <remarks>
 /// Adds a new builder to this factory. After the builder is added
 /// codons from the builder type can be created by the factory
 /// </remarks>
 /// <exception cref="DuplicateCodonException">
 /// Is thrown when a codon builder with the same <code>CodonName</code>
 /// was already inserted
 /// </exception>
 public void AddCodonBuilder(CodonBuilder builder)
 {
     if (codonBuilderHashtable[builder.CodonName] != null)
     {
         throw new Exception("已经存在一个名为 : " + builder.CodonName + " 的代码子");
     }
     codonBuilderHashtable[builder.CodonName] = builder;
 }
Exemplo n.º 4
0
 /// <remarks>
 /// Adds a new builder to this factory. After the builder is added
 /// codons from the builder type can be created by the factory
 /// </remarks>
 /// <exception cref="DuplicateCodonException">
 /// Is thrown when a codon builder with the same <code>CodonName</code>
 /// was already inserted
 /// </exception>
 public void AddCodonBuilder(CodonBuilder builder)
 {
     if (codonBuilderHashtable[builder.CodonType] != null)
     {
         throw new DuplicateCodonException(builder.CodonType);
     }
     codonBuilderHashtable[builder.CodonType] = builder;
 }
Exemplo n.º 5
0
        /// <remarks>
        /// Creates a new <code>ICodon</code> object using  <code>codonNode</code>
        /// as a mark of which builder to take for creation.
        /// </remarks>
        public ICodon CreateCodon(AddIn addIn, XmlNode codonNode)
        {
            CodonBuilder builder = codonBuilderHashtable[codonNode.Name] as CodonBuilder;

            if (builder != null)
            {
                return(builder.BuildCodon(addIn));
            }

            throw new Exception(String.Format("no codon builder found for <{0}>", codonNode.Name));
        }