HashDocumentNameForTemporaryIndex() public static method

Computes the hash value of a string that is value across application instances and versions.
public static HashDocumentNameForTemporaryIndex ( string value ) : uint
value string The string to compute the hash of.
return uint
示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:FileDocument" /> class.
        /// </summary>
        /// <param name="fullName">The file full name.</param>
        /// <param name="provider">The file provider.</param>
        /// <param name="dateTime">The modification date/time.</param>
        public FileDocument(string fullName, string provider, DateTime dateTime)
        {
            if (fullName == null)
            {
                throw new ArgumentNullException("fullName");
            }
            if (fullName.Length == 0)
            {
                throw new ArgumentException("Full Name cannot be empty", "fullName");
            }
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }
            if (provider.Length == 0)
            {
                throw new ArgumentException("Provider cannot be empty", "provider");
            }

            id            = Tools.HashDocumentNameForTemporaryIndex(fullName);
            name          = provider + "|" + fullName;
            title         = fullName.Substring(Tools.GetDirectoryName(fullName).Length);
            this.dateTime = dateTime;
            this.provider = provider;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="T:PageAttachmentDocument" /> class.
        /// </summary>
        /// <param name="page">The page.</param>
        /// <param name="name">The attachment name.</param>
        /// <param name="provider">The file provider.</param>
        /// <param name="dateTime">The modification date/time.</param>
        public PageAttachmentDocument(PageInfo page, string name, string provider, DateTime dateTime)
        {
            if (page == null)
            {
                throw new ArgumentNullException("page");
            }
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            if (name.Length == 0)
            {
                throw new ArgumentException("Name cannot be empty", "name");
            }
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }
            if (provider.Length == 0)
            {
                throw new ArgumentException("Provider cannot be empty", "provider");
            }

            this.name     = page.FullName + "|" + provider + "|" + name;
            id            = Tools.HashDocumentNameForTemporaryIndex(this.name);
            title         = name;
            this.dateTime = dateTime;
            this.page     = page;
            this.provider = provider;
        }