예제 #1
0
        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);
        }
예제 #2
0
        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);
        }