public ObjHandle CreateOrOverwriteObject(string name, string type, object[,] range) { ObjHandle newObj = (ObjHandle)Activator.CreateInstance(Type.GetType(typeof(ObjHandle).Namespace + "." + type, true, true)); newObj.Create(Tools.StringTrim(name), range); ObjList.Add(newObj.TakeOverOldObject(this)); return(newObj); }
public ObjHandle TakeOverOldObject(ObjectHandler objHandler) { ObjHandle existingObj = objHandler.GetObject(_name, GetType().Name); if (existingObj != null) { _counter = existingObj._counter + 1; objHandler.ObjList.Remove(existingObj); } return(this); }