コード例 #1
0
        /// <summary>
        /// 反序列化
        /// </summary>
        /// <param name="info">SerializationInfo</param>
        /// <param name="context">StreamingContext</param>
        protected UrlManager(SerializationInfo info, StreamingContext context)
        {
            this.policy = info.GetValue("policy", typeof(UrlManagePolicy)) as UrlManagePolicy;
            UrlCollection urls = info.GetValue("urls", typeof(UrlCollection)) as UrlCollection;
            if (null != urls)
            {
                foreach (Url url in urls)
                {
                    this.AddOrRemoveItem(url, false);
                }
                urls.Clear();

                this.InitItemsCount();
            }
        }
コード例 #2
0
        protected UrlManager()
        {
            this.dumpState = false;
            this.policy = this.GetManagePolicy();

            this.lists = new List<KeyValuePair<uint, Url>>[10];
            this.listsIndex = new Dictionary<uint, int>[10];
            this.listInitItems = new Dictionary<int, int>();

            for (int i = 0; i < 10; i++)
            {
                this.lists[i] = new List<KeyValuePair<uint, Url>>();
                this.listsIndex[i] = new Dictionary<uint, int>();
                this.listInitItems.Add(i, 0);
            }
        }