Example #1
0
        public void CopyItem(SyncItem source, ID destination, string copyName, ID copyId)
        {
            Assert.ArgumentNotNull(source, "source");
            Assert.ArgumentNotNull(destination, "destination");
            Assert.ArgumentNotNullOrEmpty(copyName, "copyName");
            Assert.ArgumentNotNull(copyId, "copyId");

            var destinationItem = GetItem(destination);

            Assert.IsNotNull(destinationItem, "Could not copy {0}  to {1} because the destination did not exist!", source.ID, destination);

            var newItem = source.Clone();

            newItem.ID       = copyId.ToString();
            newItem.ParentID = destination.ToString();
            newItem.ItemPath = string.Concat(destinationItem.ItemPath, "/", copyName);
            newItem.Name     = copyName;

            SaveItem(newItem);
        }
Example #2
0
		public void CopyItem(SyncItem source, ID destination, string copyName, ID copyId)
		{
			Assert.ArgumentNotNull(source, "source");
			Assert.ArgumentNotNull(destination, "destination");
			Assert.ArgumentNotNullOrEmpty(copyName, "copyName");
			Assert.ArgumentNotNull(copyId, "copyId");

			var destinationItem = GetItem(destination);

			Assert.IsNotNull(destinationItem, "Could not copy {0}  to {1} because the destination did not exist!", source.ID, destination);

			var newItem = source.Clone();

			newItem.ID = copyId.ToString();
			newItem.ParentID = destination.ToString();
			newItem.ItemPath = string.Concat(destinationItem.ItemPath, "/", copyName);
			newItem.Name = copyName;

			SaveItem(newItem);
		}