public virtual void renameConfigurable(string oldName, string newName) { PropertySheet propertySheet = this.getPropertySheet(oldName); if (propertySheet == null) { string text = new StringBuilder().append("no configurable (to be renamed) named ").append(oldName).append(" is contained in the CM").toString(); throw new RuntimeException(text); } ConfigurationManagerUtils.renameComponent(this, oldName, newName); this.symbolTable.remove(oldName); this.symbolTable.put(newName, propertySheet); RawPropertyData rawPropertyData = (RawPropertyData)this.rawPropertyMap.remove(oldName); this.rawPropertyMap.put(newName, new RawPropertyData(newName, rawPropertyData.getClassName(), rawPropertyData.getProperties())); this.fireRenamedConfigurable(oldName, newName); }
public virtual PropertySheet getPropertySheet(string instanceName) { if (!this.symbolTable.containsKey(instanceName)) { RawPropertyData rawPropertyData = (RawPropertyData)this.rawPropertyMap.get(instanceName); if (rawPropertyData != null) { string className = rawPropertyData.getClassName(); try { try { try { Class @class = Class.forName(className, ConfigurationManager.__GetCallerID()); PropertySheet propertySheet = new PropertySheet(@class.asSubclass(ClassLiteral <Configurable> .Value), instanceName, this, rawPropertyData); this.symbolTable.put(instanceName, propertySheet); } catch (ClassNotFoundException ex) { java.lang.System.err.println(new StringBuilder().append("class not found !").append(ex).toString()); goto IL_11B; } } catch (System.Exception ex3) { java.lang.System.err.println(new StringBuilder().append("can not cast class !").append(ex3).toString()); goto IL_11B; } } catch (System.Exception ex6) { java.lang.System.err.println(new StringBuilder().append("couldn't load class !").append(ex6).toString()); } } } IL_11B: return((PropertySheet)this.symbolTable.get(instanceName)); }