示例#1
0
        private static WSResource ResourceToWSResource(Resource resource)
        {
            WSResource toAdd = (resource is Collection) ? new WSCollection() : new WSResource();

            toAdd.authorUserName      = resource.authorUserName;
            toAdd.description         = resource.description;
            toAdd.mediaType           = resource.mediaType;
            toAdd.properties          = resource.properties;
            toAdd.createdTime         = resource.createdTime;
            toAdd.id                  = resource.id;
            toAdd.lastModified        = resource.lastModified;
            toAdd.lastUpdaterUserName = resource.lastUpdaterUserName;
            toAdd.parentPath          = resource.parentPath;
            toAdd.path                = resource.path;
            toAdd.matchingSnapshotID  = resource.matchingSnapshotID;
            toAdd.contentFile         = resource.contentFile;

            if (resource is Collection)
            {
                toAdd.collection = true;
                ((WSCollection)toAdd).children   = ((Collection)resource).children;
                ((WSCollection)toAdd).childCount = ((Collection)resource).childCount;
            }
            return(toAdd);
        }
示例#2
0
        /// <summary>
        /// Returns the meta data of the resource at a given path.
        /// </summary>
        /// <param name="path">Path of the resource. e.g. /project1/server/deployment.xml</param>
        /// <returns>Resource instance</returns>
        public Resource GetMetaData(String path)
        {
            WSResource resource = null;

            execute(delegate() { resource = client.WSgetMetaData(path); });
            Resource output = new Resource(this, resource);

            output.PathWithVersion = path;
            return(output);
        }
示例#3
0
        /// <summary>
        /// Returns the resource at the given path.
        /// </summary>
        /// <param name="path">Path of the resource. e.g. /project1/server/deployment.xml</param>
        /// <returns>Resource instance</returns>
        public Resource Get(String path)
        {
            WSResource resource = null;

            execute(delegate() { resource = client.WSget(path); });
            Resource output = resource.collection ?
                              new Collection(this, (WSCollection)resource)
                : new Resource(this, resource);

            output.PathWithVersion = path;
            return(output);
        }
示例#4
0
 public Resource(RegistryClient client, WSResource resource)
     : this(client)
 {
     this.authorUserName = resource.authorUserName;
     this.description = resource.description;
     this.mediaType = resource.mediaType;
     this.properties = resource.properties;
     this.createdTime = resource.createdTime;
     this.id = resource.id;
     this.lastModified = resource.lastModified;
     this.lastUpdaterUserName = resource.lastUpdaterUserName;
     this.parentPath = resource.parentPath;
     this.path = resource.path;
     this.matchingSnapshotID = resource.matchingSnapshotID;
 }
示例#5
0
 public Resource(RegistryClient client, WSResource resource)
     : this(client)
 {
     this.authorUserName      = resource.authorUserName;
     this.description         = resource.description;
     this.mediaType           = resource.mediaType;
     this.properties          = resource.properties;
     this.createdTime         = resource.createdTime;
     this.id                  = resource.id;
     this.lastModified        = resource.lastModified;
     this.lastUpdaterUserName = resource.lastUpdaterUserName;
     this.parentPath          = resource.parentPath;
     this.path                = resource.path;
     this.matchingSnapshotID  = resource.matchingSnapshotID;
 }