示例#1
0
        public void AddTopCluster(Cluster topCluster)
        {
            ArgumentValidator.ThrowIfNull(topCluster, "topCluster");

            // It's possible for the same cluster to be added to a context as a TopCluster. For example, gsp.vim runtimes html.vim, which in turn
            // includes javaScript.vim into @htmlJavaScript. But then gsp.vim later includes java.vim, which in turn
            // re-includes html.vim. Got that? :)  Well, when html.vim is re-included, it tries to include javascript.vim
            // _again_, and into the same cluster, @htmlJavaScript. In those cases, we just return.
            if (this.TopClusters.Contains(topCluster)) {
                return;
            }

            for (int i = 0; i < this.TopItems.Items.Length; i++) {
                topCluster.AddDirectItem(this.TopItems.Items[i]);
            }

            this.TopClusters.Add(topCluster);
        }
示例#2
0
 public ContainerItem(SyntaxContext context, string groupName)
     : base(context, groupName)
 {
     this.m_contains = new Cluster(context);
     this.m_containedItems = new SetOfSyntaxItems();
 }