예제 #1
0
 public LanguageExpression GetModuleResourceIdExpression(ModuleSymbol moduleSymbol)
 {
     return(ScopeHelper.FormatCrossScopeResourceId(
                this,
                context.ModuleScopeData[moduleSymbol],
                TemplateWriter.NestedDeploymentResourceType,
                GetModuleNameExpression(moduleSymbol).AsEnumerable()));
 }
예제 #2
0
        private LanguageExpression GenerateScopedResourceId(ResourceSymbol resourceSymbol, ResourceScope?targetScope)
        {
            var typeReference = EmitHelpers.GetTypeReference(resourceSymbol);
            var nameSegments  = GetResourceNameSegments(resourceSymbol, typeReference);

            if (!context.ResourceScopeData.TryGetValue(resourceSymbol, out var scopeData))
            {
                return(ScopeHelper.FormatLocallyScopedResourceId(targetScope, typeReference.FullyQualifiedType, nameSegments));
            }

            return(ScopeHelper.FormatCrossScopeResourceId(this, scopeData, typeReference.FullyQualifiedType, nameSegments));
        }