internal ReferencedTypeCache(Compilation compilation,IFactoryAccess factoryAccess)
 {
     this.compilation = compilation;
      this.factoryAccess = factoryAccess;
      metadataLookup = new Dictionary<string, IType>();
      builtTrees = new Dictionary<SyntaxTree, IRoot>();
 }
예제 #2
0
        private Dictionary <SyntaxTree, IRoot> builtTrees; // not sure we'll use this

        internal ReferencedTypeCache(Compilation compilation, IFactoryAccess factoryAccess)
        {
            this.compilation   = compilation;
            this.factoryAccess = factoryAccess;
            metadataLookup     = new Dictionary <string, IType>();
            builtTrees         = new Dictionary <SyntaxTree, IRoot>();
        }
예제 #3
0
 public RDomRootGroup(Compilation compilation, IFactoryAccess factoryAccess)
     : base(compilation)
 {
     _compilation         = compilation;
     _referencedTypeCache = new ReferencedTypeCache(compilation, factoryAccess);
     _roots = new RDomCollection <IRoot>(this);
 }
예제 #4
0
 public RDomCorporation(string language, IFactoryAccess factoryAccess)
 {
     language           = language.Replace(ExpectedLanguages.CSharp, ExpectedLanguages.CSharpInSymbols);
     this.factoryAccess = factoryAccess;
     provider2          = new Provider();
     provider2.ConfigureContainer(this);
     LoadFactories(language);
     LoadWorkers(language);
 }
예제 #5
0
 //public RDomRoot(IDom parent, string name = null, string filePath = null)
 //: this(null, parent, null)
 //{
 //   _filePath = filePath;
 //}   
 
 // This takes a parent because in the future there will be a rootGroup concept for multiple files
 public RDomRoot(IFactoryAccess factoryAccess, SyntaxNode rawItem, IDom parent, SemanticModel model)
    : base(rawItem, parent, model)
 {
    var rootGroup = Parent as RDomRootGroup;
    if (rootGroup == null)
    {
       _compilation = model.Compilation;
       _referencedTypeCache = new ReferencedTypeCache(_compilation, factoryAccess);
    }
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="templateRoot"></param>
        /// <remarks>
        /// Currently each expnasion first class wraps a single template and templates are
        /// naked RoslynDom trees. Expect this to change because it templates need conditionals
        /// attached, and it's not clear that this runner should interface, surface decisions
        /// regarding that conditionals. Also, it should not be up to an external client
        /// to loop through multiple metadata sets - each call to run is one metadata set.
        /// And in case you weren't already convinced this is a bad place for a complex
        /// dependency, someone needs to manage file boundaries for file based geenration and
        /// fragment based for fragment based generation.
        /// </remarks>
        public ExpansionFirstTemplate(IFactoryAccess factoryAccess, IRoot templateRoot)
        {
            this.factoryAccess = factoryAccess;
            this.templateRoot  = templateRoot;
            var filePathHint = templateRoot.Descendants
                               .OfType <IPublicAnnotation>()
                               .Where(x => x.Name == "_xf_FilePathHint")
                               .FirstOrDefault();

            if (filePathHint != null)
            {
                this.filePathHint = filePathHint.GetValue("").ToString();
            }

            Initialize();
        }