Ejemplo n.º 1
0
		/// <summary>
		/// Gets the Infor for a specific item id.
		/// </summary>
		/// <param name="itemId">Item ID which we are looking up.  Will be normalized internally.</param>
		/// <returns>Returns Infor for item ID and NULL if not found.</returns>
		public Info GetInfo(string itemId)
		{
			if (string.IsNullOrEmpty(itemId))
				return null;

			itemId = TQData.NormalizeRecordPath(itemId);

			return this.infoDB.GetOrAddAtomic(itemId, k =>
			{
				DBRecordCollection record = null;
				// Add support for searching a custom map database
				if (this.ArzFileMod != null)
					record = arzProv.GetItem(this.ArzFileMod, k);

				// Try the expansion pack database first.
				if (record == null && this.ArzFileIT != null)
					record = arzProv.GetItem(this.ArzFileIT, k);

				// Try looking in TQ database now
				if (record == null || this.ArzFileIT == null)
					record = arzProv.GetItem(this.ArzFile, k);

				if (record == null)
					return null;

				return new Info(record);
			});
		}
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the Infor for a specific item id.
        /// </summary>
        /// <param name="itemId">Item ID which we are looking up.  Will be normalized internally.</param>
        /// <returns>Returns Infor for item ID and NULL if not found.</returns>
        public Info GetInfo(string itemId)
        {
            Info result = null;

            if (string.IsNullOrEmpty(itemId))
            {
                return(result);
            }

            itemId = TQData.NormalizeRecordPath(itemId);
            Info info;

            if (infoDB.ContainsKey(itemId))
            {
                info = this.infoDB[itemId];
            }
            else
            {
                DBRecordCollection record = null;
                // Add support for searching a custom map database
                if (this.ArzFileMod != null)
                {
                    record = arzProv.GetItem(this.ArzFileMod, itemId);
                }

                // Try the expansion pack database first.
                if (record == null && this.ArzFileIT != null)
                {
                    record = arzProv.GetItem(this.ArzFileIT, itemId);
                }

                // Try looking in TQ database now
                if (record == null || this.ArzFileIT == null)
                {
                    record = arzProv.GetItem(this.ArzFile, itemId);
                }

                if (record == null)
                {
                    return(null);
                }

                info = new Info(record);
                this.infoDB.Add(itemId, info);
            }

            return(info);
        }