/* * Updates the parent for non private types. */ public static void UpdateParent(this IRTypeNode type, IRNamespace newNS) { if (type.IsPrivate == false) { type.Parent = newNS; } else { // We leave private types alone because they must keep referencing their parent class. } }
/* * Updates the naming of the given type. */ public static void UpdateTypeName(this IRTypeNode type, IRNamespace newNS) { // Only update the full name. type.FullName = newNS.FullName.Trim('.') + "." + type.ShortName; // Don't touch the shortname! }
/* * Updates all references made from the given type to other types. */ public static void UpdateTypeReferences(this IRTypeNode type, IRNamespace newNS, IRNamespace oldNS) { type.UpdateTypeName(newNS); type.UpdateParent(newNS); }