コード例 #1
0
        private void InitRequestManager()
        {
            FileDealRequest = new File("DealRequest", true);
            ThreadRequest   = new ThreadedMethod(100, System.Threading.ThreadPriority.Highest, 1);
            DataDealRequest = new ThreadedDictionary <TickTime, DealRequest>();

            string data = FileDealRequest.Load();

            if (System.String.IsNullOrEmpty(data))
            {
                return;
            }

            DataDealRequest.XmlDeserialize(data);
        }
コード例 #2
0
ファイル: Captcha09.cs プロジェクト: jeason0813/Asmodat
        private void LoadData()
        {
            if (Database.Count <= 0)
            {
                return;
            }

            string[] keys   = Database.Keys;
            object[] values = Database.Values;


            for (int i = 0; i < keys.Length; i++)
            {
                string key  = keys[i];
                string data = (string)values[i];

                var    split  = key.SplitSafe('-');
                string name   = split[0];
                int    number = int.Parse(split[1]);

                ThreadedDictionary <string, double> buffor = new ThreadedDictionary <string, double>();
                buffor.XmlDeserialize(data);

                if (!Data.ContainsKey(number))
                {
                    Data.Add(number, new ThreadedList <Dictionary <string, double> >(), true);
                }

                Data[number].Add((Dictionary <string, double>)buffor);

                if (!LoadedFiles.Contains(name))
                {
                    LoadedFiles.Add(name);
                }
            }
        }