예제 #1
0
        /// <summary>
        /// This loads up all version information for a document (using the Versions web
        /// service) and stores it in a collection of <see cref="SharePointDocumentVersion"/>
        /// objects. Even if versioning isn't turned on in a document library, there's
        /// always version 1.
        /// </summary>
        public void LoadVersions()
        {
            Versions ws = NewVersionsWebService();

            try
            {
                XmlNode node = ws.GetVersions(fullNameWithPath);
                foreach (XmlNode ver in node)
                {
                    if (ver.Name == "result")
                    {
                        SharePointDocumentVersion version = new SharePointDocumentVersion(siteUrl);
                        version.Version    = ver.Attributes["version"].Value;
                        version.CreatedBy  = ver.Attributes["createdBy"].Value;
                        version.Size       = Convert.ToInt32(ver.Attributes["size"].Value);
                        version.VersionUrl = ver.Attributes["url"].Value;
                        version.Comments   = ver.Attributes["comments"].Value;
                        versions.Add(version);
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
예제 #2
0
		/// <summary>
		/// This loads up all version information for a document (using the Versions web
		/// service) and stores it in a collection of <see cref="SharePointDocumentVersion"/>
		/// objects. Even if versioning isn't turned on in a document library, there's 
		/// always version 1.
		/// </summary>
		public void LoadVersions()
		{
			Versions ws = NewVersionsWebService();
			try
			{
				XmlNode node = ws.GetVersions(fullNameWithPath);
				foreach (XmlNode ver in node)
				{
					if(ver.Name == "result")
					{
						SharePointDocumentVersion version = new SharePointDocumentVersion(siteUrl);
						version.Version = ver.Attributes["version"].Value;
						version.CreatedBy = ver.Attributes["createdBy"].Value;
						version.Size = Convert.ToInt32(ver.Attributes["size"].Value);
						version.VersionUrl = ver.Attributes["url"].Value;
						version.Comments = ver.Attributes["comments"].Value;
						versions.Add(version);
					}
				}
			}
			catch (Exception e)
			{
				Console.WriteLine(e.Message);
			}
		}