private void AddReferences(){
if (VsaEngine.assemblyReferencesTable == null) {
// Create the cache
Hashtable h = new Hashtable();
VsaEngine.assemblyReferencesTable = Hashtable.Synchronized(h);
}
String[] references = VsaEngine.assemblyReferencesTable[this.runtimeAssembly.FullName] as String[];
if (references != null){
for (int i = 0; i < references.Length; i++){
VsaReference r = (VsaReference)this.vsaItems.CreateItem(references[i], VsaItemType.Reference, VsaItemFlag.None);
r.AssemblyName = references[i];
}
}else{
// Read the references from the custom attribute on the assembly and create VsaReferences for each
// of them.
Object[] attrs = CustomAttribute.GetCustomAttributes(this.runtimeAssembly, typeof(ReferenceAttribute), false);
String[] references1 = new String[attrs.Length];
for (int i = 0; i < attrs.Length; i++){
String assemblyName = ((ReferenceAttribute)attrs[i]).reference;
VsaReference r = (VsaReference)this.vsaItems.CreateItem(assemblyName, VsaItemType.Reference, VsaItemFlag.None);
r.AssemblyName = assemblyName;
references1[i] = assemblyName;
}
VsaEngine.assemblyReferencesTable[this.runtimeAssembly.FullName] = references1;
}
}