private void LoadContainerPath() { if (_deposit != null && _containerPath == "") { StringBuilder pathRow = new StringBuilder(); GenericContainerList pathList = _deposit.GetContainerPath(); foreach (IGenericContainer singleContainer in pathList) { pathRow.Append("//"); pathRow.Append(singleContainer.GetIdentifier()); } pathRow.Append("//"); pathRow.Append(_deposit.GetIdentifier()); _containerPath = pathRow.ToString(); } }
private void LoadContainerPath() { if (IsNotNull(MyStorageContainer) && MyContainerPath == "") { GenericContainerList pathList; StringBuilder pathRow = new StringBuilder(); pathList = MyStorageContainer.GetContainerPath(); foreach (IGenericContainer singleContainer in pathList) { pathRow.Append("//"); pathRow.Append(singleContainer.GetIdentifier()); } pathRow.Append("//"); pathRow.Append(GetStorageContainerName()); MyContainerPath = pathRow.ToString(); } }
private static void CheckCirularReferens(IGenericContainer moveContainer, IGenericContainer toContainer) { GenericContainerList containerPath; // Check that containers not are moved into it's own content. // Avoid circular reference. if (IsNotNull(toContainer)) { containerPath = toContainer.GetContainerPath(); //Add the destination container itself to the path. containerPath.Add(toContainer); if (containerPath.IsMember(moveContainer)) { throw new DataException("Can't move " + moveContainer.GetIdentifier() + " into " + toContainer.GetIdentifier() + ". Circular referenses are not allowed!"); } } }