Ejemplo n.º 1
0
        public void LoadProjectAndResolver(RiotProjectType projectType, out RiotProject riotProject, out Resolver resolver)
        {
            Tuple <WeakReference <RiotProject>, DateTime, WeakReference <Resolver> > tuple;

            if (cache.TryGetValue(projectType, out tuple) &&
                tuple.Item1.TryGetTarget(out riotProject) &&
                tuple.Item3.TryGetTarget(out resolver) &&
                File.GetLastWriteTime(riotProject.ReleaseManifest.Path) == tuple.Item2)
            {
                logger?.Info("Successfully saved project and resolver from GCing: " + projectType);
            }
            else
            {
                logger?.Info("Constructing new project and resolver: " + projectType);
                var riotProjectLoader = new RiotProjectLoader(leagueConfiguration.RadsPath);
                riotProject = riotProjectLoader.LoadProject(projectType);
                resolver    = new Resolver(riotProject.ReleaseManifest.Root, new ResolverConfigurationImpl(systemState));
                var manifestLastModified = File.GetLastWriteTime(riotProject.ReleaseManifest.Path);
                cache[projectType] = new Tuple <WeakReference <RiotProject>, DateTime, WeakReference <Resolver> >(new WeakReference <RiotProject>(riotProject), manifestLastModified, new WeakReference <Resolver>(resolver));
            }
        }
Ejemplo n.º 2
0
 public RadsProjectReference(RiotProject value)
 {
     this.value = value;
 }
Ejemplo n.º 3
0
 public void Dispose()
 {
     value = null;
 }
 public RadsProjectReference(RiotProject value)
 {
    this.value = value;
 }
 public void Dispose() { value = null; }