public string CacheUsername(long uid, string username) { string previous; lock (CachedData) { try { previous = CachedData[uid].Username; CachedData[uid] = new CachedData(username); } catch (KeyNotFoundException) { previous = null; CachedData.Add(uid, new CachedData(username)); } } CommitCache(); return(previous); }
public virtual void ReadChildData(BinaryReader reader) { int x = 0; for (x = 0; (x < _shaders.Count); x = (x + 1)) { Shaders.Add(new DecoratorShaderReferenceBlockBlock()); Shaders[x].Read(reader); } for (x = 0; (x < _shaders.Count); x = (x + 1)) { Shaders[x].ReadChildData(reader); } for (x = 0; (x < _classes.Count); x = (x + 1)) { Classes.Add(new DecoratorClassesBlockBlock()); Classes[x].Read(reader); } for (x = 0; (x < _classes.Count); x = (x + 1)) { Classes[x].ReadChildData(reader); } for (x = 0; (x < _models.Count); x = (x + 1)) { Models.Add(new DecoratorModelsBlockBlock()); Models[x].Read(reader); } for (x = 0; (x < _models.Count); x = (x + 1)) { Models[x].ReadChildData(reader); } for (x = 0; (x < _rawVertices.Count); x = (x + 1)) { RawVertices.Add(new DecoratorModelVerticesBlockBlock()); RawVertices[x].Read(reader); } for (x = 0; (x < _rawVertices.Count); x = (x + 1)) { RawVertices[x].ReadChildData(reader); } for (x = 0; (x < _indices.Count); x = (x + 1)) { Indices.Add(new DecoratorModelIndicesBlockBlock()); Indices[x].Read(reader); } for (x = 0; (x < _indices.Count); x = (x + 1)) { Indices[x].ReadChildData(reader); } for (x = 0; (x < _cachedData.Count); x = (x + 1)) { CachedData.Add(new CachedDataBlockBlock()); CachedData[x].Read(reader); } for (x = 0; (x < _cachedData.Count); x = (x + 1)) { CachedData[x].ReadChildData(reader); } _resourceData.ReadBinary(reader); for (x = 0; (x < _resources.Count); x = (x + 1)) { Resources.Add(new GlobalGeometryBlockResourceBlockBlock()); Resources[x].Read(reader); } for (x = 0; (x < _resources.Count); x = (x + 1)) { Resources[x].ReadChildData(reader); } }