Пример #1
0
 public TemplateGenerator()
 {
     ReferencePaths.Add(Path.GetDirectoryName(typeof(int).Assembly.Location).Replace("Microsoft.NETCore.App", "Microsoft.AspNetCore.App"));
     Refs.Add(typeof(TextTransformation).Assembly.Location);
     Refs.Add(typeof(Uri).Assembly.Location);
     Refs.Add(typeof(File).Assembly.Location);
     Refs.Add(typeof(StringReader).Assembly.Location);
     Imports.Add("System");
 }
Пример #2
0
 public static void AddReferences(params Type[] types)
 {
     foreach (var type in types)
     {
         if (!ReferencePaths.Contains(type.Assembly.Location))
         {
             ReferencePaths.Add(type.Assembly.Location);
         }
     }
 }
Пример #3
0
 public static void AddReferences(params string[] assemblies)
 {
     foreach (var assembly in assemblies)
     {
         if (!ReferencePaths.Contains(assembly))
         {
             ReferencePaths.Add(assembly);
         }
     }
 }
Пример #4
0
 public static void AddReferences(params Assembly[] assemblies)
 {
     foreach (var assembly in assemblies)
     {
         if (!ReferencePaths.Contains(assembly.Location))
         {
             ReferencePaths.Add(assembly.Location);
         }
     }
 }
Пример #5
0
        public void AddReference(FilePath path)
        {
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }

            _log.Debug("Adding reference to {0}...", path.GetFilename().FullPath);
#if NETCORE
            References.Add(_loader.Load(path, true));
#else
            ReferencePaths.Add(path);
#endif
        }
Пример #6
0
        public static void AddReferences(params Type[] types)
        {
            if (_initialized)
            {
                throw new InvalidOperationException("Compilador só pode ser executado no Pre-Start!");
            }

            foreach (var type in types)
            {
                if (!ReferencePaths.Contains(type.Assembly.Location))
                {
                    ReferencePaths.Add(type.Assembly.Location);
                }
            }
        }
 /// <summary>
 /// Add a new entity path reference to this existing entity.
 /// </summary>
 /// <param name="path">The path that can be used to reach this entity.</param>
 public void AddReferencePath(EntityPath path)
 {
     ReferencePaths.Add(path);
 }