Ejemplo n.º 1
0
 public override void Initialize()
 {
     lock (this) {
         Setup();
         if (File.Exists(ResolvedFilePath))
         {
             _file = ResolvedFilePath;
             var bsharpresult = BSharpCompiler.CompileFile(_file);
             foreach (
                 var cls in
                 bsharpresult.ResolveAll("pwd").OrderBy(_ => _.Compiled.Attr("idx").ToInt()))
             {
                 foreach (var element in cls.Compiled.Elements("usr"))
                 {
                     var record = new User();
                     UserSerializer.ReadXml(record, element);
                     _cache[record.Login] = record;
                 }
             }
             LastCheck    = DateTime.Now;
             LastFileTime = File.GetLastWriteTime(_file);
         }
     }
 }