Ejemplo n.º 1
0
        /// <summary>
        /// Load Informations about a specific Want
        /// </summary>
        /// <param name="guid">The GUID of the want</param>
        /// <returns>A Want Information Structure</returns>
        public static WantInformation LoadWant(uint guid)
        {
            LoadCache();
            if (wantcache == null)
            {
                wantcache = cachefile.Map;
            }

            if (wantcache.ContainsKey(guid))
            {
                object          o = wantcache[guid];
                WantInformation wf;
                if (o.GetType() == typeof(WantInformation))
                {
                    wf = (WantInformation)o;
                }
                else
                {
                    wf = WantCacheInformation.LoadWant((WantCacheItem)o);
                }

                return(wf);
            }
            else
            {
                WantInformation wf = new WantInformation(guid);
                wantcache[guid] = wf;
                cachefile.AddItem(wf);
                return(wf);
            }
        }