Exemplo n.º 1
0
 public void AddClassToNamespaceList(IClass addClass)
 {
     lock (namespaces) {
         AddClassToNamespaceListInternal(addClass);
     }
     DomCache.Clear();
 }
Exemplo n.º 2
0
        public void UpdateCompilationUnit(ICompilationUnit oldUnit, ICompilationUnit parserOutput, string fileName)
        {
            // DC: Since we need to update the compilation units with more data, the Freeze below makes the classes to be ReadOnly (which prevent adding new ones)
            // so for now I'm commenting out this line (and need to figure out what are its side effects)

            // maybe I need this after all

            parserOutput.Freeze();
            lock (namespaces) {
                if (oldUnit != null)
                {
                    foreach (IClass c in oldUnit.Classes)
                    {
                        RemoveClass(c);
                    }
                    foreach (IAttribute attr in oldUnit.Attributes)
                    {
                        assemblyAttributes.Remove(attr);
                    }
                }

                foreach (IClass c in parserOutput.Classes)
                {
                    AddClassToNamespaceListInternal(c);
                }
                assemblyAttributes.AddRange(parserOutput.Attributes);
            }
            DomCache.Clear();
        }
Exemplo n.º 3
0
 protected virtual void OnReferencedContentsChanged(EventArgs e)
 {
     systemTypes = null;             // re-create system types
     DomCache.Clear();
     if (ReferencedContentsChanged != null)
     {
         ReferencedContentsChanged(this, e);
     }
 }
Exemplo n.º 4
0
 public void RemoveCompilationUnit(ICompilationUnit unit)
 {
     lock (namespaces) {
         foreach (IClass c in unit.Classes)
         {
             RemoveClass(c);
         }
         foreach (IAttribute attr in unit.Attributes)
         {
             assemblyAttributes.Remove(attr);
         }
     }
     DomCache.Clear();
 }
Exemplo n.º 5
0
        public void UpdateCompilationUnit(ICompilationUnit oldUnit, ICompilationUnit parserOutput, string fileName)
        {
            parserOutput.Freeze();
            lock (namespaces) {
                if (oldUnit != null)
                {
                    foreach (IClass c in oldUnit.Classes)
                    {
                        RemoveClass(c);
                    }
                    foreach (IAttribute attr in oldUnit.Attributes)
                    {
                        assemblyAttributes.Remove(attr);
                    }
                }

                foreach (IClass c in parserOutput.Classes)
                {
                    AddClassToNamespaceListInternal(c);
                }
                assemblyAttributes.AddRange(parserOutput.Attributes);
            }
            DomCache.Clear();
        }