public void InsertAddIn(AddIn addIn)
 {
     addIns.Add(addIn);
     foreach (AddIn.Extension extension in addIn.Extensions)
     {
         AddExtensions(extension);
     }
 }
 /// <summary>
 /// Add a <see cref="AddIn"/> object to the tree, inserting all it's extensions.
 /// </summary>
 public void InsertAddIn(AddIn addIn)
 {
     addIns.Add(addIn);
     foreach (AddIn.Extension extension in addIn.Extensions)
     {
         //先根据一个如<Extension path = "/Workspace/Services">之类的extension.Path扩展路径创建一个节点
         DefaultAddInTreeNode currentNode = CreateTreeNode(root, extension.Path);
         //然后对该扩展路径下的代码子集合列表进行迭代,分别创建为currentNode的子节点,以构成一个树状结构
         foreach (ICodon codon in extension.CodonCollection)
         {
             DefaultAddInTreeNode currentChildNode = CreateTreeNode(currentNode, codon.ID);
             if (currentChildNode.Codon != null)
             {
                 throw new Exception("已经存在一个名为 : " + codon.ID + " 的代码子");
             }
             currentChildNode.Codon = codon;
         }
     }
 }