Ejemplo n.º 1
0
        /// <summary>
        /// Merges the declarations.
        /// </summary>
        private void mergeDeclarations()
        {
            foreach (QualifiedName functionName in functionChages)
            {
                HashSet <FunctionValue> declarations = new HashSet <FunctionValue>();
                foreach (var context in snapshotContexts)
                {
                    IEnumerable <FunctionValue> decl;
                    if (context.SourceStructure.TryGetFunction(functionName, out decl))
                    {
                        CollectionMemoryUtils.AddAll(declarations, decl);
                    }
                }
                writeableTargetStructure.SetFunctionDeclarations(functionName, declarations);
            }

            foreach (QualifiedName className in classChanges)
            {
                HashSet <TypeValue> declarations = new HashSet <TypeValue>();
                foreach (var context in snapshotContexts)
                {
                    IEnumerable <TypeValue> decl;
                    if (context.SourceStructure.TryGetClass(className, out decl))
                    {
                        CollectionMemoryUtils.AddAll(declarations, decl);
                    }
                }
                writeableTargetStructure.SetClassDeclarations(className, declarations);
            }
        }