Esempio n. 1
0
		public virtual void HandleCopyCommand(Slice newSlice)
		{
			CheckDisposed();

			int hvoOriginal = GetObjectHvoForMenusToOperateOn();
			if (hvoOriginal <= 0)
				throw new ConfigurationException("OriginalSlice:GetObjectHvoForMenusToOperateOn is either messed up or should not have been called, because it could not find the object to be moved to a copy of its owner.", m_configurationNode);

			int hvoNew = newSlice.GetObjectHvoForMenusToOperateOn();
			if (hvoNew <= 0)
				throw new ConfigurationException("NewSlice:GetObjectHvoForMenusToOperateOn is either messed up or should not have been called, because it could not find the object to be moved to a copy of its owner.", m_configurationNode);

			ICmObject objOriginal = CmObject.CreateFromDBObject(Cache, hvoOriginal);
			ICmObject objNew = CmObject.CreateFromDBObject(Cache, hvoNew);
			if (objOriginal != null && objNew != null)
				objOriginal.CopyTo(objNew);
		}