예제 #1
0
            public override async Task FixAsync(DataCenter dataCenter)
            {
                switch (this.Type)
                {
                case ErrorType.FlagCount:
                    var flag = await dataCenter.FlagManager.FindAsync(JryFlag.BuildFlagId(this.type, this.value));

                    if (flag != null)
                    {
                        flag.Count = this.count;
                        await dataCenter.FlagManager.UpdateAsync(flag);
                    }
                    else
                    {
                        Debug.Assert(false);
                    }
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }
예제 #2
0
        private async Task BuildFlagAsync()
        {
            await this.dataCenter.FlagManager.Source.CursorAsync(z =>
            {
                var type = (int)z.Type;
                var dest = this.flagRefs.GetOrCreateValue(type);
                if (string.IsNullOrEmpty(z.Value) || z.Id != JryFlag.BuildFlagId(z.Type, z.Value))
                {
                    if (Debugger.IsAttached)
                    {
                        Debugger.Break();
                    }
                    Debug.Assert(false);
                }
                dest.Add(z.Value, z.Count);
            });

            foreach (var dictPair in this.flagRefs)
            {
                var d = new Dictionary <string, int>(dictPair.Value.Count);
                d.AddRange(dictPair.Value.ToList());
                this.originFlagRefs[dictPair.Key] = d;
            }
        }