Exemple #1
0
        public void ObjServiceCopy(String sourceObjectPathString, String targetLocPathString)
        {
            // identify the object to copy
            ObjectPath     objPath   = new ObjectPath(sourceObjectPathString);
            ObjectIdentity docToCopy = new ObjectIdentity();

            docToCopy.Value          = objPath;
            docToCopy.RepositoryName = DefaultRepository;

            // identify the folder to copy to
            ObjectPath     folderPath       = new ObjectPath(targetLocPathString);
            ObjectIdentity toFolderIdentity = new ObjectIdentity();

            toFolderIdentity.Value          = folderPath;
            toFolderIdentity.RepositoryName = DefaultRepository;
            ObjectLocation toLocation = new ObjectLocation();

            toLocation.Identity = toFolderIdentity;

            OperationOptions operationOptions = null;

            objectService.Copy(new ObjectIdentitySet(docToCopy),
                               toLocation,
                               new DataPackage(),
                               operationOptions);
        }